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

MCP Generator

mcp-christopherdond-mcp-generator · by ChristopherDond

Wide MCP generator, easy and fast

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

Install

$ agentstack add mcp-christopherdond-mcp-generator

✓ 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 No
  • 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-christopherdond-mcp-generator)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo 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 MCP Generator? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

MCP-Generator

> Also available in: [Português (Versão em Português)](README.pt-BR.md)

Generate MCP servers from OpenAPI specs.

> Status: 🚀 Version v2.0.0 Released! View changes

mcp-gen turns an OpenAPI v3 spec into an MCP server in TypeScript or Python. It maps each route to a tool and keeps custom code when you regenerate.

Quick start

npm install
npm run build

Generate a server from a local spec:

mcp-gen generate -i examples/petstore.json -l typescript -o ./my-server

Validate a spec without generating files:

mcp-gen validate -i examples/petstore.yaml

Run the interactive CLI if you prefer prompts:

npm run dev

What it does

sequenceDiagram
    participant User
    participant CLI
    participant Parser
    participant Generator
    participant Output

    User->>CLI: mcp-gen generate --input api.yaml --lang python
    CLI->>Parser: validate and parse OpenAPI v3 (JSON or YAML)
    Parser->>Generator: internal AST (tools, models, examples)
    Generator->>Output: render Handlebars templates
    Output-->>User: TypeScript or Python MCP server project

Each route becomes an MCP tool with:

  • typed input from parameters and request bodies
  • example responses from the spec
  • optional incremental code preservation

Requirements

  • Node.js 20+
  • npm 9+ or yarn
  • (Optional) Python 3.8+ for Python projects

To install:

npm install -g mcp-gen

Installation

git clone https://github.com/ChristopherDond/MCP-Generator.git
cd MCP-Generator
npm install
npm run build

CLI

Commands

  • mcp-gen generate or mcp-gen g creates a server from a spec.
  • mcp-gen validate or mcp-gen v checks a spec without generating files.
  • mcp-gen init downloads a known public spec and can generate a project.
  • mcp-gen watch watches a file or URL and regenerates on changes.

Generate

mcp-gen generate -i ./api/openapi.yaml -l typescript -o ./my-server
mcp-gen generate -i ./api/openapi.yaml -l python -o ./my-server

Useful flags:

  • --force, -f overwrites existing files.
  • --incremental keeps code between @@mcp-gen:start and @@mcp-gen:end.
  • --name sets the server name.
  • --server-version sets the server version.
  • --plugin loads a plugin module or folder.

Validate

mcp-gen validate -i ./api/openapi.yaml

Valid input formats are .json, .yaml, .yml, or a URL.

Init

init uses the built-in registry:

mcp-gen init --from list
mcp-gen init --from stripe
mcp-gen init --from stripe --generate -o ./stripe-mcp

Available registry keys:

| Key | Description | |-----|-------------| | stripe | Stripe Payment API | | github | GitHub REST API | | slack | Slack Web API | | openai | OpenAI API | | petstore | Swagger Petstore example | | twilio | Twilio Communications API | | shopify | Shopify Admin API | | kubernetes | Kubernetes API | | digitalocean | DigitalOcean API | | azure | Azure Resource Manager API |

Watch

mcp-gen watch -i ./api/openapi.yaml -o ./my-server
mcp-gen watch -i https://example.com/spec.json --interval 60000

For URL inputs, --interval controls the polling interval. --once runs generation once and exits after the first change.

Plugins

Plugins can override templates and register extra Handlebars helpers.

Basic structure:

  • templates/typescript/... or templates/python/... for .hbs template overrides
  • index.js that exports registerHandlebars(handlebars) for custom helpers

Example:

mcp-gen generate -i ./api/openapi.yaml --plugin ./my-plugin
mcp-gen watch -i ./api/openapi.yaml --plugin ./my-plugin

Plugin templates override core templates when they use the same path under templates//.

Generated project structure

TypeScript:

my-server/
├── src/
│   ├── server.ts        # MCP server — tool definitions + handlers
│   └── models.ts        # TypeScript interfaces from OpenAPI schemas
├── .github/
│   └── workflows/
│       └── ci.yml
├── Dockerfile
├── package.json
├── tsconfig.json
└── README.md

Python:

my-server/
├── server.py            # FastMCP server — tool definitions + handlers
├── models.py            # Pydantic models from OpenAPI schemas
├── requirements.txt
├── .github/
│   └── workflows/
│       └── ci.yml
├── Dockerfile
└── README.md

Connect to Claude Desktop

TypeScript:

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/absolute/path/to/my-server/dist/server.js"]
    }
  }
}

Python:

{
  "mcpServers": {
    "my-server": {
      "command": "python",
      "args": ["/absolute/path/to/my-server/server.py"]
    }
  }
}

Restart Claude Desktop. Your API tools appear automatically.


Implement handlers

Generated files return spec examples by default. Replace stubs with real logic.

TypeScript (src/server.ts):

case "get_users_id": {
  // @@mcp-gen:start:get_users_id
  const user = await db.users.findById(args.id);
  return { content: [{ type: "text", text: JSON.stringify(user) }] };
  // @@mcp-gen:end:get_users_id
}

Python (server.py):

@mcp.tool()
async def get_users_id(id: float) -> Any:
    # @@mcp-gen:start:get_users_id
    user = await db.users.find_by_id(id)
    return user
    # @@mcp-gen:end:get_users_id

Code between @@mcp-gen:start and @@mcp-gen:end markers is preserved when you re-run generate --incremental.


Development

npm test
npx tsc --noEmit

# TypeScript example
node dist/cli/index.js generate --input examples/petstore.json --out /tmp/ts-test --force

# Python example
node dist/cli/index.js generate --input examples/petstore.yaml --lang python --out /tmp/py-test --force

# Incremental example
node dist/cli/index.js generate --input examples/petstore.json --out /tmp/ts-test --incremental

Roadmap

| Week | Status | Scope | |------|--------|-------| | 0–1 | ✅ Done | CLI, OpenAPI v3 parser, TypeScript generator, 7-file scaffold | | 2 | ✅ Done | YAML input, Python/FastMCP target, incremental generation | | 3 | ✅ Done | oneOf/anyOf support, auth stubs, integration tests | | 4 | ✅ Done | Interactive CLI mode, npm/pip publish | | 5 | ✅ Done | mcp-gen init --from stripe — built-in spec registry | | 6 | ✅ Done | Release candidate v1.0.0-rc.1 — in testing, feedback welcome! | | 7+ | 📋 Planned | Custom plugins, improvements from feedback, v1.0.0 final |


Known limitations

  • OpenAPI v2 (Swagger) is not supported — v3.x only
  • oneOf / anyOf / discriminator schemas are partially handled
  • copy-templates script uses cp — on Windows, change to xcopy in package.json

License

MIT © 2026 - Christopher D.

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.