openapi-md-mcp
openapi-md-mcp
OpenAPI spec을 점진적 공개(progressive disclosure)하여 markdown으로 제공하는 MCP 서버.
왜
Swagger UI(
/docs)는 JS 셸이라 AI가 내용을 가져올 수 없음/openapi.json전체는 흔히 수십 K tokens에 달해 통째로 컨텍스트에 넣기에는 너무 비쌈이 도구는 AI 상주 컨텍스트를 「키 + 요약」 엔드포인트 표(~1k tokens)로 유지하고, 키로 드릴다운하여 단일 엔드포인트 / 단일 schema의 markdown 상세를 가져온다. 실측 ~90% 컨텍스트 절약
Related MCP server: OpenAPI MCP Server
도구 구성(점진적 공개, 출력은 모두 markdown)
tool | 입력 | 출력 |
|
| 엔드포인트 표 |
|
| 엔드포인트 상세: 인증, 파라미터 표, request body($ref는 1단계만 인라인), responses |
|
| schema 속성 표 + 중첩 |
|
| 일괄 선택: 인증 열이 포함된 엔드포인트 키 표 + 일치하는 schema 이름(수평 집계, 예: 「모든 인증 엔드포인트」) |
|
| 일괄 드릴다운: 혼합 키를 한 번에 모두 가져오고, 참조된 schema는 자동으로 통합해 중복 제거 부록 구성 |
드릴다운 키 = METHOD /path 또는 schema 이름이며, 상위 출력에서 바로 얻는다.
배치 모드(select + get_batch)
select(patterns=["GET /v1/auth/*", "* /v1/scoring/*"], security="X-Service-Token", tag="scoring", schema_glob="Credit*")patterns 요소는
"METHOD /path/glob"형태: 메서드는*(대소문자 구분 안 함); 경로 glob은 대소문자 구분security는 scheme 이름; patterns 끼리는 OR, security/tag와는 AND매칭 0건은 성공 텍스트를 반환(사용 가능한 scheme / tag + 조건 완화 제안), 오류가 아님
get_batch(["POST /v1/scoring/credit", "CreditBatchRequest"])키는 중복 제거하면서 순서를 유지, 상한 40개; 렌더링 총 문자 수 상한 100k, 초과 시
include_refs=False또는 분할 요청 권장include_refs=True는 렌더링 중 참조되는$ref를 자동으로 통합해「공유 schema 부록」을 만든다(이름마다 한 번만 렌더링)
설정(env)
변수 | 기본값 | 설명 |
|
| 런타임 spec(우선). |
| 비어 있음 | 폴백 spec 파일 경로(런타임에 도달할 수 없을 때 사용) |
|
| 가져오기 타임아웃(초) |
spec은 JSON과 YAML 지원; 로드 후 프로세스 내 60s 캐시
요청은 직접 연결(
trust_env=False): 대상이 localhost / 내부망 spec이므로 시스템 프록시를 거치지 않음(macOS 시스템 프록시가 localhost를 502로 만들 수 있음)읽기 전용이며 API 호출 기능을 제공하지 않음(인증 헤더는 MCP 계층으로 들어가지 않음)
어떤 저장소든 연동
Claude Code 사용자 수준 등록(한 번 등록하면 모든 저장소에서 사용 가능):
claude mcp add openapi-md -s user -- \
uv run --directory /path/to/openapi-md-mcp openapi-md-mcp다른 데이터 소스가 필요한 저장소는 각자 프로젝트 수준 .mcp.json에서 env를 덮어쓰면 된다.
프로토콜 준수(MCP 2026-07-28, 일명 2.0)
도구 이름 / 설명 / inputSchema가 규격 §Tools를 충족(이름 문자셋과 길이, 결정적
tools/list순서)다섯 도구 모두
annotations.readOnlyHint: true를 선언(읽기 전용)오류 의미는 규격 §Tools Error Handling을 따른다: spec 로드 실패, 알 수 없는 키(유사 키 제안 포함), 잘못된 필터 패턴과 일괄 상한 초과는 Tool Execution Error로
ToolError를 던짐 → 실제로는CallToolResult(isError=true)로 나타나며, 클라이언트는 제안을 모델에 되먹여 자가 수정하게 한다. 매칭 0건은 성공 텍스트;call(API 호출)기능은 제공하지 않음버전 협상: stdio는 initialize 핸드셰이크 에포크를 사용(최대 2025-11-25); 2026-07-28의 무상태 봉투 에포크는 SDK가 HTTP 전송 계층에서 처리(
server/discover), stdio 시나리오에는 해당하지 않음
개발
uv sync # 安装依赖
uv run pytest --cov=openapi_md_mcp # 测试(fixture 为真实 OpenAPI 3.1 快照)Available Tools
5 toolsget_batchARead-only
批量获取端点详情与 schema 属性表,引用的 schema 自动整合为共享附录(去重)。keys 混合 "METHOD /path" 端点键与 schema 名(去重后 ≤40 个);键从 list_endpoints / select 获得。
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | ||
| include_refs | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=true, and the description matches (batch get). The description adds non-obvious behavioral details: automatic deduplication of referenced schemas into a shared appendix, a hard limit of 40 keys after dedup, and the mixed key format. This exceeds the baseline provided by the readOnly hint.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, each adds distinct value: the first states the core operation and dedup behavior; the second specifies key types, source, and limits. No fluff, efficient front-loading, and the most critical constraint (≤40) is highlighted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema covers return format, so that's adequate. The description covers the key parameter well but leaves include_refs unexplained. Given the tool is a batch utility with siblings, the missing parameter explanation and the lack of explicit when-to-use guidance make it only partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for both parameters. It thoroughly explains 'keys' (format, source, dedup, cap) but completely omits 'include_refs'. The missing semantics for a boolean parameter that likely controls whether the shared appendix is included is a significant gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear purpose: batch retrieval of endpoint details and schema property tables, with referenced schemas integrated into a shared appendix. It distinguishes itself from singular siblings like get_endpoint and get_schema by explicitly being a batch operation, though it doesn't name alternatives directly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides guidance on where keys come from ('list_endpoints / select'), implying the intended use case. However, it doesn't explicitly state when to use this tool instead of get_endpoint or get_schema, nor does it describe conditions for not using it. The batch nature is evident but the routing logic is left implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_endpointARead-only
获取单个端点的 markdown 详情(鉴权、参数、请求体、响应)。method 大小写不敏感;键从 list_endpoints 获得。
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| method | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, and the description adds the missing behavioral traits: case-insensitive matching and the dependency on list_endpoints for key discovery. It doesn't describe rate limits or error behavior, but these are minor for a read-only detail fetcher.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One compact sentence starts with the core action, uses a parenthetical for content, then adds two focused notes. No filler or redundant restatement of the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given two simple parameters, an output schema, and a read-only annotation, the description covers the main behavior and parameter provenance. It omits only an explicit alternative-selection rule, which is a minor gap for a low-complexity tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description partially compensates by explaining the method is case-insensitive and that keys originate from list_endpoints. It does not spell out the path format, but the key-source hint is actionable for both parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool extracts markdown details for a single endpoint and enumerates the content (auth, params, request body, response). It distinguishes from siblings by focusing on 'single endpoint' and referencing list_endpoints, without needing the schema to understand scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides explicit usage context: keys should come from list_endpoints, and method matching is case-insensitive. It does not explicitly list when to prefer get_endpoint over get_schema or select, so sibling routing is left partially implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_schemaARead-only
获取单个 schema 的属性表与嵌套下钻键。schema 名从 get_endpoint 输出的 → get_schema(Name) 获得。
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint=true annotation already declares the safety profile, and the description is fully consistent with... annotation contradiction absent. The description adds value by disclosing what the tool RETURNS (property table, nested drill keys) and documenting the data-flow prerequisite (input derived from get_endpoint output). For a read-only tool whose annotation covers the risk profile, this is solid supplementary detail. No contradiction between '获取' and readOnlyHint=true.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with zero filler. The first defines purpose and output; the second resolves the input sourcing. No repetition of what annotations or schema already provide — it's tight, information-dense, and every word earns its place. This is the model of conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity tool (1 param, no enums, no nested objects) with an output schema handling return-type doc and annotations covering the read-only profile, the description is nearly complete. It establishes the retrieval flow and content. The main gap is minor: it doesn't address the arrow-prefix format ambiguity or explicitly suggest downstream actions (e.g., passing a schema to select/get_batch).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Although schema description coverage is 0%, the description compensates by explaining the single parameter's provenance — 'schema 名从 get_endpoint 输出的 `→ get_schema(Name)` 中获得'. For a one-argument tool, this effectively documents what 'name' is and where to find it. The only shortfall: it doesn't clarify whether the '→' arrow is part of the literal string value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource — '获取单个 schema 的属性表与嵌套下钻键' (get a single schema's property table and nested drill-down keys) — going beyond a tautology by specifying what is retrieved. The '单个 schema' scope distinguishes it from list-like siblings without naming them. It would earn a 5 with explicit sibling differentiation, but the core purpose is unambiguous on its own.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells the agent where to get the `name` parameter: 'schema 名从 get_endpoint 输出的 `→ get_schema(Name)` 中获得' — establishing a call sequence and naming a sibling tool (get_endpoint). This is concrete, actionable guidance for the critical input-sourcing question. However, it doesn't mention when NOT to use this tool or contrast with select/get_batch, leaving a small but real gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_endpointsARead-only
列出 API 全部端点(方法/路径/摘要表)。了解 API 全貌的第一步;需要细节时用 get_endpoint / get_schema 按键下钻。
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotation only declares readOnlyHint, which is about side effects. The description adds that the tool returns a table of endpoints, but does not disclose any other behavioral traits such as performance, pagination, or filtering behavior. It goes slightly beyond the annotation but not significantly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that front-loads the main action ('list all API endpoints') and then provides context for sibling tools. There is no unnecessary detail, and it is efficiently structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description gives enough context for a simple list tool: it states what it does and when to use it. However, it omits any explanation of the optional 'tag' parameter, which could be relevant for filtering. This slight gap prevents a perfect score, but overall the tool's purpose and usage are well covered.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The only parameter 'tag' is completely undocumented in both the schema and the description. The description does not mention the parameter at all, providing no meaning or usage guidance for it. With 0% schema coverage and no description mention, parameter semantics are critically lacking.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: it lists all API endpoints with method/path/summary table. It distinguishes itself from sibling tools by positioning it as the first step and explicitly pointing to get_endpoint/get_schema for details, which helps an agent select it appropriately.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use this tool (as the first step for an API overview) and when to use alternatives (when details are needed, use get_endpoint/get_schema). This provides clear guidance on tool selection relative to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
selectARead-only
按 glob 模式与鉴权 / tag 过滤批量选中端点键与 schema 名(含鉴权列的键表)。patterns 元素形如 "GET /v1/*"(方法可为 *、大小写不敏感);零匹配返回可用条件提示。选中后用 get_batch 批量取详情。
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | ||
| patterns | No | ||
| security | No | ||
| schema_glob | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds behavioral details beyond the readOnlyHint annotation by explaining pattern matching rules (case-insensitive, wildcard method) and the behavior on zero matches (returns available condition hints). It also clarifies that this tool does not return details itself, which is a significant behavioral trait. Some aspects like error handling are not mentioned, but the provided information is substantive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured. It presents the main purpose first, then explains the pattern format, the zero-match hint behavior, and the follow-up action with get_batch. No unnecessary information is included.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (4 optional parameters, no required), the description covers the essential aspects: what it does, how to use it, and what to do next. It does not explain the output schema, but since an output schema exists, that is acceptable per the criteria. The description is complete enough for an agent to understand the tool's role and usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With zero schema description coverage, the description compensates by explaining that patterns are glob patterns with specific format (e.g., 'GET /v1/*'), and that tag and security are used for filtering. It gives enough meaning for the parameters, though it could elaborate more on tag and security specifics. Overall, it adds meaningful semantics to the input schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool filters and selects endpoint keys and schema names using glob patterns and authentication/tag criteria. It specifies the resource (endpoints and schemas) and the action (filter/select) with sufficient detail.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear guidance on when to use this tool versus get_batch by stating that after selection, get_batch should be used for details. It also explains the pattern format and the behavior on zero matches, which aids in troubleshooting. However, it does not explicitly contrast with list_endpoints or get_endpoint, but the filtering purpose is implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.2.0- First observed
get_batch - First observed
get_endpoint - First observed
get_schema - First observed
list_endpoints - First observed
select
TDQS
Scored across 5 tools
Each tool is clearly anchored to a distinct stage of the workflow: overview, single endpoint details, single schema details, bulk selection, and bulk retrieval. There is no meaningful overlap between the five operations.
The names mostly follow a clear verb_noun pattern, with list_endpoints for the collection and get_endpoint / get_schema for individual items. The bare 'select' and the somewhat generic 'get_batch' are minor deviations from the otherwise consistent style.
Five tools form a tight, well-scoped set for navigating OpenAPI documents: overview, detail, schema access, filtering, and batch retrieval. Each tool has a clear purpose and none feel redundant.
The main exploration workflow is complete: list endpoints, inspect endpoint and schema details, filter selections, and batch fetch. A dedicated way to enumerate all schemas up front would be a minor improvement, but the select/get_batch flow provides a workable path.
Maintenance
Related MCP Connectors
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Schema-aware API monitoring: diff OpenAPI specs for breaking changes, manage endpoints.
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Scores how well AI agents will use your API, 0-100, from its OpenAPI spec. Free and read-only.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides tools for exploring large OpenAPI schemas without loading entire schemas into LLM context. Perfect for discovering and analyzing endpoints, data models, and API structure efficiently.914MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to explore and query OpenAPI specifications, allowing natural language interaction with API endpoints, parameters, request bodies, and response schemas from any OpenAPI 3.x spec.8 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server that converts OpenAPI documentation to Markdown with tolerant parsing, enabling LLMs to batch query and explore APIs.7 npm1MIT
- FlicenseNot gradedqualityDmaintenanceTurns any OpenAPI/Swagger spec into queryable tools for LLMs, enabling endpoint search, detail retrieval, and schema exploration.1-