mcp-anything
MCP-Anything
描述您的需求,获取生产就绪的 MCP 服务器。

MCP-Anything 可以将任何数据源转换为功能完备的 MCP 服务器——只需通过一段描述代理应具备哪些能力的自然语言简报即可。它也可以直接从代码库、OpenAPI 规范、gRPC 原型文件和 GraphQL 模式中生成。两种模式,一个工具。
快速开始
1. 安装
pip install mcp-anything
export ANTHROPIC_API_KEY=sk-...2. 编写简报 — 描述您的领域并指向您的数据源
# my-api.yaml
server_name: payments-mcp
domain_description: >
A payment API for managing customers, invoices, and subscriptions.
use_cases:
- "Create a customer with email and name"
- "Issue an invoice and send it to the customer"
- "Create and cancel subscriptions"
- "Issue refunds"
data_source_path: ./openapi.json # local file or URL
data_source_kind: openapi # openapi | graphql | grpc
auth_method: bearer_token
backend_target: fastmcp3. 构建
mcp-anything build --brief my-api.yaml -o ./my-mcp-server4. 运行
cd my-mcp-server
pip install -e .
python -m mcp_payments_mcp.server就是这样。您现在拥有了一个正在运行的 MCP 服务器。将其添加到您的代理中:
{
"mcpServers": {
"payments": { "command": "python", "args": ["-m", "mcp_payments_mcp.server"] }
}
}Related MCP server: mcpify
两种模式
build — 基于简报(推荐)
LLM 会读取您的简报,将相关操作归类为符合人体工程学的工具,编写针对代理优化的描述,并生成完整的服务器包,包括 SKILL.md 代理指南和评估工具。
generate — 代码库扫描(无需简报)
指向源代码或规范 URL。静态检测,无需 LLM。
# From a local codebase
mcp-anything generate /path/to/your/app
# From a URL (OpenAPI, GraphQL, gRPC)
mcp-anything generate https://api.example.com/openapi.json您将获得什么
两种模式都会生成一个完整的、可通过 pip 安装的包:
my-mcp-server/
├── mcp_<name>/
│ ├── server.py # FastMCP server (stdio or HTTP)
│ ├── tools/ # One file per tool, HTTP calls via httpx
│ ├── discovery.py # GET /.well-known/mcp
│ └── telemetry.py # Anonymised per-call logging
├── SKILL.md # Agent-readable usage guide (recipes, gotchas, anti-patterns)
├── quick_queries.json # Eval set derived from your use cases
├── eval_cases.json # LLM-generated evaluation cases
├── conformance_report.json
├── Dockerfile
└── pyproject.tomlSKILL.md 是关键输出。它是一份专为 AI 代理(而非人类)编写的结构化文档,列出了每个工具及其参数、操作模式、使用配方、陷阱和反模式。代理在进行任何调用之前都会阅读它,这大大减少了幻觉和误用。
工具设计方式
LLM 会自动遵循 2026 MCP 设计规则:
分组 CRUD。 对同一资源的三次或更多操作将合并为一个 manage_X(operation=...) 工具。工具更少,覆盖范围更广,代理更易于使用。
完整生命周期。 工具设计阶段会读取您的用例并将其映射到完整的 API 覆盖范围——不仅仅是成功路径。创建、读取、更新、删除、列表以及任何生命周期转换(确认、捕获、取消、完成、作废)都包含在内。
紧凑 + 详细。 每个工具都有一个 verbose 标志。默认情况下,它仅返回基本字段。传递 verbose=true 以获取包含元数据的完整 API 响应。
发现端点。 每个服务器都会公开 GET /.well-known/mcp,列出所有工具及其披露级别。
具体示例:Stripe
官方 Stripe 代理工具包 仅提供了 15 个扁平化工具,仅涵盖创建和列表操作。没有更新、没有删除、没有支付意图生命周期、没有结账会话、没有优惠券。
针对 Stripe OpenAPI 规范运行 mcp-anything 并配合 41 项简报:
mcp-anything build --brief stripe.yaml -o ./stripe-mcp --target fastmcp官方 Stripe 工具包 | mcp-anything | |
工具 | 15 个扁平化工具 | 13 个分组工具 |
客户 | 创建, 列表 | 创建, 读取, 更新, 删除, 列表 |
支付意图 | 仅列表 | 创建, 读取, 列表, 确认, 捕获, 取消 |
发票 | 创建, 完成 | 创建, 读取, 列表, 发送, 支付, 作废 |
订阅 | 创建, 取消 | 创建, 读取, 更新, 取消, 恢复, 列表 |
结账会话 | ✗ | 创建, 检索, 过期 |
优惠券与促销代码 | ✗ | 全面支持 |
13 个工具,100% 的简报覆盖率,比官方工具包多出 10 多项功能。
具体示例:GitHub
官方 GitHub MCP 服务器 是一个手工构建的 Go 项目。构建它花费了数月时间。
mcp-anything build --brief github.yaml -o ./github-mcp官方(手工构建) | mcp-anything | |
构建时间 | 数月 | ~30 秒 |
工具 | 51 个扁平化工具 | 22 个分组工具 |
覆盖范围 | 精选子集 | 100% 的范围内操作 |
语言 | Go | Python |
22 个工具覆盖了相同的 51 个操作——在不损失任何功能的情况下,表面积减少了 57%。分组(manage_repository, manage_issue, manage_pull_request 等)正是代理真正偏好的方式。
请参阅 examples/github-server/ 获取完整的生成输出。
输出目标
|
| |
语言 | Python | TypeScript |
SDK | FastMCP | mcp-use |
传输 | stdio / HTTP | HTTP (端口 3000) |
安装 |
|
|
mcp-anything build --brief my-api.yaml --target mcp-use
mcp-anything generate /path/to/app --target mcp-use传输
stdio (默认): 服务器作为本地子进程运行。
{
"mcpServers": {
"my-app": { "command": "mcp-my-app", "args": [] }
}
}HTTP (推荐用于共享/远程使用):
mcp-anything generate /path/to/app --transport http
# server runs at http://localhost:8000/sse{
"mcpServers": {
"my-app": { "url": "http://localhost:8000/sse" }
}
}HTTP 允许您部署一次,并从任何代理会话、CI 流水线或团队成员处进行连接。
框架支持(生成模式)
涵盖 8 个生态系统的 27 种源类型。静态检测,无需 LLM。
生态系统 | 框架 / 源 |
Python | argparse, Click, Typer, Flask, FastAPI, Django REST Framework |
Java / Kotlin | Spring Boot, Spring MVC, JAX-RS / Quarkus, Micronaut |
JavaScript / TypeScript | Express.js |
Go | Gin, Echo, Chi, gorilla/mux, Fiber, net/http |
Ruby | Rails |
Rust | Actix-web, Axum, Rocket, Warp |
API 规范 | OpenAPI 3.x / Swagger 2.x, GraphQL SDL, gRPC / Protobuf |
协议 / IPC | WebSocket (JSON-RPC), MQTT, ZeroMQ, XML-RPC, raw socket, D-Bus |
范围界定
无需编辑生成的代码即可控制公开哪些功能。
# Include / exclude by glob
mcp-anything generate ./my-app --include "/api/v2/*" --exclude "/internal/*"
# Review mode: pause after analysis, curate scope.yaml, then resume
mcp-anything generate ./my-app --review
vim mcp-my-app-server/scope.yaml
mcp-anything generate ./my-app --resume
# Reusable scope file
mcp-anything generate ./my-app --scope-file ./mcp-scope.yaml路线图
请参阅 ROADMAP.md 获取完整路线图。请参阅 CONTRIBUTING.md 进行贡献。
Star 历史
停止手工编写 MCP 服务器。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
A full backend your AI coding agent can set up over MCP
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
AI-native mock API server with MCP. Create REST/SOAP mocks from Claude, Cursor, or Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAutomatically converts any OpenAPI specification or Postman Collection into an MCP server, enabling AI assistants like Claude to directly interact with REST APIs without writing any code.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceTurns any OpenAPI specification into a fully working MCP server with a single command, enabling AI agents to call APIs without writing any glue code.MIT
- AlicenseNot gradedqualityDmaintenanceGenerates production-ready MCP servers from natural language, OpenAPI specs, database schemas, GraphQL schemas, or ontologies.71 npm1MIT
- AlicenseAqualityCmaintenanceTurn any OpenAPI/Swagger/Postman spec into an MCP server — give your LLM live access to any API.191Apache 2.0