Generate production-ready MCP servers from any OpenAPI spec. Three modes. ~800 tokens.
mcp-gen takes any OpenAPI specification and generates a production-ready TypeScript MCP server. Feed it a spec URL or file, it outputs a deployable server with type-safe tools, credential management, and audit logging.
Most MCP servers register every tool upfront. When an LLM connects via tools/list, it receives the full catalog — every tool name, description, and JSON Schema input definition — injected into its context window. A hand-built Stripe MCP with 300 tools can burn 50-80K tokens before the user even asks a question.
This is why developers are ditching MCPs for raw CLI wrappers. But CLIs lose credential vaulting, access control, audit trails, and rate limiting — everything enterprises need.
Registers exactly three tools regardless of whether the API has 10 or 1,000 endpoints.
| Tool | Purpose | Input Schema |
|---|---|---|
| {name}_list_schemas | Discover endpoints by category or search | { category?, search? } |
| {name}_get_schema | Get detailed params/body schema for one endpoint | { operation } |
| {name}_api_call | Call any endpoint with auto-routed params | { operation, params?, body? } |
The LLM discovers progressively: browse → inspect → call. All endpoint metadata lives server-side in endpoint_map.json — never sent to the LLM until requested.
~800 tokens in the tools/list response. Always. Whether it's Petstore (20 endpoints) or Stripe (300+).
One tool per API endpoint. Each tool has a typed input schema derived from the OpenAPI spec.
Best for small, focused APIs where every endpoint matters and you want the LLM to see the full surface area upfront.
~200-400 tokens per tool. A 20-endpoint API runs ~5K tokens. A 100-endpoint API runs ~30K+.
You choose 5-15 high-value endpoints as direct tools. Everything else is accessible through a fallback api_call tool.
curated:
tools:
- operation_id: createCustomer
- operation_id: getInvoice
- operation_id: createPaymentIntent
fallback:
enabled: true
explorer:
enabled: true~2-4K tokens for 10 curated tools + fallback + explorer.
| API Size | Hand-Built | Per-Endpoint | Curated (10) | Generic |
|---|---|---|---|---|
| 20 endpoints | ~8-12K | ~5-8K | ~3-4K | ~800 |
| 50 endpoints | ~20-30K | ~15-20K | ~3-4K | ~800 |
| 100 endpoints | ~40-60K | ~30-40K | ~3-4K | ~800 |
| 300 endpoints | ~100-150K | ~80-120K | ~3-4K | ~800 |
Most MCP servers force the LLM to understand HTTP routing — path params, query strings, headers. mcp-gen flattens everything into a single params object.
path: { petId: "123" }
query: { status: "available" }
headers: { "X-API-Key": "sk-..." }params: { petId: "123", status: "available" }
// Routing handled server-side. Credentials from vault.Credential vaulting — Secrets pulled from Vault at runtime, never exposed to the LLM
Audit logging — Every tool invocation logged with customer context
Multi-tenant support — Customer ID from JWT, isolated credential scopes
Type-safe inputs — Zod validation on every parameter
Deployable to Statio — One command to Cloud Run with gateway routing and billing