mcpify

mcpify

Turns any OpenAPI specification into a fully working MCP server with a single command, enabling AI agents to call APIs without writing any glue code.

Category
访问服务器

README

<div align="center">

mcpify

Turn any API into an MCP server. One command. No code.

License: MIT CI

</div>

npm install -g https://github.com/qualuo/mcpify/releases/latest/download/mcpify.tgz
mcpify https://petstore3.swagger.io/api/v3/openapi.json
✓ mcpify: Petstore v1.0.0 — 19 tools
  base: https://petstore3.swagger.io/api/v3
  transport: stdio

That's it. Your AI agent now has access to the entire Petstore API. No SDK to install. No glue code to write. No server to deploy.

Point it at any OpenAPI spec → get a fully working MCP server.


Why

Every team building agents hits the same wall: the model needs to call APIs, and wiring up each one means days of bespoke MCP server code, schema translation, and auth plumbing.

mcpify collapses that to one command. The OpenAPI spec already describes everything — endpoints, parameters, schemas, auth. We turn it into an MCP server at runtime, no codegen step, no source files to maintain.

Install

From the latest GitHub release:

npm install -g https://github.com/qualuo/mcpify/releases/latest/download/mcpify.tgz

Then run from anywhere:

mcpify <spec>

Requires Node.js 18+.

Update: re-run the install command above to pull the latest release.

Why a tarball URL? npm install -g github:user/repo is broken on Windows (creates dangling junctions to deleted temp dirs). The release tarball works reliably on every platform. An npm release will land once we've gathered some real-world usage feedback.

Use

From a hosted spec

mcpify https://api.example.com/openapi.json

From a local file (JSON or YAML)

mcpify ./spec.yaml

From a single curl command

mcpify --curl "curl -H 'Authorization: Bearer xxx' https://api.github.com/user/repos"

Generates a one-tool MCP server from any curl command. Body is parsed and turned into an input schema.

List tools without serving

mcpify list ./spec.json

Generate a standalone, hand-editable project

mcpify generate ./spec.json ./my-mcp
cd my-mcp && npm install && npm start

Use this when you want to fork the behavior — add caching, custom auth flows, post-processing, anything.

Auth

Set environment variables before launching. mcpify reads the spec's securitySchemes and matches them automatically.

# HTTP bearer schemes
export MCPIFY_BEARER_TOKEN=xxx

# apiKey schemes (header or query, as the spec says)
export MCPIFY_API_KEY=xxx

# HTTP basic
export MCPIFY_BASIC_AUTH=user:password

# Per-scheme override (use the scheme's name from the spec)
export MCPIFY_AUTH_<SCHEME_NAME>=xxx

# Free-form extra headers on every request
export MCPIFY_HEADERS='{"X-Trace-Id":"abc","X-Internal":"1"}'

Filter big specs

Stripe's full OpenAPI is ~600 endpoints. Most agents do not need all of them, and most clients won't tolerate that many tools. Trim:

# Only the customers tag
mcpify ./stripe.json --tag customers

# Only operations whose tool name matches a regex
mcpify ./stripe.json --filter "^createCustomer|^getCustomer"

# Hard cap
mcpify ./stripe.json --max-tools 30

Use with Claude Desktop

~/.config/claude/claude_desktop_config.json (Linux/macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

After running npm install -g github:qualuo/mcpify once, the mcpify binary is available on your PATH:

{
  "mcpServers": {
    "petstore": {
      "command": "mcpify",
      "args": ["https://petstore3.swagger.io/api/v3/openapi.json"]
    },
    "github": {
      "command": "mcpify",
      "args": ["--curl",
        "curl -H 'Authorization: Bearer ghp_xxx' https://api.github.com/user/repos"]
    }
  }
}

Use with Cursor / Cline / Claude Code

Same idea — anywhere you can configure an MCP server with a command and args, this works. mcpify speaks stdio.

# Claude Code:
claude mcp add petstore -- mcpify https://petstore3.swagger.io/api/v3/openapi.json

Programmatic API

import { loadOpenApiSpec, parseOpenApi, serve } from "mcpify";

const raw = await loadOpenApiSpec("./spec.yaml");
const spec = parseOpenApi(raw);
await serve(spec, {
  baseUrl: "https://staging.example.com",
  filterTag: "users",
});

How it works

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   OpenAPI spec  │ ─→ │ mcpify  runtime │ ─→ │   MCP client    │
│  (JSON / YAML)  │    │  (stdio server) │    │ (Claude/Cursor) │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                            │
                            ↓ tool call
                       ┌─────────┐
                       │  fetch  │ → your API
                       └─────────┘
  1. Dereference the spec (resolve $refs).
  2. Convert each operation into an MCP tool: path/query/header params become input properties; the request body becomes a nested body property.
  3. On a tool call, build the URL, attach auth from env, send the request, return the response.

No codegen. No restart loop. The spec is the source of truth.

Limitations

  • Streaming response bodies — currently buffered, capped at 64KB.
  • OAuth2 flows — not run automatically; supply a pre-fetched token via MCPIFY_BEARER_TOKEN.
  • File uploads (multipart/form-data) — not yet supported.
  • Webhooks / callbacks — out of scope.
  • Swagger 2.0 — partial; convert to OpenAPI 3 first for best results.

PRs welcome on all of the above.

Development

git clone https://github.com/qualuo/mcpify
cd mcpify
npm install
npm run build
npm test

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选