Borrowing it
Nothing to install: this file belongs to qipeijun/swagger-docs-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/qipeijun/swagger-docs-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/qipeijun/swagger-docs-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/qipeijun/swagger-docs-mcp/claude-md)<a href="https://agentmods.dev/instructions/qipeijun/swagger-docs-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/qipeijun/swagger-docs-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.01469 | $0.01469 |
| Opus 5 | $0.00734 | $0.00734 |
| Sonnet 5 | $0.00294 | $0.00294 |
| Haiku 4.5 | $0.00147 | $0.00147 |
Grade A, and why
swagger-docs-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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
项目概述
swagger-docs-mcp 是一个无状态、只读的 MCP 服务器,让 AI 代理能实时查询在线 Swagger 2.0 文档。支持从 doc.html(Knife4j/Springfox)和 Swagger JSON 直链两种入口发现文档,提供 5 个 Tool:inspect_api_docs、list_api_categories、get_api_category、get_api_by_path、search_apis。
核心设计约束:
- 每次 Tool 调用都必须显式传入
docsUrl,服务不保存地址 - 不缓存文档内容,每次调用实时获取
- 只读:不调用业务 API,不通过 URL 认证,不读取外部
$ref - 仅支持 Swagger 2.0,OpenAPI 3 返回明确的不支持错误
常用命令
npm run check # 类型检查 + 测试 + 构建(完整 CI 检查)
npm run build # 编译到 dist/
npm test # 运行所有单元测试
npm run test:watch # 监听模式测试
npm run test:integration # 仅运行 MCP 协议集成测试
npm run typecheck # 仅类型检查(不构建)
npm run dev # tsx 直接运行 src/index.ts
node dist/index.js doctor [docsUrl] [--group <name>] # 诊断命令
check 是提交前必须通过的完整检查。npm run dev 用于本地 MCP stdio 模式调试。
架构分层
代码按稳定边界分层,依赖方向从底层到上层:
src/domain/types.ts # 领域类型、枚举、接口(无依赖)
src/errors.ts # 错误码、错误阶段、AppError(无依赖)
src/parser/types.ts # 解析器抽象接口 ApiSpecParser
src/source/ # HTTP 安全获取 + 文档入口发现(SafeHttpClient → DocumentDiscoveryService)
src/navigation/ # Knife4j hash 线索解析(纯函数,不接触网络)
src/swagger2/ # Swagger 2.0 解析器实现 ApiSpecParser
src/service/ # 客户端无关的查询服务 ApiDocsService(编排层)
src/server/ # MCP Tool 注册,依赖 MCP SDK
src/cli/ # CLI 入口(serve/doctor/setup/remove),依赖 @modelcontextprotocol/sdk
src/index.ts # 二进制入口
src/version.ts # 从 package.json 读取版本号
关键设计点:
ApiSpecParser(src/parser/types.ts)是解析器的可扩展接口。新增 OpenAPI 3 支持时只需新增实现类,无需改动 Tool 契约和上层代码。ApiDocsService是核心编排层:接收docsUrl+group→ 调用DocumentDiscoveryService发现文档 → 匹配解析器 → 返回LoadedApiDocument。所有 5 个 Tool 都通过它完成查询。DocumentDiscoveryService按适配器模式组织:先用SafeHttpClient获取入口 URL,再交给合适的DocumentDiscoveryAdapter(RawJsonDiscoveryAdapter处理 JSON 直链,SpringfoxDiscoveryAdapter处理 HTML 页面的swagger-resources发现)。SchemaNode→FlatSchemaField的两层结构:Swagger2SchemaAnalyzer.buildNode()构建树形 schema 含$ref递归解析、allOf合并、additionalProperties动态键;flatten()再展平为可检索的flatFields。同时标记unresolvedDynamicFields、recursionBoundary、循环引用等解析边界。
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 · 100 lines · 1,469 tokens per session scan A 28090253b3e0
swagger-docs-mcp CLAUDE.md is an instructions file published in the GitHub repository qipeijun/swagger-docs-mcp (1 stars, last pushed 1mo ago), licensed MIT. It adds 1,469 tokens to every session, about $0.0073 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.
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.