typescript-sdk/test/conformance
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sam Morrow 6032170087
Some checks failed
Conformance Tests / client-conformance (push) Has been cancelled
Conformance Tests / server-conformance (push) Has been cancelled
Deploy Docs / deploy-docs (push) Has been cancelled
Examples / examples (build + e2e) (push) Has been cancelled
/ build (push) Has been cancelled
/ test (20) (push) Has been cancelled
/ test (22) (push) Has been cancelled
/ test (24) (push) Has been cancelled
/ test-e2e (20) (push) Has been cancelled
/ test-e2e (22) (push) Has been cancelled
/ test-e2e (24) (push) Has been cancelled
/ test-runtimes (bun, 1.x) (push) Has been cancelled
/ test-runtimes (deno, v2.x) (push) Has been cancelled
Publish Any Commit / pkg-publish (push) Has been cancelled
Release / Version (push) Has been cancelled
Release / Publish (push) Has been cancelled
feat(server): add request-time OAuth scope challenges (#1624)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-09-16 16:51:56 +00:00
..
scripts fix(test-conformance): stop leaking the conformance server and hanging on stale ports (#2276) 2026-06-11 17:04:54 +01:00
src feat(server): add request-time OAuth scope challenges (#1624) 2026-09-16 16:51:56 +00:00
CHANGELOG.md Version Packages (#2555) 2026-07-28 00:52:57 +01:00
eslint.config.mjs Implement MCP 2026-07-28 (#2286) 2026-06-26 14:01:10 +01:00
expected-failures.2026-07-28.yaml docs: client log levels, elicitation completion notification; drive json-schema-2020-12-preservation on the alpha.11 referee (#2686) 2026-08-18 15:56:55 +01:00
expected-failures.yaml feat(client): add DPoP (RFC 9449) sender-constrained token support (#2629) 2026-08-31 18:00:18 +01:00
package.json docs: client log levels, elicitation completion notification; drive json-schema-2020-12-preservation on the alpha.11 referee (#2686) 2026-08-18 15:56:55 +01:00
README.md fix(test-conformance): stop leaking the conformance server and hanging on stale ports (#2276) 2026-06-11 17:04:54 +01:00
tsconfig.json refactor: move the schema source modules into @modelcontextprotocol/core (#2477) 2026-07-13 17:19:58 +01:00
vitest.config.js v2: Move conformance into workspace (#1470) 2026-02-03 19:56:49 +02:00

Conformance Tests

This directory contains conformance test implementations for the TypeScript MCP SDK.

@modelcontextprotocol/conformance is pinned to an exact version (no ^ range) in package.json. New conformance releases are adopted by deliberately bumping the pin and updating expected-failures.yaml for any new scenarios/checks in the same change.

Client Conformance Tests

Tests the SDK's client implementation against a conformance test server.

# Run all client tests
pnpm run test:conformance:client:all

# Run specific suite
pnpm run test:conformance:client -- --suite auth

# Run single scenario
pnpm run test:conformance:client -- --scenario auth/basic-cimd

Server Conformance Tests

Tests the SDK's server implementation by running a conformance server.

# Run all active server tests
pnpm run test:conformance:server

# Run all server tests (including pending)
pnpm run test:conformance:server:all

Local Development

Running Tests Against Local Conformance Repo

Link the local conformance package:

cd ~/code/mcp/typescript-sdk
pnpm link ~/code/mcp/conformance

Then run tests as above.

Debugging Server Tests

Start the server manually:

pnpm run test:conformance:server:run

In another terminal, run specific tests:

npx @modelcontextprotocol/conformance server \
  --url http://localhost:3000/mcp \
  --scenario server-initialize

Note: pnpm run test:conformance:server always starts (and tests) its own server, and refuses to run while anything is still listening on its port. Stop the manually started server first, or keep using the direct --url invocation above against it.

Files

  • src/everythingClient.ts - Client that handles all client conformance scenarios
  • src/everythingServer.ts - Server that implements all server conformance features
  • src/authTestServer.ts - Server with OAuth authentication for auth conformance tests
  • src/helpers/ - Shared utilities for conformance tests
  • scripts/ - Conformance test runner scripts

Auth Test Server

The authTestServer.ts is designed for testing server-side OAuth implementation. It requires an authorization server URL and validates tokens via introspection.

# Start with a fake auth server
MCP_CONFORMANCE_AUTH_SERVER_URL=http://localhost:3000 \
  npx tsx src/authTestServer.ts

The server:

  • Requires Bearer token authentication on all MCP endpoints
  • Validates tokens via the AS's introspection endpoint (RFC 7662)
  • Serves Protected Resource Metadata at /.well-known/oauth-protected-resource