Stainless (API MCP server architecture)
Stainless generates and prescribes an architecture for MCP servers that turn an existing REST or OpenAPI surface into tools an agent can call.
Description
Stainless generates MCP servers from an API specification and publishes guidance on how to structure the resulting tool surface. The architecture guide describes several tool-exposure strategies, from mapping every endpoint one-to-one to a tool, to composite tools that bundle several API calls, to dynamic meta-tools that let the model discover endpoints on demand. The guidance also covers filtering which tools are exposed based on the user's permissions or OAuth scopes. Stainless targets API providers that want their service to be callable by agents.
Solution
An agent connects to a Stainless-generated MCP server that fronts an existing API. The server presents the API as tools, either one tool per endpoint, composite tools that run a sequence of calls, or dynamic meta-tools the model uses to discover and invoke endpoints on demand. The agent selects a tool, the server executes the underlying API call or sequence of calls, and the result returns to the agent's context for the next step.
Primary use cases
- generating MCP servers from an existing API
- exposing API endpoints as agent-callable tools
- bundling multi-step API workflows into single composite tools
- scoping the exposed tool set to user permissions
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.