|
| 1 | +# MCP Conformance Tests |
| 2 | + |
| 3 | +Validates the Ruby SDK's conformance to the MCP specification using [`@modelcontextprotocol/conformance`](https://github.com/modelcontextprotocol/conformance). |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Node.js (for `npx`) |
| 8 | +- `bundle install` completed |
| 9 | + |
| 10 | +## Running the Tests |
| 11 | + |
| 12 | +### Run all scenarios |
| 13 | + |
| 14 | +```bash |
| 15 | +bundle exec rake conformance |
| 16 | +``` |
| 17 | + |
| 18 | +Starts the conformance server, runs all active scenarios against it, prints a pass/fail |
| 19 | +summary for each scenario, and exits with a non-zero status code if any unexpected failures |
| 20 | +are detected. Scenarios listed in `expected_failures.yml` are allowed to fail without |
| 21 | +affecting the exit code. |
| 22 | + |
| 23 | +### Environment variables |
| 24 | + |
| 25 | +| Variable | Description | Default | |
| 26 | +|----------------|--------------------------------------|---------| |
| 27 | +| `PORT` | Server port | `9292` | |
| 28 | +| `SCENARIO` | Run a single scenario by name | (all) | |
| 29 | +| `SPEC_VERSION` | Filter scenarios by spec version | (all) | |
| 30 | +| `VERBOSE` | Show raw JSON output when set | (off) | |
| 31 | + |
| 32 | +```bash |
| 33 | +# Run a single scenario |
| 34 | +bundle exec rake conformance SCENARIO=ping |
| 35 | + |
| 36 | +# Use a different port with verbose output |
| 37 | +bundle exec rake conformance PORT=3000 VERBOSE=1 |
| 38 | + |
| 39 | +# Start the server on a specific port |
| 40 | +bundle exec rake conformance_server PORT=3000 |
| 41 | +``` |
| 42 | + |
| 43 | +### Start the server and test separately |
| 44 | + |
| 45 | +```bash |
| 46 | +# Terminal 1: start the server |
| 47 | +bundle exec rake conformance_server |
| 48 | + |
| 49 | +# Terminal 2: run all scenarios |
| 50 | +npx @modelcontextprotocol/conformance server --url http://localhost:9292/mcp |
| 51 | + |
| 52 | +# Terminal 2: run a single scenario |
| 53 | +npx @modelcontextprotocol/conformance server --url http://localhost:9292/mcp --scenario ping |
| 54 | +``` |
| 55 | + |
| 56 | +Keeps the server alive between test runs, which avoids the startup overhead when iterating |
| 57 | +on a single scenario. Stop the server with Ctrl+C when done. |
| 58 | + |
| 59 | +### List available scenarios |
| 60 | + |
| 61 | +```bash |
| 62 | +bundle exec rake conformance_list |
| 63 | +``` |
| 64 | + |
| 65 | +Prints all scenario names that can be passed to `SCENARIO`. |
| 66 | + |
| 67 | +## SDK Tier Report |
| 68 | + |
| 69 | +The [MCP SDK Tier system](https://modelcontextprotocol.io/community/sdk-tiers) requires SDK |
| 70 | +maintainers to self-assess and report results to the SDK Working Group via |
| 71 | +[modelcontextprotocol/modelcontextprotocol issues](https://github.com/modelcontextprotocol/modelcontextprotocol/issues). |
| 72 | + |
| 73 | +To generate a full tier assessment report, use the `/mcp-sdk-tier-audit` slash command from |
| 74 | +the [modelcontextprotocol/conformance](https://github.com/modelcontextprotocol/conformance) |
| 75 | +repository with the conformance server running: |
| 76 | + |
| 77 | +```bash |
| 78 | +# Terminal 1 (this repository): start the conformance server |
| 79 | +bundle exec rake conformance_server |
| 80 | + |
| 81 | +# Terminal 2 (conformance repository): run the tier audit skill as a slash command in Claude Code |
| 82 | +/mcp-sdk-tier-audit /path/to/modelcontextprotocol/ruby-sdk http://localhost:9292/mcp |
| 83 | +``` |
| 84 | + |
| 85 | +The skill evaluates conformance pass rate, issue label taxonomy, triage metrics, documentation |
| 86 | +coverage, and policy compliance, then produces a markdown report suitable for tier advancement |
| 87 | +submissions. |
| 88 | + |
| 89 | +## File Structure |
| 90 | + |
| 91 | +``` |
| 92 | +conformance/ |
| 93 | + server.rb # Conformance server (Rack + Puma, default port 9292) |
| 94 | + runner.rb # Starts the server, runs npx conformance, exits with result code |
| 95 | + expected_failures.yml # Baseline of known-failing scenarios |
| 96 | + README.md # This file |
| 97 | +``` |
| 98 | + |
| 99 | +## Known Limitations |
| 100 | + |
| 101 | +Known-failing scenarios are registered in `conformance/expected_failures.yml`. They are allowed to |
| 102 | +fail without affecting the exit code and are tracked to catch regressions. |
| 103 | +These are shown in the output of `bundle exec rake conformance`. |
0 commit comments