Direct API Wrapper
Expose an existing API as MCP tools by mapping each operation one-to-one to a tool, so a stable API becomes agent-callable with minimal wrapper logic.
Problem
Agents cannot call a raw HTTP API through MCP; something must translate the API surface into the protocol's typed tool contract. Hand-writing an MCP tool for every endpoint is repetitive and drifts from the API as it changes, while skipping the wrapper leaves the API unreachable from any MCP host. The team needs the operations exposed quickly without inventing new semantics or maintaining a parallel hand-coded layer.
Solution
Map each API operation to a single MCP tool, deriving the tool name, input schema, and output shape from the API contract — an OpenAPI document or a typed SDK. A generator reads the contract and emits the server, so the tool surface tracks the API rather than a hand-written copy: FastMCP's from_openapi/from_fastapi, fastapi-mcp, and the Speakeasy and Stainless generators all follow this shape, and API gateways such as Kong can autogenerate the same server from any REST API. This is the thinnest wrapper and the baseline against which composite-service-mcp is the next step once the one-to-one surface proves too granular; when the orchestration itself is better written as code, mcp-as-code-api applies. Keep the wrapper free of new business logic so regeneration stays cheap.
When to use
- An existing API is stable and described by an OpenAPI document or typed SDK.
- The goal is the fastest route to making the API agent-callable.
- The API surface is small enough that one tool per operation does not overwhelm the model.
- The team wants the tool set to track the API automatically rather than be hand-maintained.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.