mcpcat AGENTS.md

mcpcat AGENTS.md is an instructions file for Codex, OpenCode from jeweis/mcpcat. It costs 2,008 tokens per session, scanned A, original, MIT.

Repository instructions for mcpcat, a Chinese-language platform that manages multiple MCP servers through one FastAPI service. FastAPI is a Python framework for building web APIs.

In plain words
What is it for?
Use them to install dependencies, start the service, run tests and checks, build containers, and understand the server-management architecture.
Why use it?
They explain how the application loads servers, handles authentication, manages lifecycles, and runs development and test commands.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jeweis/mcpcat/agents-md
Clone the repo
git clone --depth 1 https://github.com/jeweis/mcpcat

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcpcat AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jeweis/mcpcat/agents-md.svg)](https://agentmods.dev/instructions/jeweis/mcpcat/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/jeweis/mcpcat/agents-md"><img src="https://agentmods.dev/badge/instructions/jeweis/mcpcat/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,008 This file is loaded in full into every session.
When invoked 2,008 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02008 $0.02008
Opus 5 $0.01004 $0.01004
Sonnet 5 $0.00402 $0.00402
Haiku 4.5 $0.00201 $0.00201

Measured 5d ago against content hash 2f53d1ea120e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcpcat AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 176 lines

How it starts

The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

本文件为 AI 在此代码仓库中工作时提供指导。

请始终使用中文输出。

构建和运行命令

# 安装依赖
pip install -r requirements.txt

# 运行开发服务器
python main.py
# 或启用热重载
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

# 运行测试
pytest

# 代码格式化
black .
isort .

# 代码检查
flake8

# Docker
docker build -t mcpcat:dev .
docker-compose up -d

架构概述

mcpcat 是一个 MCP(Model Context Protocol)聚合平台,通过统一的 FastAPI 接口管理多个 MCP 服务器。

核心流程(main.py)

  1. 模块加载时:创建全局 MCPServerManager 实例
  2. 配置加载:调用 load_config()ConfigService.load_mcp_servers_config()
  3. 安全初始化security_service.ensure_default_keys() 首次启动时自动创建默认 API Key
  4. 服务器加载server_manager.load_servers_from_config() 遍历配置,通过 MCPServerFactory 创建 FastMCP 实例
  5. 应用创建:创建 FastAPI 应用,添加 AuthMiddleware,挂载所有服务器
  6. 生命周期管理lifespan_manager 调用 server_manager.create_unified_lifespan() 统一管理所有 MCP 生命周期

核心组件

MCPServerManager (app/services/server_manager.py)

  • MCP 服务器生命周期的中央调度器
  • add_mcp_server(): 创建 FastMCP 实例、生成 mcp_app/sse_app、创建 MCPProxyApp 代理
  • mount_all_servers(): 将代理应用挂载到 FastAPI
  • create_unified_lifespan(): 使用 AsyncExitStack 管理所有 MCP 生命周期
  • 维护 server_info 字典:存储 config、mcp、mcp_app、sse_app、status

MCPProxyApp (app/services/server_manager.py)

  • ASGI 代理应用,包装实际的 MCP 应用
  • 根据 transport_type('mcp' 或 'sse')转发请求到对应的应用实例
  • 实现运行时实例切换,无需重启应用

MCPServerFactory (app/services/mcp_factory.py)

  • 根据 type 字段创建 FastMCP 实例:
    • stdio: FastMCP.as_proxy() 配置 command/args/env
    • sse: FastMCP.as_proxy() 配置 url/transport="sse"/headers
    • streamable-http: FastMCP.as_proxy() 配置 url/transport="streamable-http"/headers
    • openapi: FastMCP.from_openapi() 配置 spec_url/api_base_url/route_configs

ConfigService (app/services/config_service.py)

  • 配置文件路径:settings.mcpcat_config_path(默认 .mcpcat/config.json
  • load_raw_config(): 返回完整配置(包含 mcpServers、security、app)
  • load_mcp_servers_config(): 只返回 mcpServers 部分
  • add_server_to_config() / update_server_config() / remove_server_from_config(): 配置 CRUD

Read the full file on GitHub · 176 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 176 lines · 2,008 tokens per session scan A 2f53d1ea120e

Subscribe to this mod's changes

mcpcat AGENTS.md is an instructions file published in the GitHub repository jeweis/mcpcat (10 stars, last pushed 6d ago), licensed MIT. It adds 2,008 tokens to every session, about $0.0100 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-release stance: foundation over blast radius, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,719 tokens