← Back to APIs

openapi-contract-guard-mcp

Developer Tools

https://github.com/xiaohuxi/openapi-contract-guard-mcp

Read-only MCP server for validating OpenAPI 3.x contracts and detecting breaking API changes.

About this project

The OpenAPI Contract Guard MCP is a self-hostable, read-only tool that helps AI clients validate OpenAPI documents, compare versions, identify breaking changes, and generate structured changelogs. It uses oasdiff for difference analysis and is built on the official Python SDK for the Model Context Protocol (MCP). Key features include four main tools: `validate_spec` for OpenAPI 3.x document validation, `compare_specs` for version comparison, `list_breaking_changes` to detect client-breaking changes, and `generate_changelog` for creating categorized API changelogs. The tool enforces strict security boundaries, including read-only operations, local file restrictions, and protection against SSRF and shell injection. To get started, developers need Python 3.11+, uv, and oasdiff. After cloning the repository, they can run `uv sync` followed by `uv run openapi-contract-guard-mcp`. Configuration involves setting allowed directories via `OPENAPI_GUARD_ALLOWED_ROOTS` and specifying the oasdiff binary path with `OASDIFF_BIN`. The tool is designed to work with local AI clients like Codex and Claude Code through MCP's stdio transport.

This is a GitHub repository (source code), not a hosted HTTP API endpoint.

From the docs

Snippets taken from the repository README when available.

curl
git clone https://github.com/xiaohuxi/openapi-contract-guard-mcp.git
cd openapi-contract-guard-mcp
uv sync
uv run openapi-contract-guard-mcp