mcp CLAUDE.md

Chinese-language instructions for developing an MCP project, a program that lets AI assistants use external tools or data, including documentation, logging, coding, build, and output rules.

In plain words
What is it for?
Use it when changing this MCP project, updating its documentation, adding database-backed tools, handling errors, recording logs, or compiling the server.
Why use it?
It gives contributors one shared checklist for required practices and evidence of success. It also explains project-specific restrictions such as where logs and compiled files must go.

Instructions file

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/comcpwork/mcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/comcpwork/mcp
Per session 1,393 This file is loaded in full into every session.
When invoked 1,393 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.01393 $0.01393
Opus 5 $0.00696 $0.00696
Sonnet 5 $0.00279 $0.00279
Haiku 4.5 $0.00139 $0.00139

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

Security

Grade A, and why

mcp CLAUDE.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 2d 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.

CLAUDE.md · 160 lines

How it starts

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

MCP 项目开发要求

零、文档规范

  • 必须在需要用户填写的内容处使用 <> 标记,如 /home/<username>/
  • 必须明确告知用户需要替换占位符为实际值
  • 必须同步更新 README.md 和 README_CN.md,保持中英文版本一致
  • 必须在修改 README 时,确保两个语言版本的内容完全对应

一、强制要求(MUST DO)

1. 成功证明要求

当宣布任何功能或修改成功时,必须提供充分且不可辩驳的证据

2. 命名规范

  • 必须文件名使用英文
  • 必须代码注释使用中文
  • 必须文档内容使用中文

3. 文档查阅

  • 必须使用 Context7 查看最新的编码文档和 API 文档
  • 必须在不知道如何使用某个库时,先通过 Context7 获取使用方法
  • 禁止直接猜测 API 用法

4. 日志规范

  • 必须使用 mcp/pkg/log 包进行日志记录
  • 必须将日志输出到文件 ~/.co-mcp/logs/<server>.log
  • 必须使用统一的字段名常量(如 common.FieldTool, common.FieldSQL
  • 必须为关键操作添加日志(工具开始、连接状态、错误等)
  • 禁止使用标准库的 log
  • 禁止输出日志到 stdout/stderr

5. 代码规范

  • 必须使用 common/constants.go 中定义的常量
  • 必须使用 common/errors.go 中的错误类型和函数
  • 必须使用 common/batch_query.go 实现批量查询
  • 必须使用 common/config_handler.go 的基础配置处理器
  • 禁止使用全局变量
  • 禁止使用 init() 函数
  • 禁止硬编码数字(如 1000, 3306, 30000)
  • 禁止自定义错误类型(使用 common 包中的)
  • 禁止在多个 provider 中重复相同代码

6. 编译规范

  • 必须使用 make 命令进行编译
  • 必须将二进制文件输出到 ~/go/bin/mcp/
  • 禁止直接使用 go build
  • 禁止在源码目录中保留二进制文件

7. MCP 服务器规范

  • 必须使用懒加载机制连接数据库
  • 必须在没有配置时能正常启动
  • 必须在连接失败时返回清晰错误信息
  • 禁止在启动时立即初始化数据库连接

8. 输出格式

  • 必须使用紧凑输出格式
  • 必须所有 MCP 工具的返回都必须使用 compact 格式
  • 必须所有输出使用英文(表头、字段名、状态信息)
  • 必须所有参数描述使用英文
  • 必须在 describe_table 中包含 COMMENT 信息

9. 测试规范

  • 必须将测试文件放在 test/ 目录下
  • 必须测试文件命名为 test_<功能>.py
  • 必须覆盖关键功能和边界情况

二、建议做(SHOULD DO)

1. 日志级别

  • 建议使用正确的日志级别:
    • Debug: 详细调试信息
    • Info: 正常操作信息
    • Warn: 可能的问题
    • Error: 操作失败

2. 错误处理

  • 建议使用 errors.Wrap() 保留错误上下文
  • 建议为用户返回友好的错误消息
  • 建议在日志中记录详细错误信息

3. 代码组织

  • 建议依赖注入优于全局状态
  • 建议提取通用功能到 common 包
  • 建议保持函数简短,单一职责

三、可以做(MAY DO)

1. 测试工具

  • 可以使用 Python 脚本进行功能测试
  • 可以使用 MCP 客户端库进行测试
  • 可以使用自定义客户端封装

2. 扩展功能

  • 可以添加新的工具和资源
  • 可以扩展现有功能
  • 可以优化性能

四、操作清单

修改代码前

  • 查看 Context7 了解相关 API
  • 检查 common 包是否有可复用功能
  • 确认没有硬编码数值

修改代码后

  • 运行 make build 确保编译通过
  • 运行相关测试脚本
  • 检查日志输出是否规范
  • 确认没有重复代码
  • 如果修改了 README.md,必须同步更新 README_CN.md

Read the full file on GitHub · 160 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. 2d ago First seen · 160 lines · 1,393 tokens per session scan A 74d73d1762e1

Subscribe to this mod's changes

mcp CLAUDE.md is an instructions file published in the GitHub repository comcpwork/mcp (2 stars, last pushed 6mo ago), licensed MIT. It adds 1,393 tokens to every session, about $0.0070 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.