Skip to main content
The MCP Tasks Conformance SDK lets you validate the MCP Tasks wire your server exposes: which wire the connection resolves to, whether declaration hygiene holds, and whether the server honours the observable parts of the contract. Use it when you want the same checks as the CLI’s tasks conformance command, but inside your own test runner or CI pipeline.
Tasks conformance provokes and then polls a real task, so it requires a persistent connection. It is not available in hosted mode.

Import

Basic usage

Pass a tool name when your server’s tools carry no task metadata (the extension wire):
For a stdio server:

MCPTasksConformanceConfig

MCPTasksConformanceConfig extends the standard MCPServerConfig, so it accepts the same HTTP and stdio connection settings as MCPClientManager. Additional properties: Example with a focused check set:

Check ids

Result shape

run() returns an MCPTasksConformanceResult. The discovery object includes: Each MCPTasksCheckResult includes:
  • id
  • category
  • title
  • description
  • status"passed", "failed", or "skipped"
  • durationMs
  • optional details
  • optional warnings
  • optional error

CI reporting

Use the shared reporting helpers to produce JUnit XML or JSON artifacts:
toConformanceReport accepts protocol, OAuth, apps, and tasks results and normalizes them into a single report shape, so the SDK and CLI JUnit output are byte-identical for the same result.

Notes

  • Declaration hygiene is asserted against captured outbound JSON-RPC bytes, not re-derived from intent.
  • The tasks-undeclared-capability-rejected check applies to the extension wire only and is skipped on the legacy wire.
  • The tasks-mcp-name-routing check applies to HTTP transports only and is skipped for stdio servers.
  • Checks that require a created task are skipped when no task-capable tool is found and no toolName is provided.
  • Exit code from the CLI is 1 when result.passed is false.