> ## Documentation Index
> Fetch the complete documentation index at: https://mcpverified.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI → MCP Generators

> Tools that automatically scaffold MCP servers from existing OpenAPI specifications

export const GitHubPackageCards = ({packages}) => <CardGroup>
    {packages.map(pkg => {
  const repoPath = `${pkg.owner}/${pkg.repo}`;
  const npmPackage = pkg.npmPackage || pkg.repo;
  return <Card key={repoPath} title={pkg.title || npmPackage} href={`https://github.com/${repoPath}`} img={`https://opengraph.githubassets.com/1/${repoPath}`}>
          <img alt="GitHub Repo stars" src={`https://img.shields.io/github/stars/${repoPath}?style=flat`} />
          <img alt="GitHub License" src={`https://img.shields.io/github/license/${repoPath}?style=flat`} />
          <img alt="GitHub last commit" src={`https://img.shields.io/github/last-commit/${repoPath}?style=flat`} />
          {pkg.npmPackage && <img alt="NPM Downloads" src={`https://img.shields.io/npm/dw/${npmPackage}?style=flat`} />}
        </Card>;
})}
  </CardGroup>;

# <Icon icon="wand-magic-sparkles" iconType="solid" color="#8B5CF6" /> Turn Existing APIs into MCP Servers

Many teams already have a fully-documented REST API described with **OpenAPI 3.0+**. Rather than re-writing that logic from scratch using a server framework, you can *generate a thin MCP proxy* that forwards requests to your upstream API while speaking the **Model Context Protocol** to AI assistants.

These generators focus on ***existing* services**, whereas the [framework comparison](./comparison) targets building ***new* servers** from the ground-up.

<Callout type="info">
  <Icon icon="circle-info" iconType="solid" /> Use these tools when you *already* own an OpenAPI spec and just want to expose it through MCP with minimal effort.
</Callout>

## <Icon icon="toolbox" iconType="solid" /> Available Generators

<GitHubPackageCards
  packages={[
{
  owner: "harsha-iiiv",
  repo: "openapi-mcp-generator",
  title: "openapi-mcp-generator",
  npmPackage: "openapi-mcp-generator"
}
]}
/>

## <Icon icon="rocket" iconType="solid" /> Quick Start (stdio example)

```bash theme={null}
# Install globally
npm i -g openapi-mcp-generator

# Generate a stdio MCP server from your OpenAPI file
openapi-mcp-generator \
  --input ./petstore.json \
  --output ./petstore-mcp

cd petstore-mcp && npm install && npm start
```

The CLI will:

1. Parse your OpenAPI document
2. Create a fully-typed TypeScript project with `@modelcontextprotocol/sdk`
3. Generate Zod schemas for validation
4. Scaffold a `stdio` entry-point (or `web` / `streamable-http` based on flags)
5. Provide sample HTML clients for quick testing

## <Icon icon="check-circle" iconType="solid" color="#10B981" /> When to Choose Automatically-Generated Servers

* **Legacy REST APIs** needing AI integration fast
* **Backend teams** that don't want to learn MCP details
* **Prototyping** multiple microservices for LLM agents
* **Consistency** – guarantees your MCP contract stays in sync with the OpenAPI source

<Warning>
  Generated code is an excellent starting point, but you may still want to harden auth, logging, and error-handling before production use.
</Warning>

## <Icon icon="chart-bar" iconType="solid" /> Feature Highlights

| Feature                                                   | openapi-mcp-generator |
| --------------------------------------------------------- | --------------------- |
| **OpenAPI 3.0+ Support**                                  | ✓                     |
| **Transports** (`stdio`, `web` w/ SSE, `streamable-http`) | ✓                     |
| **Auth Schemes (API key, Bearer, Basic, OAuth2)**         | ✓                     |
| **Runtime Validation (Zod)**                              | ✓                     |
| **Typed Output (TypeScript)**                             | ✓                     |
| **Test Clients (HTML)**                                   | ✓                     |

## <Icon icon="exclamation-triangle" iconType="solid" color="#F97316" /> Limitations & Pitfalls

<Callout type="warning">
  <Icon icon="triangle-exclamation" iconType="solid" /> **MCP ≠ simple REST proxy.** Automatically exposing every REST endpoint as a tool often **hurts LLM performance** more than it helps.
</Callout>

LLM experts (e.g. [David Cramer](https://x.com/zeeg/status/1913289979368796671)) warn that a naïve *OpenAPI-as-MCP* shim runs into several issues:

* **Tool overload:** LLMs struggle to pick from dozens (or hundreds) of endpoints. Slightly similar verbs (`create_post` vs `post_message`) cause frequent mis-selections.
* **Excessive parameters:** Classic REST endpoints expose many optional fields; the model must decide what to fill, *without UI context*.
* **Context limits:** Many models cap tool descriptions (\~1 kB for some). Rich OpenAPI docs get truncated, losing critical guidance.
* **Response verbosity:** Machine-oriented JSON responses (IDs, uuids, nested data) are hard for models to interpret without additional reasoning.
* **Mismatch in abstractions:** Great MCP tools are designed around user-intent tasks ("Send a Slack message to #sales") rather than low-level CRUD endpoints.

<Tip>
  Treat the generated code as a **starting template**. Refactor the resulting tools, prune unnecessary endpoints, and wrap complex flows into higher-level, LLM-friendly actions.
</Tip>

## <Icon icon="link" iconType="solid" /> Further Reading

* GitHub: [harsha-iiiv/openapi-mcp-generator](https://github.com/harsha-iiiv/openapi-mcp-generator)
* NPM: [`openapi-mcp-generator`](https://www.npmjs.com/package/openapi-mcp-generator)
