AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Openapi To Mcp

mcp-softwaresavants-openapi-to-mcp · by SoftwareSavants

Generate a lean MCP server from any OpenAPI spec — one command, full TypeScript project

No reviews yet
0 installs
34 views
0.0% view→install

Install

$ agentstack add mcp-softwaresavants-openapi-to-mcp

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-softwaresavants-openapi-to-mcp)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Openapi To Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

openapi-to-mcp

Generate a lean MCP server from any OpenAPI spec. One command — give it a spec URL or file, get a complete TypeScript MCP server with tools for every API endpoint.

Quick Start

npx @softwaresavants/openapi-to-mcp https://petstore3.swagger.io/api/v3/openapi.json

That's it. You now have a working MCP server in ./swagger-petstore-openapi-3-0-mcp/.

cd swagger-petstore-openapi-3-0-mcp
npm install
cp .env.example .env   # fill in your API key
npm run build
npm start

Usage

# From a URL
openapi-to-mcp https://api.example.com/openapi.json

# From a local file (JSON or YAML)
openapi-to-mcp ./api-spec.yaml

# Custom output directory and name
openapi-to-mcp spec.json -o ./my-mcp-server --name my-product

# Only include specific endpoints
openapi-to-mcp spec.json --include "/pets/**" "/users/**"

# Exclude endpoints
openapi-to-mcp spec.json --exclude "/admin/**" "/internal/**"

# Overwrite existing output
openapi-to-mcp spec.json -o ./existing-dir --force

Programmatic API

Use as a library in your own tools:

import { generateMcpServer } from "@softwaresavants/openapi-to-mcp";

// Parse only (no file output)
const { spec } = await generateMcpServer("https://api.example.com/openapi.json");
console.log(`Found ${spec.tools.length} tools`);

// Parse + generate
const { files } = await generateMcpServer("https://api.example.com/openapi.json", {
  outputDir: "./my-mcp-server",
  name: "my-product",
  include: ["/pets/**"],
});

What It Generates

A complete MCP server project based on the mcp-starter template:

my-product-mcp/
├── package.json
├── tsconfig.json
├── .env.example          # Pre-filled with your API's base URL
├── .gitignore
├── README.md
└── src/
    ├── index.ts           # Server entry — all tools registered
    ├── auth.ts            # API key + OAuth token auth
    ├── types.ts           # ApiConfig type
    ├── oauth-provider.ts  # Proxy OAuth provider
    ├── transports/
    │   ├── stdio.ts       # Stdio transport (default)
    │   ├── http.ts        # HTTP + OAuth transport
    │   └── sse.ts         # SSE transport (dev/testing)
    └── tools/
        ├── list_pets.ts   # One file per API operation
        ├── get_pet.ts
        └── ...

Three Transport Modes

Generated servers support all three transport modes out of the box:

npm start          # Stdio — API key auth (default, for Claude Desktop)
npm run start:http # HTTP — OAuth 2.1 (production, multi-user)
npm run start:sse  # SSE — API key auth (dev/testing, browser clients)

Design Philosophy

This tool generates MCP servers that are lean by design:

  • Token-efficient descriptions. Tool descriptions are capped at 80 characters. Every character in a tool description costs tokens on every LLM request — bloated descriptions waste money and context window.
  • One tool per operation. Each API endpoint becomes exactly one MCP tool with a clean Zod schema. No god-tools, no mega-handlers.
  • Working OAuth out of the box. The generated HTTP transport uses ProxyOAuthServerProvider from the MCP SDK — real OAuth 2.1 with PKCE, not placeholder code.
  • Claude Desktop compatible. Tool names are auto-truncated to 64 characters with collision detection. Generated servers work with Claude Desktop without manual fixes.
  • Full $ref dereferencing. Uses @apidevtools/swagger-parser to resolve all $ref references, including deeply nested and cross-file references. No "missing schema" surprises.
  • Filter, don't bloat. Use --include/--exclude to generate only the tools that matter. 5-10 tools is ideal — fewer tools means the LLM picks the right one every time.

Examples

Check the [examples/](./examples) directory for complete generated servers you can browse:

| Example | Source Spec | Tools | Description | |---------|------------|-------|-------------| | [petstore-mcp](./examples/petstore-mcp) | Swagger Petstore | 19 | Classic pet store — CRUD pets, orders, users | | [notion-mcp](./examples/notion-mcp) | Notion API | 13 | Blocks, databases, pages, users |

Each example is a complete, type-checked project — browse src/tools/ to see what the generated tool code looks like.

Options

| Flag | Description | Default | |------|-------------|---------| | -o, --output | Output directory | ./-mcp | | -n, --name | Server name | From spec info.title | | --include | Only include paths matching these globs | All paths | | --exclude | Exclude paths matching these globs | None | | --force | Overwrite existing output directory | Prompt | | -h, --help | Show help | |

Need a Production MCP Server?

This tool generates a solid starting point. For a production-grade MCP server with custom auth, permissions, and ongoing maintenance — talk to us.

Software Savants — the AI-native product studio. We build lean MCP servers that don't bloat the context window.

License

MIT

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.