MCP servers from your OpenAPI spec

Give Statio a spec and it writes the MCP server, builds it, hosts it privately and puts every tool behind per-tool access, without you writing a line of server code or running anything yourself.

Hubert Robert, Aqueduct in Ruins · The Met, CC0

Names and numbers in the window are illustrative.

How it works

Four steps in the Statio app, from a spec URL to a governed server.

  1. Give Statio your spec

    Paste the URL of an OpenAPI 3 spec. Statio fetches it, counts the endpoints and shows the tools it will generate, along with the base URL those tools will call, which you can change.
  2. Pick a generation mode

    One tool per endpoint for small APIs, or three generic tools for large ones. The modes are described below.
  3. Ship a version

    Statio generates the server, builds the image, deploys it privately on Google Cloud Run, discovers its tools and moves traffic to it. You can follow each stage as it runs.
  4. Grant it, tool by tool

    Every generated tool becomes something you can grant or deny per member and per agent, like any other server behind the gateway.

The token problem

Most MCP servers register every tool up front. When a model connects, it receives the full catalog: every tool name, description and input schema, placed in its context window before the user has asked anything. A server with hundreds of tools can spend tens of thousands of tokens that way.

That cost is why some teams give up on MCP for raw CLI wrappers, and lose access control, credential handling and the record of every call along the way. Generation modes are how Statio keeps MCP cheap for large APIs.

Three generation modes

  • Per Endpoint

    One tool per endpoint

    Every operation in the spec becomes its own tool, named from its operationId, with its path and query parameters typed from the spec. Best for small, focused APIs where you want the model to see the whole surface up front.

    Filter by tag, path, method or operation to keep only the endpoints you want.

  • Generic

    Three tools, whatever the size of the API

    The server registers exactly three tools, whether the API has 20 endpoints or 1,000. The model browses, reads the schema it needs, then calls. Everything else stays on the server in an endpoint map and is only sent when asked for.

    The list of tools the model reads on connect stays the same size as the API grows: an estimated 800 tokens.

  • Curated

    Hand-picked tools, with a fallback

    Name the operations that matter as direct tools, with your own names and descriptions. A fallback tool still reaches every other endpoint, and an explorer and schema tool help the model find them. Curated mode is configured in mcp-gen.yaml with the CLI today.

    generation: mode: curated curated: tools: - operationId: createCustomer - operationId: getInvoice name: stripe_invoice - operationId: createPaymentIntent

The three Generic tools

What the model sees in Generic mode, whatever the size of the API.

The three tools Generic mode registers
ToolPurposeInput
{name}_list_schemasFind endpoints by category or search{ category?, search? }
{name}_get_schemaRead one endpoint’s parameters and body, with an example call{ operation }
{name}_api_callCall any endpoint, with parameters routed for you{ operation, params?, body? }

An operation can be named by its operationId, by method and path, or by a concrete URL path.

Estimated context cost

Rough estimates of the tool list a model reads on connect, not measurements.

Estimated tokens in the tools/list response by API size and generation mode
API sizePer EndpointGeneric
20 endpoints~5-8K~800
50 endpoints~15-20K~800
100 endpoints~30-40K~800
300 endpoints~80-120K~800

One params object

The model never has to know which parameter goes in the path, the query or a header.

  • What the model usually has to know

    path: { petId: "123" } query: { status: "available" } headers: { "X-API-Key": "sk-..." }
  • What a generated server asks for

    operation: "getPetById" params: { petId: "123", status: "available" } // Routed to path and query on the server. // Credentials are added outside the model.

The generated server

Production behaviour you would otherwise write by hand.

  • TypeScript on the official MCP SDK

    Generated servers are TypeScript, run on Bun, and use the official Model Context Protocol SDK over Streamable HTTP, with per-session state, idle sessions closed after 30 minutes and a cap on open sessions.
  • Retries that never repeat a POST

    Calls time out, and failed calls are retried with exponential backoff and jitter on 5xx, 429 and 408. POST and PATCH are never retried, so a flaky upstream cannot charge a customer twice.
  • Real-world specs

    References are resolved and inlined, including recursive and mutually recursive schemas. Operations without an operationId get a stable name from their method and path.
  • Credentials stay out of the model

    The model never sees or supplies a credential. In Generic mode, a header the model passes can never override the authentication header.
  • A small, non-root container

    Each server ships with a Dockerfile on a patched Alpine base that runs as a non-root user, plus a health endpoint.

Hosted on Statio

Each server is versioned, private and governed from its first call.

  • Versions, not redeploys

    Ship a new version and Statio fetches the spec again. If the spec, the generator and your settings are unchanged it reuses the last image; if anything changed it rebuilds and tells you why.
  • Preview, promote, roll back

    Each version can run on its own preview URL before you promote it. Roll back to an earlier version, cancel a build in progress or rebuild one, from the server’s page.
  • Private from the first deploy

    Generated servers are never public. Only the gateway can call them, and their outbound traffic goes through the egress proxy and that server’s allowlist.
  • Scanned on the way in

    When the server’s tools are discovered, their names and descriptions are scanned for prompt injection and anything suspicious is flagged for an admin.

The mcp-gen CLI

The same generator, driven by an mcp-gen.yaml in your repository.

mcp-gen commands
CommandWhat it does
mcp-gen initWrite a starter mcp-gen.yaml for a chosen mode
mcp-gen previewShow a spec’s endpoints, tags and methods, with your filters applied
mcp-gen scaffoldCreate a new server project with its config
mcp-gen syncRun the full pipeline and write the server, or show what would change with --dry-run

The config sets the spec (a URL or a local file), the server’s base URL and authentication, the generation mode and filters by tag, path, method and operation. Unknown keys are rejected, so a typo fails loudly instead of being ignored. Sync regenerates every file from the spec, so keep your changes in the config.

Plans

Lock down your first tool in minutes.

Three MCP servers, one of them hosted, and 10,000 calls a month, free and without a card. If you outgrow it the next plan is $19.

Two steps: create your account, then install the desktop app on each machine that runs an AI client.