Skip to content

Conformance Testing

MCP-TUI ships two testing subcommands: verify runs a small suite of targeted behavior probes, and conform runs the complete protocol matrix (every probe plus every protocol scenario). Both exit non-zero when anything fails, so they drop straight into CI.

capabilities — what did the server negotiate?

Section titled “capabilities — what did the server negotiate?”

Before testing behavior, confirm the handshake. capabilities prints the negotiated server and client capabilities as JSON:

Terminal window
mcp-tui --transport http --url http://localhost:8000/mcp capabilities

server prints the server’s name, version, and protocol.

Each probe sends a single targeted request and reports PASS or FAIL plus a human-readable fix suggestion. Every probe drives its own short-lived connection, so there is no persistent-session overhead.

Terminal window
mcp-tui verify http://localhost:8000/mcp # all HTTP probes
mcp-tui verify --probe cross-origin http://localhost:8000/mcp
mcp-tui verify --json http://localhost:8000/mcp | jq '.results[]|select(.pass==false)'
ProbeChecks
cross-originServer rejects POST with a foreign Origin (SDK v1.4.1+)
dns-rebindServer rejects 127.0.0.1 with a foreign Host header (SDK v1.4.0+)
content-typeServer rejects POST with a non-JSON Content-Type
origin-headerOrigin enforcement is scoped to POST, not GET/HEAD
mcp-method-headersServer tolerates SEP-2243 MCP-Method/MCP-Name headers
seterror-contentTool-result errors preserve the Content payload (SDK v1.6.0+)

The first five probes require a URL target. seterror-content runs against a stdio server and takes an optional --tool (default echo):

Terminal window
mcp-tui verify --probe seterror-content --cmd npx \
--args "@modelcontextprotocol/server-everything,stdio" --tool failing_tool

conform runs every scenario plus all verify probes and prints a per-scenario PASS/FAIL summary. Skipped scenarios (features the server does not advertise) count as passing.

Terminal window
mcp-tui conform http://localhost:8000/mcp
mcp-tui conform --cmd npx --args "@modelcontextprotocol/server-everything,stdio"
mcp-tui conform --scenario tools.list http://localhost:8000/mcp

Scenarios: initialize, tools.list, tools.call, tools.call.isError, resources.list, resources.read, resources.templates.list, prompts.list, prompts.get, sampling.createMessage, elicitation.create, notifications, completion.complete, and every probe as verify.<probe-name>.

Some scenarios need a hint about which tool triggers a server callback, or how to shape a completion request:

FlagPurpose
--sampling-trigger-toolTool that triggers sampling/createMessage (default sampleLLM)
--elicit-trigger-toolTool that triggers elicitation/create (default startElicitation)
--completion-promptPrompt name (or template URI with --completion-resource) for completion/complete
--completion-resourceTreat --completion-prompt as a resource template URI
--completion-argArgument name for completion/complete
--completion-prefixPrefix value for completion/complete

The sampling and elicitation scenarios reply with the stub flags described in Client features.

--report-junit writes a JUnit XML report your CI dashboard can render, while the non-zero exit code fails the job:

Terminal window
mcp-tui conform --report-junit conform.xml --transport http --url "$MCP_URL"
- name: MCP conformance
run: mcp-tui conform --report-junit conform.xml --transport http --url ${{ env.MCP_URL }}
- name: Publish report
if: always()
uses: your-favorite/junit-report-action@v1
with:
report_paths: conform.xml