Skip to main content
Glama

oaslint-mcp

Ask your AI agent "is this API change safe to release?" and get a real answer.

oaslint-mcp is an MCP server that lints OpenAPI and Swagger specs and, above all, detects breaking changes between two versions of a spec. It runs offline, reads files only, and never fetches a URL.

Why another OpenAPI diff tool?

Other MCP servers already diff OpenAPI specs (for example Specwise, which needs OpenAPI 3.x for diffs, or the hosted Apify actors). What this one does differently:

  • One engine for Swagger 2.0, OpenAPI 3.0 and 3.1, including across versions. A 2.0 spec and its 3.1 rewrite show no changes (nullable: true equals type: [x, "null"], const equals a one-value enum, consumes/produces equal content, csv arrays equal explode: false).

  • Request/response variance. The same edit is breaking in a request and harmless in a response (and the reverse): removing an enum value, adding a property, loosening a limit. Each finding says which question it answered.

  • Flattened before compared. allOf is merged, $ref and inline are the same thing, reordered keys and renamed components do not show up.

  • Honest about uncertainty. oneOf/anyOf/discriminator changes and enum values added to a response are reported as POTENTIALLY_BREAKING with the reason, not guessed.

  • Lints and validates too, with a JSON pointer and the source line on every finding.

  • Local and sandboxed: nothing leaves your machine; file access is limited to --dir.

Related MCP server: mcp-api-guardian

Tools

Tool

What it does

spec_overview

Version read, title, servers, tags, paths/operations, auth schemes, schemas, deprecations, unresolved $refs

lint_spec

Rules OAS1001-OAS1025 with severity, JSON pointer, line and a fix

diff_specs

Old vs new: BREAKING / POTENTIALLY_BREAKING / NON_BREAKING / INFO, with reason and exact location

changelog_markdown

The same diff as release notes in markdown, as text

find_endpoints

Filter operations by path glob, method, tag or text

describe_operation

Parameters, request and response schemas resolved into a compact outline (cycles marked)

validate_example

Check a JSON document against an operation's request or response schema, with JSON pointers to each violation

spec, old and new are paths to .yaml/.yml/.json files inside the allowed directory (relative paths work), or the spec text pasted inline.

What counts as breaking

In a request the server validates input, so tightening breaks clients: a new required parameter or property, a narrower type, removed enum values, a new pattern, a higher minimum, additionalProperties: false, a removed content type, stricter auth or extra scopes. In a response clients rely on output, so loosening or dropping a guarantee breaks them: a removed property, required to optional, a changed type, nullable added, a removed success code or content type. Enum values added to a response are POTENTIALLY_BREAKING (strict clients). operationId changes are non-breaking but called out.

Install

Needs uv. Replace the folder with the one that holds your specs.

Claude Code

claude mcp add oaslint -- uvx oaslint-mcp --dir "/path/to/your/specs"

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "oaslint": {
      "command": "uvx",
      "args": ["oaslint-mcp", "--dir", "C:\\path\\to\\your\\specs"]
    }
  }
}

--dir (or the OASLINT_DIR environment variable) defaults to the current directory.

Try asking

  • "Give me an overview of openapi.yaml."

  • "Lint openapi.yaml and fix the errors first."

  • "Compare api-v1.yaml with api-v2.yaml. Is it safe to release? List every breaking change."

  • "Write the changelog for v2 as markdown."

  • "Which endpoints are tagged orders and still use POST?"

  • "Describe PATCH /orders/{id}, including what a 409 returns."

  • "Is {"name": "x", "qty": "3"} a valid request body for POST /orders?"

