MCPGuard: Finding Conformance Gaps in MCP SDKs via Dual-Track Analysis and Dynamic Adjudication
Xikai Sun, Kebin Liu, Fan Dang, Yawen Zheng, Zihao Yang, Yunhao Liu
Abstract
The Model Context Protocol (MCP) connects large language model agents to external tools and services through official SDKs that implement message validation and session logic. Specification constraints omitted by these SDKs may propagate to downstream applications, highlighting the importance of SDK-level conformance testing. Yet existing MCP conformance tools mainly exercise running endpoints and reveal little about whether SDK models enforce specification requirements. We present MCPGuard, an automated LLM-based framework for detecting specification-to-SDK conformance gaps. Its structural track aligns JSON Schema constraints with normalized SDK models and produces constraint-specific evidence. Its behavioral track extracts normative prose rules, retrieves bounded function-level slices, and audits them with LLMs for candidate omissions. An evidence-aware dynamic adjudicator then inspects complete source context and builds PoCs to validate candidates. A shared kernel with language-specific adapters enables analysis across SDKs. On the official Python 1.26.0 and TypeScript 1.29.0 SDKs, MCPGuard confirms 13 and 19 findings, respectively, none of which are exposed by two black-box baselines. Tests on open MCP servers further show that these gaps can systematically propagate downstream. By making SDK conformance of specification constraints directly testable, MCPGuard complements conventional endpoint-oriented conformance suites.
Create a lesson
Metadata
- Categories
- cs.AI, cs.SE
Related papers
MeterRouter: Budget-Aware Dynamic Routing for Multi-Agent Systems
Shared title terminologycs.AIYue Xu, Leikun Yin, Ruiming Min et al.
Can Its Own Misses Teach an MLLM to Find Small Brain Metastases?
Shared title terminologycs.AIYixuan Duan, Kexin Geng, Hanwen Xu et al.
Spectral Optimal Transport for Dynamics-Aware Sign Language Generation
Shared title terminologycs.AINabeela Khan, Bowen Wu, Runwu Shi et al.
Dynamic Reasoning in Next-Gen Detection and Response: An Empirical Study of LLM Triage, Reinforcement Tuning, and Adversarial Evasion
Shared title terminologycs.AIJeremy Canale
EviCraft: Can Minecraft Agents Find What They Cannot See?
Shared title terminologycs.AIWenyou Yi, Lantian Zhang, Guanlin Chen et al.
DexOPD: Dual-Extrapolation On-Policy Distillation for Diffusion Models
Shared title terminologycs.AIYunchao Ke, Yanzhe Hu, Yi Yang et al.