Schema lockfile and breaking-change detector for MCP servers — like package-lock.json for MCP
Project description
mcp-diff
Schema lockfile and breaking-change detector for MCP servers.
The problem: MCP servers serve tool schemas at runtime. When a description changes, agent behavior changes silently — no diff, no CI failure, no warning.
The solution: Commit a mcp-schema.lock to git. Fail CI on breaking changes.
Install
pip install mcp-diff
Usage
# Snapshot your server's current schema
mcp-diff snapshot python3 my_server.py
# Check for breaking changes (exits 1 if found)
mcp-diff check python3 my_server.py
# Human-readable report (always exits 0)
mcp-diff report python3 my_server.py
Example output
mcp-diff check python3 my_server.py
[BREAKING] read_file: Tool 'read_file' was removed.
[BREAKING] search_files.pattern: Parameter 'pattern' type changed: 'string' → 'array' in tool 'search_files'.
[WARNING] search_files: Tool description changed.
was: 'Search for files matching a pattern.'
now: 'Search files. Use glob patterns.'
[INFO] write_file: Tool 'write_file' was added.
Found 2 breaking, 1 warning, 1 info changes.
Change severity
| Severity | When | CI impact |
|---|---|---|
| breaking | Tool removed, required param added/removed, param type changed | exits 1 |
| warning | Tool or param description changed (descriptions are behavioral contracts for LLMs) | exits 0 |
| info | Tool added, optional param added | exits 0 |
CI integration (GitHub Actions)
- name: Snapshot MCP schema
run: mcp-diff snapshot python3 my_server.py
# Commit mcp-schema.lock to your repo
- name: Check for breaking changes
run: mcp-diff check python3 my_server.py
# Exits 1 and fails the build if breaking changes are detected
Lockfile format
{
"version": "1",
"created_at": "2026-03-22T03:00:00Z",
"command": "python3 my_server.py",
"tools": [
{
"name": "search_files",
"description": "Search for files matching a pattern",
"inputSchema": { "..." : "..." }
}
]
}
Commit mcp-schema.lock to git. The diff in your PR is the schema diff.
Options
mcp-diff snapshot [--output PATH] <command...>
mcp-diff check [--lockfile PATH] [--json] [--no-color] <command...>
mcp-diff report [--lockfile PATH] [--no-color] <command...>
Exit codes
| Code | Meaning |
|---|---|
| 0 | Clean (no breaking changes) |
| 1 | Breaking changes detected |
| 2 | Error (missing lockfile, server failed to start) |
Part of the MCP developer toolkit
- agent-friend — schema quality linter
- mcp-patch — AST security scanner
- mcp-pytest — testing framework
- mcp-snoop — stdio debugger
- mcp-diff — schema lockfile and breaking-change detector
Source: github.com/0-co/mcp-diff
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_diff-0.1.0.tar.gz.
File metadata
- Download URL: mcp_diff-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bcbddabfaedf822347c9c81e861350c19a8e4609bdc30572cbe8922f2671b1d
|
|
| MD5 |
60a4588c90fece3c25b685779962a862
|
|
| BLAKE2b-256 |
bbb5e956f36790b97f2edfdc4296cea07efe2bad7e7abc66716b7890c70af36a
|
File details
Details for the file mcp_diff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_diff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ef37636b98ecae6da336c212dba222a14fc5c14a586f0c9ba15ca8391ec542e
|
|
| MD5 |
15eea31c2b225840ea39ae240f562767
|
|
| BLAKE2b-256 |
a17f063c066788eb2b6cd321482ef34a452a9c39f9f25c112632413323c090b7
|