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.

  1. Discover — Read openapi://specs/catalog in multi-spec repositories to find available entry files.
  2. Search or Index — Read openapi://endpoints/index or openapi://schemas/index (or use the paginated /search resources for large specs).
  3. Inspect — Use openapi_query with helpers.op, helpers.example, or helpers.schemaRefs on the exact target.

MCP Resources

Resource URIPurpose
openapi://specs/catalogLists OpenAPI entry files in the workspace while skipping node_modules, .git, build folders, symlinks, and unreadable directories.
openapi://endpoints/indexCompact 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/indexSummary 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:

CheckCodeWhat it catches
Broken or unsafe $refBROKEN_REF, REMOTE_REF_DENIED, PATH_TRAVERSAL_DENIEDMissing local targets, remote URLs, or $ref paths escaping the workspace root.
Missing metadata—Missing openapi / swagger version or info.title.
Duplicate operation IDsDUPLICATE_OPERATION_IDTwo or more operations sharing the same operationId.
Undeclared path paramsUNDECLARED_PATH_PARAMETERA {param} segment in a path template missing from in: "path" parameters.
Unknown securityUNKNOWN_SECURITY_SCHEMESecurity requirements referencing a scheme not declared in components.securitySchemes.
Missing error contractsMISSING_ERROR_CONTRACT, ERROR_RESPONSE_MISSING_SCHEMAOperations 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:

  1. sync-frontend-api (endpoint?) — Align frontend types, auth headers, and 4xx/5xx error handling with the API spec.
  2. audit-error-contracts (endpoint?) — Run diagnostics across endpoints and report missing or incomplete error schemas with file and line numbers.
  3. review-breaking-changes (base_spec_path?, target_spec_path?) — Run openapi_diff and inspect affected endpoints and schemas.
  4. generate-test-fixtures (endpoint?) — Generate deterministic 2xx and 4xx/5xx JSON test fixtures using helpers.example.