MCP has a BIG problem
By Volo Code
Main Topics: Limitations of mCP and Alternatives for AI Agent Tool Calling
Key Concepts:
- mCP (Multi-Client Protocol): A protocol designed to facilitate interaction between AI agents and existing tools.
- Stateful Protocol: A communication protocol where the server maintains information about past interactions (state) to process subsequent requests.
- Serverless Functions: Cloud computing execution model where the cloud provider dynamically manages the allocation of machine resources.
- REST API (Representational State Transfer Application Programming Interface): A widely used architectural style for designing networked applications.
- SSSE (Server-Sent Events): A server push technology enabling a server to send updates to a client over a single HTTP connection.
- Agents.json (Wildcard AI): A lightweight alternative to mCP, utilizing JSON and OpenAPI specifications for tool description.
- Context Window: The limited amount of text an AI model can process at once.
- Sampling (in mCP): A feature allowing servers to request LLM completions from the client (AI agent).
- OpenAPI Specification: A standard format for describing REST APIs.
I. The Core Problem with mCP: Stateful Nature & Deployment Challenges
The primary issue with mCP, discovered after initial implementation, is its inherent stateful nature. Unlike typical REST APIs which are stateless, mCP requires a persistent, long-lived connection between the server and client (the AI agent). This reliance on state fundamentally prevents mCP from being effectively deployed in serverless environments.
The speaker highlights the irony: AI agent tool calling is ideally suited for serverless functions due to their scalability and cost-effectiveness. However, mCP’s requirement for a stateful server negates this benefit. Setting up and maintaining dedicated servers or Kubernetes clusters is significantly more complex and expensive than utilizing serverless functions, which can be deployed within an hour.
As stated by the speaker, “it is absolutely required by mCP…kind of crazy to me especially when it’s just supposed to be a protocol that makes it easy for AI agents to interact with existing tools.”
II. The Complication of “Sampling” and Security Concerns
A key feature within mCP, “sampling,” further exacerbates the stateful problem. Sampling allows the server to request the AI agent to perform LLM (Large Language Model) tasks. The speaker expresses significant security concerns regarding this functionality.
The description of sampling is: “sampling is a powerful mCP feature that allows servers to request llm completions through the client enabling sophisticated agentic behaviors while maintaining security and privacy.”
However, the speaker argues that this two-way communication creates a vulnerability: if the AI agent has access to API keys, a malicious server could potentially exploit them by disguising requests as legitimate LLM tasks. The speaker believes communication should be unidirectional – the agent requests, the tool responds – and that advanced workflows can be built through sequential tool calls.
Furthermore, the speaker points out that no existing mCP clients currently support sampling, rendering it a theoretical feature driving the need for statefulness without practical implementation.
III. Alternative Solutions: Agents.json by Wildcard AI
Recognizing the limitations of mCP, the speaker explores alternative approaches. He highlights “agents.json” by Wildcard AI as a promising lightweight solution. This approach leverages existing technologies – JSON and OpenAPI specifications – to standardize tool descriptions without requiring servers to implement new APIs or alter their deployment strategies.
The speaker notes, “it’s simply providing a description of the end points in a way that the AI agent can expect.” This minimizes the burden on server developers, who already often have stateless REST APIs. The speaker hasn’t personally tested agents.json but finds its simplicity and compatibility with existing infrastructure appealing.
IV. Context Window Overload and the Need for Routing
The speaker addresses a comment from a previous video regarding context window limitations. Registering a large number of tools with an agent can overwhelm its context window, leading to confusion and reduced performance.
To mitigate this, the speaker proposes a routing component: an initial tool call to request a list of relevant tools, followed by the agent calling only those specific tools. This avoids passing a comprehensive tool list with every API call, preserving context window space and improving performance.
V. Conclusion: A Call for Statelessness and Lightweight Solutions
The speaker concludes that mCP, in its current stateful form, is over-engineered and impractical, particularly for the serverless-centric future of AI agent tool calling. He expresses a preference for a stateless protocol with unidirectional communication, emphasizing simplicity and compatibility with existing infrastructure.
He states his intention to refrain from further mCP development until a stateless version is available, and actively seeks alternative solutions like agents.json. The core takeaway is the need for lightweight, serverless-friendly approaches to enable seamless AI agent interaction with existing tools, minimizing disruption for developers and maximizing scalability. He encourages the community to share alternative solutions in the comments.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "MCP has a BIG problem". What would you like to know?