The Future of APIs and MCP: Lessons from Stainless
the gist
Alex Rattray of Stainless explains that the current challenge with Model Context Protocol (MCP) is not just connectivity, but designing ergonomic, context-efficient tool interfaces that LLMs can actually navigate without hitting token limits or hallucinating.
The API-to-AI Transition
APIs have historically served as the 'dendrites' of the internet, enabling machine-to-machine communication. As AI agents emerge, they require a new interface layer. While the Model Context Protocol (MCP) aims to standardize how LLMs interact with software, current implementations often struggle to bridge the gap between human-centric UI design and machine-centric tool execution. The core issue is that existing APIs are built for humans or traditional programmatic consumption, not for the specific cognitive constraints of LLMs.
The Context Budget Bottleneck
Directly mapping an entire REST API to MCP tools is a recipe for failure. It consumes massive amounts of context window space and confuses the model with irrelevant parameters. Rattray argues that developers must stop treating MCP as a simple wrapper for existing endpoints. Instead, they must design 'AI-native' tools that prioritize precision, minimal input schemas, and highly filtered response data. The challenge is that developers often don't know a priori what information an LLM will need, creating a tension between providing enough data to be useful and keeping the context window clean.
Designing for Agentic Reliability
Reliable MCP servers require rigorous product management and evaluation systems. Because LLMs struggle with long, multi-step chains of action, developers must handcraft tools that align with how models 'think.' This involves creating specialized, high-level tools rather than granular, one-to-one API mappings. Rattray suggests using techniques like JQ filters to strip down API responses to the bare essentials before they reach the model, ensuring the LLM isn't overwhelmed by 'hay' when it only needs the 'needle.'
The Feedback Loop Problem
One of the biggest hurdles in current MCP development is the lack of a feedback loop. Developers often treat MCP servers as black boxes, unaware of whether a tool call was successful or helpful to the end user. Rattray advocates for building first-class feedback mechanisms—such as dedicated 'send feedback' tools—that allow the system to learn from user frustration or model failures in real-time. This is essential for moving from experimental one-off actions to production-grade, reliable software.