Borrowing it
Nothing to install: this file belongs to geq1fan/context-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/geq1fan/context-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/geq1fan/context-mcpWrote 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.
[](https://agentmods.dev/instructions/geq1fan/context-mcp/claude-md)<a href="https://agentmods.dev/instructions/geq1fan/context-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/geq1fan/context-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00996 | $0.00996 |
| Opus 5 | $0.00498 | $0.00498 |
| Sonnet 5 | $0.00199 | $0.00199 |
| Haiku 4.5 | $0.00100 | $0.00100 |
Grade A, and why
context-mcp CLAUDE.md scanned grade A with 1 finding 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 6d 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
4. **超时控制**: subprocess.run(timeout=60) How it starts
The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context MCP: 项目上下文集成服务
Generated: 2025-10-03 | Feature: 001-agent-mcp-md
项目概述
创建一个MCP服务,允许AI Agent通过标准化接口访问和分析任意项目的代码上下文。服务提供只读文件系统操作能力,包括目录导航、内容搜索、文件读取和AI上下文发现。
技术栈
语言: Python 3.11+ 框架: fastmcp (MCP框架), ripgrep (搜索加速) 打包: uv + uvx模式 测试: pytest (契约/集成/单元测试)
项目结构
context_mcp/
├── server.py # FastMCP服务器入口
├── config.py # 环境变量配置
├── tools/ # MCP工具实现
│ ├── navigation.py # list_directory, show_tree
│ ├── search.py # 4个搜索工具
│ └── read.py # 4个读取工具
├── validators/ # 路径安全验证
└── utils/ # 文件检测、日志
tests/
├── contract/ # MCP契约测试
├── integration/ # 集成测试
└── unit/ # 单元测试
核心设计决策
- FastMCP装饰器模式:
@mcp.tool()定义工具函数 - 路径安全:
Path.resolve()防目录遍历攻击 - 二进制检测: NULL字节检测法
- 超时控制: subprocess.run(timeout=60)
- ripgrep优先: 回退grep保证兼容性
环境变量
PROJECT_ROOT: 项目根目录(必须)SEARCH_TIMEOUT: 搜索超时秒数(默认60)
MCP工具清单
导航(3个)
list_directory: 列出目录,支持排序和limitshow_tree: 树状展示,支持max_depthread_project_context: 读取AI上下文文件(AGENTS.md, CLAUDE.md)
搜索(4个)
search_in_file: 单文件搜索search_in_files: 多文件递归搜索,支持正则、排除find_files_by_name: 按名称查找(通配符)find_recently_modified_files: 按修改时间查找
读取(4个)
read_entire_file: 读取完整文件read_file_lines: 读取指定行范围read_file_tail: 读取末尾N行read_files: 批量读取
安全约束
- ✅ 只读操作(禁止写入/删除)
- ✅ 路径限制在PROJECT_ROOT内
- ✅ 拒绝二进制文件读取
- ✅ 文件权限检查
最近变更
- Phase 1完成: 数据模型、契约定义、quickstart
- 定义10个MCP工具契约(JSON Schema)
- 确定三层测试策略(契约/集成/单元)
- 完成测试覆盖补充(005-tool): 29个新增测试用例覆盖所有MCP工具参数,103个contract测试全部通过,参数覆盖率100%
测试覆盖现状
- Contract测试: 103个测试(29个新增于005-tool),覆盖11个MCP工具的所有参数边界和组合
- 测试通过率: 100% (103 passed, 1 skipped)
- 参数覆盖率: 100% (所有工具参数都有专门测试验证)
- 边界测试: limit=0/1, max_depth边界, 正则+排除组合, 行范围超出等29个关键场景
参考文档
- Spec:
specs/001-agent-mcp-md/spec.md - Plan:
specs/001-agent-mcp-md/plan.md - Research:
specs/001-agent-mcp-md/research.md - Data Model:
specs/001-agent-mcp-md/data-model.md - Contracts:
specs/001-agent-mcp-md/contracts/ - Quickstart:
specs/001-agent-mcp-md/quickstart.md - 005-tool测试覆盖清单:
specs/005-tool/contracts/test-coverage-checklist.md
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.
- 6d ago First seen · 97 lines · 996 tokens per session scan A 762dfcb4de35
context-mcp CLAUDE.md is an instructions file published in the GitHub repository geq1fan/context-mcp (5 stars, last pushed 10mo ago), licensed MIT. It adds 996 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
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.
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.
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).
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).
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.
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.