v0.1.0

Introduction

Local OpenAPI MCP server, CLI, and reusable TypeScript engine for AI coding agents and CI pipelines.

OpenAPI MCP (@dimassetoid/openapi-mcp) is a local MCP server, CLI, and TypeScript engine for OpenAPI 3.0, OpenAPI 3.1, and Swagger 2.0 specifications.

Instead of pasting thousands of lines of YAML or JSON into an AI prompt, agents inspect compact indexes, run sandboxed queries against resolved schemas, and compare API versions locally.

Why OpenAPI MCP Exists

Working with API specifications in AI-assisted workflows usually breaks down in three ways:

  1. Context overflow — Loading an entire openapi.yml file into a prompt consumes thousands of tokens just to check one endpoint or error response.
  2. Scattered $ref files — Multi-file specs split parameters, request bodies, and shared schemas across directories, making plain text search unreliable.
  3. Silent breaking changes — Removing an enum value, changing a field from optional to required, or dropping a status code is easy to miss during code review.

OpenAPI MCP keeps the full specification local and exposes only the exact contract, sample payload, or diff the agent or CI check asks for.

How It Works

OpenAPI MCP provides four complementary surfaces built on a single TypeScript engine:

SurfaceWhat it gives you
MCP ResourcesCompact, paginated indexes for specs, endpoints, schemas, and single-pass validation diagnostics.
MCP Toolsopenapi_query for sandboxed JavaScript queries and openapi_diff for breaking-change analysis.
MCP PromptsFour guided workflows for frontend API alignment, error contract audits, diff reviews, and test fixtures.
CLI & Engineserve, check, and diff commands for local terminals and CI, plus @dimassetoid/openapi-mcp/engine.

Supported Specifications

  • OpenAPI 3.1: Full local $ref resolution, sibling keywords alongside $ref preserved via allOf, and deterministic JSON examples.
  • OpenAPI 3.0: YAML and JSON parsing with 1-based { file, line } source locations and merged path + operation parameters.
  • Swagger 2.0: Support for definitions schemas, reverse usage tracking, diagnostics, and semantic diffing.
  • Monorepos: Automatic workspace spec catalog (openapi://specs/catalog) with per-request spec_path selection.

Scope & Limits

OpenAPI MCP performs read-only local analysis on your specification files.

  • Remote $ref URLs (http://, https://) and paths escaping the workspace root are blocked for security.
  • Queries run in an isolated QuickJS WASM sandbox and never make network requests or execute against live API servers.
  • Always run your project's own API tests alongside static spec checks.