TL;DR
Fern MCP Generator is generally available. One fern generate turns your OpenAPI spec into a
hosted MCP server that Claude, Cursor, and any other MCP client can call, on your own domain, with
analytics from the first request. It's built from the same spec and CLI as your Fern Docs and
SDKs, so all three ship together.
More of your users reach your API through an AI agent now. They ask Claude Code or Cursor to do something, and the agent makes the calls. To do that, the agent needs an MCP server: a list of tools it can discover and call, one for each thing your API does.
Writing that server by hand means defining every tool, wiring up auth, hosting a service, and updating all of it whenever the API changes. Fern MCP Generator does that work from the spec you already have, and as of today it's generally available.
From spec to live server
Add an MCP target to your sdk-config.yml and run fern generate:
targets:
- language: mcp
output:
delivery: hosted
slug: petstoreIn our test with the Swagger Petstore spec, generation took under a minute and produced 18 tools, one for each operation in the spec except a binary file upload. The server goes live at https://<your-org>.fernmcp.dev/petstore, and every later run updates it at the same URL. If a deploy fails, the previous version keeps serving.
That URL is what you share with your customers. It works in Claude Code, Cursor, VS Code, and any other MCP client, and the Dashboard gives you a setup snippet for each. You can also serve the server from your own hostname, like mcp.yourcompany.com, by adding a custom domain in the Dashboard.
Agents can now find and call our API, not just read about it. Fern is helping us drive more API adoption by doing less. It’s one more return on the spec we already maintain to power our Docs, SDKs, and CLI.
Tuned for how agents read tools
Many agents load every tool definition a server lists into their context window, so a server that exposes a whole API as-is crowds out the agent's actual work. Big APIs show how quickly that adds up. Stripe's public OpenAPI spec has 612 operations, and by our count their input schemas total about 1.5 MB of JSON once references are resolved. Just 27 of those operations have schemas over 16 KB, with the largest at 51 KB, and those 27 make up half the total.
Fern handles that by default. When a tool's input schema is over 16 KB, the server lists a trimmed version that targets 16 KB by collapsing deeply nested parts. The full schema stays available as a resource the agent reads in 8 KB pages, and each trimmed part names the page to read next. Tool descriptions are capped at 512 characters, and the server's instructions tell the agent which credentials your API expects.
Toolsets narrow things further. Fern creates a toolset for each tag and service in your spec that has at least two tools, and you can define your own, each at its own URL. GitHub's REST spec, for example, has 1,281 operations under 46 tags. As toolsets, an agent working on issues would connect to 66 tools instead of all 1,281.
Merging cuts the count again. When many operations do the same kind of thing, you can merge them into one tool that an agent calls with a single argument naming the operation. A verb that spans dozens of resource types costs one tool slot instead of dozens.
Tool names come from your operation IDs. To rename a tool or rewrite its description for agents, set x-fern-mcp-name or x-fern-mcp-description in your spec or an overlay.
Go beyond the spec
Some tools don't map to one endpoint. Write a custom tool in TypeScript for a workflow that spans several endpoints or does something no single operation covers, and run shared logic like auth headers or response shaping across every call with hooks. Both ship in the same generate step, whether Fern hosts the server or you download it.
Analytics from the first call
Every hosted server reports to the Fern Dashboard as soon as it takes traffic. You see requests, tool calls, success rate, errors, and your most-used tools. You also see calls to tools your server doesn't have, which tells you what agents expect your API to do.
The same page lists every generation and who ran it. You can roll back to an earlier one or pause the server from there.
Your API's auth, with zero data retention
Agents send the same API keys or tokens your API already accepts, and the server passes them through on each request. You don't issue new credentials or build a new auth flow.
Hosted servers follow zero data retention (ZDR). Fern doesn't store your API's requests or responses, or your users' credentials, so nothing an agent sends or gets back through the server is kept after the call. Analytics records metadata only, such as the tool name, status, and response time. Each request also has a 30-second timeout and a 1 MiB response limit, so one slow or oversized call can't stall an agent.
Why Fern for MCP
An MCP server is one more place your API shows up, next to your docs and your SDKs. With Fern, all of them come from one spec, one config file, and one CLI. A single fern generate in CI updates your Docs, SDKs in up to 9 languages, and your MCP server together, so an endpoint you ship today shows up everywhere in the same run instead of drifting across separate tools.
You also skip the infrastructure. Fern hosts the server, puts it on your domain, and gives you analytics and rollback in the Dashboard you already use. If you'd rather run it yourself, you can download the generated server instead.
If you're not on Fern yet, an OpenAPI spec is all you need to start.
Try it
Follow the MCP Generator quickstart to deploy a server from your spec, or book a demo and we'll set one up with you.
Built by [NAMES].