Security

  • Read-only and offline. The server never writes files and never opens a network connection. Remote $refs (http://, https://) are reported as unresolved with a note, never fetched.

  • Sandboxed. Every file, including relative $ref targets, must resolve (symlinks followed) to a path inside --dir. ../ traversal, absolute paths and symlink escapes are refused.

  • Hostile input guards. 50 MB file cap, line cap, nesting-depth cap, YAML alias-bomb (billion laughs) cap, yaml.safe_load semantics only (no Python tags), duplicate keys warned about, catastrophic-backtracking patterns skipped with a note.

  • No secrets in output. Values that look like secrets (API keys, JWTs, long tokens, values under keys such as password, URL credentials) are shown as <redacted>; names are kept.

Limits to know about: JSON Schema pattern is evaluated with Python's regex engine (ECMA-262 differences are possible), not / if / patternProperties / prefixItems are compared as opaque text and reported as POTENTIALLY_BREAKING when they change, and line numbers are best-effort (the nearest existing node when a pointer goes through allOf or a $ref).

Development

uv sync --extra test
uv run pytest
uv run ruff check src tests
uv run mypy --strict src

Learn how it works by building a small version yourself: oaslint-mcp-the-hard-way.

MIT licensed.

Available Tools

7 tools
changelog_markdownA

Write a human-readable markdown changelog for the move from old to new, grouped into breaking / potentially breaking / non-breaking / notes and then by operation. Returns text; nothing is written to disk.

Inputs: new (required), old (required). Returns: result

describe_operationB

Describe one operation: parameters (merged path-level + operation-level), the request body and every response with their schemas fully resolved and shown as a compact outline (* = required property, ? = nullable, recursive schemas end in a <cycle: Name> marker). path may use any parameter names (/pets/{id} matches /pets/{petId}). depth limits the outline nesting (1-12).

Inputs: path (required), spec (required), method (required), depth. Returns: result

diff_specsA

Compare two versions of an API and classify every change as BREAKING, POTENTIALLY_BREAKING (needs a human look), NON_BREAKING or INFO, with the reason and exact location (operation, schema path, JSON pointer, line).

Rules follow request/response variance: in a request, tightening is breaking (new required parameter or property, narrower type, removed enum value, stricter min/max/pattern); in a response, loosening or removing guarantees is breaking (property removed or made optional, type changed, nullable added, success code removed). Also checks auth changes, content types, parameter style/location, oneOf/anyOf/allOf and discriminator. Equivalent specs written differently (reordered keys, $ref vs inline, nullable vs type [x,'null'], Swagger 2.0 vs OpenAPI 3) report no changes.

old and new are paths inside the allowed directory, or spec text.

Inputs: new (required), old (required). Returns: result

find_endpointsA

List operations of a spec, optionally filtered. path_glob uses * and ? (e.g. '/pets/*'), method is get/post/..., tag is an exact tag name, text is a case-insensitive substring searched in path, operationId, summary, description and tags. Filters combine with AND.

Inputs: spec (required), tag, text, method, +1 more. Returns: result

lint_specA

Lint a spec. Findings have a rule id (OAS1001+), severity (error/warning/info), a JSON pointer, the source line when known, and a concrete fix. Rules cover operationIds, missing or non-2xx responses, path parameters vs the URL template, parameter naming, unused components, untyped schemas, required-not-in-properties, enum/default/example mismatches (checked with a built-in JSON Schema validator), missing descriptions, undefined security schemes, http:// production servers, POST-200 on creation, trailing slashes, duplicate paths and deprecations without a replacement note.

spec is a path inside the allowed directory, or the spec text itself.

Inputs: spec (required). Returns: result

spec_overviewA

Summarise an API description: format/version read, title, servers, number of tags, paths and operations (by method), auth schemes, schema count, deprecated count and any unresolved $refs (remote refs are reported, never fetched).

spec is a path inside the allowed directory (.yaml/.yml/.json; OpenAPI 3.0.x, 3.1.x or Swagger 2.0), or the spec text itself.

Inputs: spec (required). Returns: result

validate_exampleA

Check a JSON document against the resolved schema of an operation. kind is 'request' (validates against the request body) or 'response' (against the response for status, default 200; falls back to 2XX then default). json is the document as JSON text. Violations are reported with a JSON pointer into the document. Optionally pick a content_type; otherwise application/json (or the first JSON type) is used.

Inputs: json (required), kind (required), path (required), spec (required), +3 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool targets a distinct action on the spec: summarise (spec_overview), lint, diff, changelog, search operations (find_endpoints), describe one operation, and validate an example. The main overlap is diff_specs vs changelog_markdown, which operate on the same old/new inputs and differ only in output format, and spec_overview vs find_endpoints both surface operation inventories. Descriptions make the boundaries clear enough that misselection is unlikely.

    Naming Consistency4/5

    Most names follow a verb_noun snake_case pattern (lint_spec, diff_specs, find_endpoints, describe_operation, validate_example). Two deviate into noun_noun (spec_overview, changelog_markdown), which is a minor inconsistency rather than a breakdown. Casing is uniformly snake_case throughout.

    Tool Count5/5

    Seven tools is well within the ideal range and each earns its place: read/summarise, lint, diff, render changelog, search, inspect one operation, and validate payloads. No redundant or filler tools; the surface is tightly scoped to static OpenAPI analysis.

    Completeness4/5

    The core lifecycle for spec analysis is covered: understand, lint, compare, document, navigate, and validate against schemas. Minor gaps remain, such as no autofix/apply-suggestion tool despite lint reporting concrete fixes, and no schema-only validation or spec conversion (Swagger 2.0 to OAS 3) beyond diffing. These are workaroundable but would be natural additions.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      F
      maintenance
      Enables coding agents to validate OpenAPI documents and JSON Schemas, validate data against a schema, and diff OpenAPI versions—including against a git ref—to classify breaking changes and suggest semver updates.
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to plan and run requests from OpenAPI documents, verify live API responses against specs, diff spec versions for breaking changes, and snapshot or compare MCP servers including tool descriptions.
      24
      Apache 2.0