MCP
Indexes, Diagnostics & Prompts
MCP resources for discovering specs, searching endpoints and schemas, running diagnostics, and guided agent prompts.
Before calling openapi_query, AI agents can read compact MCP resources to locate the right spec, endpoint, or schema without guessing paths or loading raw files.
Recommended Agent Workflow
- Discover — Read
openapi://specs/catalogin multi-spec repositories to find available entry files. - Search or Index — Read
openapi://endpoints/indexoropenapi://schemas/index(or use the paginated/searchresources for large specs). - Inspect — Use
openapi_querywithhelpers.op,helpers.example, orhelpers.schemaRefson the exact target.
MCP Resources
| Resource URI | Purpose |
|---|---|
openapi://specs/catalog | Lists OpenAPI entry files in the workspace while skipping node_modules, .git, build folders, symlinks, and unreadable directories. |
openapi://endpoints/index | Compact summary of endpoints—methods, paths, 2xx/4xx/5xx status codes, auth schemes, deprecated flags, and 1-based { file, line } locations (64 KB soft cap). |
openapi://endpoints/search{?q,tag,method,pathPrefix,operationId,missingErrorContracts,offset,limit,spec_path} | Filtered, paginated endpoint search (limit 1–100, default 20, returns nextUri). |
openapi://schemas/index | Summary of components.schemas / definitions with required fields, properties, unusedSchemas, and reverse usedBy references (64 KB soft cap). |
openapi://schemas/search{?q,usedByPath,unusedOnly,offset,limit,spec_path} | Filtered, paginated schema search. |
openapi://spec/diagnostics{?spec_path} | Single-pass spec validation collecting up to 200 issues without stopping on the first error. |
Diagnostic Checks
Reading openapi://spec/diagnostics (or running openapi-mcp check) catches structural and contract issues in a single pass:
| Check | Code | What it catches |
|---|---|---|
Broken or unsafe $ref | BROKEN_REF, REMOTE_REF_DENIED, PATH_TRAVERSAL_DENIED | Missing local targets, remote URLs, or $ref paths escaping the workspace root. |
| Missing metadata | — | Missing openapi / swagger version or info.title. |
| Duplicate operation IDs | DUPLICATE_OPERATION_ID | Two or more operations sharing the same operationId. |
| Undeclared path params | UNDECLARED_PATH_PARAMETER | A {param} segment in a path template missing from in: "path" parameters. |
| Unknown security | UNKNOWN_SECURITY_SCHEME | Security requirements referencing a scheme not declared in components.securitySchemes. |
| Missing error contracts | MISSING_ERROR_CONTRACT, ERROR_RESPONSE_MISSING_SCHEMA | Operations without 4xx/5xx responses, or error responses lacking a schema. |
Built-in Workflow Prompts
Four MCP prompts guide AI coding agents through common API tasks:
sync-frontend-api(endpoint?) — Align frontend types, auth headers, and4xx/5xxerror handling with the API spec.audit-error-contracts(endpoint?) — Run diagnostics across endpoints and report missing or incomplete error schemas with file and line numbers.review-breaking-changes(base_spec_path?,target_spec_path?) — Runopenapi_diffand inspect affected endpoints and schemas.generate-test-fixtures(endpoint?) — Generate deterministic2xxand4xx/5xxJSON test fixtures usinghelpers.example.