Skip to content

Commit ee80883

Browse files
alistair3149claude
andauthored
Add MCP protocol conformance and tool-surface checks to CI (#525)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 264d86c commit ee80883

7 files changed

Lines changed: 992 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,54 @@ jobs:
2121
run: npm run preflight
2222

2323
- name: Ensure no changes
24-
run: git diff --exit-code
24+
run: git diff --exit-code
25+
26+
mcp-checks:
27+
runs-on: ubuntu-24.04-arm
28+
timeout-minutes: 15
29+
steps:
30+
- uses: actions/checkout@v7
31+
32+
- uses: actions/setup-node@v7
33+
with:
34+
node-version: 24
35+
cache: 'npm'
36+
37+
- run: npm ci
38+
39+
- run: npm run build
40+
41+
- name: Doctor and protocol conformance
42+
run: npm run check:mcp
43+
44+
- name: Check out PR base
45+
if: github.event_name == 'pull_request'
46+
uses: actions/checkout@v7
47+
with:
48+
ref: ${{ github.event.pull_request.base.sha }}
49+
path: base
50+
51+
- name: Build PR base
52+
if: github.event_name == 'pull_request'
53+
working-directory: base
54+
run: npm ci && npm run build
55+
56+
- name: Export base tool surface
57+
if: github.event_name == 'pull_request'
58+
run: >
59+
node_modules/.bin/mcpjam server export --stable
60+
--transport stdio --command node
61+
--args "$GITHUB_WORKSPACE/base/dist/index.js"
62+
--cwd "$GITHUB_WORKSPACE/base"
63+
--env "CONFIG=$GITHUB_WORKSPACE/scripts/mcp-checks.config.json"
64+
--no-telemetry --quiet > base-surface.json
65+
66+
- name: Diff tool surface against base
67+
if: github.event_name == 'pull_request'
68+
run: >
69+
node_modules/.bin/mcpjam server diff --baseline base-surface.json
70+
--transport stdio --command node
71+
--args "$GITHUB_WORKSPACE/dist/index.js"
72+
--cwd "$GITHUB_WORKSPACE"
73+
--env "CONFIG=$GITHUB_WORKSPACE/scripts/mcp-checks.config.json"
74+
--fail-on breaking --no-telemetry

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ A path handed to a runtime `createRequire( import.meta.url )` resolves against t
3434
- `npm test` — run the vitest suite once.
3535
- `npm run lint` — oxlint.
3636
- `npm run typecheck``tsc --noEmit` over `src` **and** `tests`, via `tsconfig.lint.json`. `npm run build` only typechecks `src`, so this is the check that covers test code.
37+
- `npm run check:mcp` — MCPJam doctor + MCP protocol conformance against the built server (build first). CI runs it on every PR and also diffs the tool surface against the PR base, failing on breaking changes.
3738
- `npm run fmt` / `npm run fmt:check` — oxfmt (write / dry-run).
3839
- `npm run preflight` — full gate (install, lint, typecheck, fmt check, validate `server.json`, test, build, bundle). Run before a release.
3940
- Git hooks: `lefthook` auto-installs on `npm install`. Pre-commit runs `oxfmt` (auto-fix on staged files) + `oxlint`. Pre-push runs `npm run typecheck` + the test suite. Bypass with `--no-verify`.

docs/testing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ Like the MCP Inspector, but with a built-in MCP client that can drive the server
7070
npm run mcpjam
7171
```
7272

73+
## MCPJam CLI checks
74+
75+
Token-free structural checks against the built server: a stdio doctor sweep plus an MCP protocol conformance run against the HTTP transport. Build first with `npm run build`, then:
76+
77+
```sh
78+
npm run check:mcp
79+
```
80+
81+
Both use the minimal wiki configuration in `scripts/mcp-checks.config.json`, so results do not depend on your local `config.json`. The conformance run binds `127.0.0.1:3117`; set `PORT` to use a different port. CI runs the same script on every pull request, and additionally diffs the tool surface against the PR base — a removed or renamed tool fails the job, while description changes only show up in the report.
82+
7383
## MCP Inspector CLI (integration tests)
7484

7585
The [MCP Inspector CLI](https://github.com/modelcontextprotocol/inspector) exercises tools against a real wiki. Build first with `npm run build`, then:

0 commit comments

Comments
 (0)