MCPGuard finds conformance gaps in official MCP Python and TypeScript SDKs

The Model Context Protocol (MCP) connects large language model agents to external tools and services. It does so through official SDKs that implement message validation and session logic. The paper's authors argue that specification constraints omitted by these SDKs may propagate to downstream applications, which makes SDK-level conformance testing important. In their view, existing MCP conformance tools mainly exercise running endpoints and reveal little about whether the SDK models actually enforce specification requirements.

To fill that gap the paper presents MCPGuard, an automated LLM-based framework for detecting specification-to-SDK conformance gaps. It works in two tracks. The structural track aligns JSON Schema constraints with normalized SDK models and produces constraint-specific evidence. The behavioral track extracts normative prose rules from the specification, retrieves bounded function-level slices of SDK code, and audits them with LLMs for candidate omissions.

Candidates from both tracks go to an evidence-aware dynamic adjudicator. It inspects the complete source context and builds proofs of concept (PoCs) to validate each candidate. A shared kernel with language-specific adapters lets the same analysis run across different SDKs.

On the official Python 1.26.0 and TypeScript 1.29.0 SDKs, MCPGuard confirms 13 and 19 findings respectively. None of them are exposed by two black-box baselines. The authors also report that tests on open MCP servers show these gaps can systematically propagate downstream. They conclude that by making SDK conformance with specification constraints directly testable, MCPGuard complements conventional endpoint-oriented conformance suites rather than replacing them.

Key facts

  • MCPGuard is an automated LLM-based framework that detects specification-to-SDK conformance gaps in Model Context Protocol SDKs.
  • It combines a structural track (JSON Schema constraints aligned with normalized SDK models) and a behavioral track (normative prose rules audited against function-level code slices with LLMs).
  • A dynamic adjudicator inspects full source context and builds PoCs to validate candidate omissions.
  • On the official Python 1.26.0 and TypeScript 1.29.0 SDKs it confirms 13 and 19 findings; none are exposed by two black-box baselines.
  • The authors say tests on open MCP servers show the gaps can systematically propagate downstream, and that MCPGuard complements endpoint-oriented conformance suites.

Why it matters

MCP is the layer through which LLM agents reach external tools and services, and the official SDKs carry its message validation and session logic. If an SDK skips a constraint the specification requires, applications built on it may inherit the omission. The paper's point is that existing conformance tools test running endpoints and say little about whether SDK models enforce the spec. MCPGuard aims at that blind spot by checking the SDK against the specification directly.

Who it affects

The most direct audience is the maintainers of the official MCP Python and TypeScript SDKs, whose versions 1.26.0 and 1.29.0 were analysed. Developers of downstream applications and MCP servers built on these SDKs are also in scope, since the authors say tests on open MCP servers show the gaps can propagate to them. Teams that already run endpoint-oriented conformance suites are a third group, as the paper positions MCPGuard as an addition to those suites.

How to use it

The abstract describes the approach, not a release, so there is nothing to install from it. The idea carries over as a method: pair structural checks of schema constraints against SDK models with LLM audits of code slices tied to normative rules in the spec, then confirm candidates by building working PoCs. The shared kernel with language-specific adapters is meant to let the analysis extend to other SDKs. Use it alongside, not in place of, endpoint conformance testing.

How solid is it

This is an arXiv preprint, and the source is its abstract. The headline result is concrete: 13 confirmed findings on the Python SDK 1.26.0 and 19 on the TypeScript SDK 1.29.0, none exposed by two black-box baselines. Confirmation rests on a dynamic adjudicator that builds PoCs. The abstract does not name the baselines, the LLMs used, false-positive or precision figures, or the number of open MCP servers tested.

Risks and caveats

The findings are described as conformance gaps, and the abstract does not call them security vulnerabilities. It does not say what the 13 and 19 findings are, how severe they are, or whether SDK maintainers were told or fixed them. The downstream claim is phrased as gaps that can systematically propagate, not as a measured rate. The abstract does not say whether MCPGuard's code is released. Results cover two SDK versions only.