AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

MCP Contract CI

mcp-ajpeng-mcp-contract-ci · by ajpeng

Contract testing for MCP servers in CI. Catch breaking tool and schema changes before agent workflows break.

No reviews yet
0 installs
25 views
0.0% view→install

Install

$ agentstack add mcp-ajpeng-mcp-contract-ci

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-ajpeng-mcp-contract-ci)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
25d ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of MCP Contract CI? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

MCP Contract CI

MCP Contract CI catches the changes that quietly break agents after an MCP server ships. It compares a released capability manifest with a candidate version, highlights breaking changes in plain language, and can replay saved tool calls against a running server before release.

It is built for teams that treat MCP tools as a product surface. A tool rename, a newly required field, or a missing response property can be enough to strand an otherwise healthy agent workflow.

Why it matters

MCP tools are APIs for agents. When their contracts change without a compatibility check, a release can look healthy while quietly breaking the workflows that depend on it. MCP Contract CI brings that failure into the pull request, where it is easy to understand and fix.

What it checks

  • Removed or likely renamed tools
  • Removed resources and prompts
  • Input fields that disappear or become required
  • Input schemas that accept fewer values, including narrowed types, enums, and object shapes
  • Output fields that disappear or schemas that narrow
  • Saved tool-call traces against a manifest or a running stdio MCP server

The checker reports only breaking changes. Additive, optional inputs are allowed so a team can evolve a server without noisy CI failures.

Quick start

npm install
npm run build
npx mcp-contract diff examples/before.json examples/after.json --format markdown --fail-on breaking

The included example intentionally fails with a report like this:

input-field-now-required: create_event adds required input field 'timezone'
output-field-removed: create_event no longer returns output field 'url'
tool-removed: Tool 'find_availability' was removed

Capability manifests

A manifest is a small, versioned description of the MCP surface your clients depend on. Keep the current released copy in your repository, then generate a candidate copy during a pull request.

{
  "schemaVersion": 1,
  "server": { "name": "calendar-mcp", "version": "1.4.0" },
  "tools": [
    {
      "name": "create_event",
      "inputSchema": {
        "type": "object",
        "properties": { "title": { "type": "string" } },
        "required": ["title"]
      },
      "outputSchema": {
        "type": "object",
        "properties": { "eventId": { "type": "string" } }
      }
    }
  ],
  "resources": [{ "uri": "calendar://timezone" }],
  "prompts": [{ "name": "schedule-team-meeting" }]
}

schemaVersion is the contract format version. server.version is your server release version. This separation lets clients pin a known server capability manifest while the checker itself evolves.

Publish a validated, timestamped copy as a release artifact or commit it with the server version:

npx mcp-contract manifest publish .mcp/candidate.json --out releases/2.0.0/capabilities.json

CLI

Compare two manifests and fail a release when an agent contract would break:

npx mcp-contract diff .mcp/released.json .mcp/candidate.json --fail-on breaking

Use --format text, --format markdown, or --format json depending on where the report goes.

Replay saved calls structurally before starting a server:

npx mcp-contract replay traces/scheduling.json .mcp/candidate.json

Replay the same trace against a candidate MCP server over stdio. The command starts the server, performs MCP initialization, and issues tools/call requests from the trace:

npx mcp-contract replay traces/scheduling.json .mcp/candidate.json \
  --command "node dist/server.js"

Add expectedOutput to a trace call when the response shape matters. Expected output uses partial matching, so a stable subset of the response is enough to protect an agent workflow.

{
  "version": 1,
  "calls": [{
    "name": "Schedule launch review",
    "tool": "create_event",
    "arguments": { "title": "Launch review" },
    "expectedOutput": { "structuredContent": { "eventId": "evt_123" } }
  }]
}

GitHub Action

Use the action from this repository after publishing it, or try it locally with uses: ./. Once a release tag exists, pin to a major version such as ajpeng/MCP-Contract-CI@v1.

name: MCP contract

on:
  pull_request:

permissions:
  contents: read
  pull-requests: write
  issues: write

jobs:
  contract:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: your-org/mcp-contract-ci@v1
        with:
          baseline: .mcp/released.json
          candidate: .mcp/candidate.json
          traces: |
            traces/scheduling.json
            traces/onboarding.json
          replay-command: node dist/server.js
          github-token: ${{ secrets.GITHUB_TOKEN }}

The action adds an annotation for every break, writes a readable job summary, and maintains one PR comment instead of spamming every run. When traces is supplied, its PR comment also says how many saved agent workflows the candidate breaks. Add replay-command to exercise those calls against a live candidate server. Set fail-on-breaking: "false" while introducing it to an existing server.

Development

npm install
npm run check
npm test
npm run build

The project intentionally has a small dependency footprint. The contract engine is framework-free TypeScript, the tests use Node's built-in test runner, and the action uses the GitHub REST API directly.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.