mcpcat: Instructions file for Codex

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is jeweis/mcpcat's own configuration. It tells Codex and OpenCode how to work on mcpcat itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcpcat configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jeweis/mcpcat. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jeweis/mcpcat/main/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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcpcat AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jeweis/mcpcat/agents-md"><img src="https://agentmods.dev/badge/instructions/jeweis/mcpcat/agents-md.svg" alt="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02008 $0.02008
Opus 5.5 $0.00803 $0.00803
Sonnet 5.5 $0.00402 $0.00402
Haiku 4.5 $0.00201 $0.00201

Measured 1mo ago against content hash 2f53d1ea120e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (11 stars, last pushed 3d ago), licensed MIT. It adds 2,008 tokens to every session, about $0.0080 per session on Opus 5.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 · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,384 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens