Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ This repo has a simple MCP server (`server.js`) with a baseline contract snapsho
3. Open a pull request
4. Watch the MCP Contract Check workflow run and report changes

## Project config

This repo ships an [`mcpcontracts.json`](./mcpcontracts.json) so the mcpdiff commands need no flags — it points at the `contacts` server from `mcp.json` and the committed baseline:

```bash
npx mcpdiff check # capture the live server, compare to the baseline
npx mcpdiff check --watch # re-check on every file change
npx mcpdiff update # refresh the committed baseline
```

Explicit flags always win over the config file (e.g. `--url http://localhost:3000/mcp` to check the HTTP variant instead).

## Running locally

### Stdio (default)
Expand All @@ -45,10 +57,10 @@ node server.js --http 8080

The server listens on `http://localhost:3000/mcp` (default port 3000) using MCP Streamable HTTP transport.

You can then diff against it with the CLI:
You can then check it against the baseline with the CLI (the --url flag overrides the stdio server from mcpcontracts.json):

```bash
npx mcpdiff diff --live contracts/baseline.mcpc.json --url http://localhost:3000/mcp
npx mcpdiff check --url http://localhost:3000/mcp
```

## Contract testing
Expand Down
8 changes: 8 additions & 0 deletions mcpcontracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"server": {
"config": "./mcp.json",
"name": "contacts"
},
"baseline": "contracts/baseline.mcpc.json",
"failOn": "breaking"
}
Loading
Loading