openapi-to-mcp
MCP Scribe
将任意 OpenAPI schema 转换为生产级 MCP 服务器。
Related MCP server: Any API MCP Server
概述
将 MCP Scribe 指向一个 OpenAPI schema。即可获得一个 MCP 服务器。
spec 中的每个操作都会成为一个模型可调用的工具,JSON Schema、凭据、重试、速率限制和响应整形都已处理妥当。无需维护生成的代码,也不用保持适配层同步——spec 就是事实来源,服务器在启动时从中派生而出。
MCP Scribe 专为将真实 API 置于语言模型之前的团队而设计,在这些场景中,真正重要的故障模式是凭据泄露、对可计费端点的失控重试,以及因工具面过大而让模型无法导航的问题。
安装
pip install mcp-scribe从源码安装,作为全局 CLI:
git clone https://github.com/kyegomez/mcp-scribe && cd mcp-scribe
uv tool install --editable ".[http]"http 附加依赖会安装 uvicorn 和 starlette,仅 HTTP 传输需要它们。stdio 服务器两者都不需要。
要求: Python 3.10 – 3.13。
快速开始
部署一个共享服务器
一条命令。输入 spec,服务器即刻就绪。
mcp-scribe deploy https://api.swarms.world/openapi.json --port 8000调用该服务器
import asyncio
import os
import sys
from dotenv import load_dotenv
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client
from mcp.shared._httpx_utils import create_mcp_http_client
load_dotenv()
# Streamable HTTP path defaults to /mcp (see transport.path).
MCP_URL = "http://127.0.0.1:8000/mcp"
async def main() -> None:
api_key = os.environ.get("SWARMS_API_KEY")
if not api_key:
sys.exit(
"set SWARMS_API_KEY first: export SWARMS_API_KEY=sk-..."
)
http = create_mcp_http_client(headers={"x-api-key": api_key})
async with http, streamable_http_client(
MCP_URL, http_client=http
) as (read, write), ClientSession(read, write) as session:
await session.initialize()
result = await session.call_tool(
"get_available_models_v1_models_available_get",
{},
)
print(result.content[0].text)
if __name__ == "__main__":
asyncio.run(main())
CLI 命令
Usage: mcp-scribe [OPTIONS] COMMAND [ARGS]...
Turn any OpenAPI schema URL into a production-grade MCP server.
Options:
--help Show this message and exit.
Commands:
serve Run the MCP server.
deploy Serve over HTTP with production defaults. The short path to a shared server.
inspect Show the tools a spec produces — the fastest way to validate a setup.
call Invoke one tool from the terminal — the same code path the server uses.
generate Write a self-contained, deployable MCP server project for a spec.
install Build the server and register it with your MCP client in one step.
version Print the version.
关键能力
能力 | 提供的价值 |
通用 spec 导入 | 支持从 URL、文件或 stdin 读取 OpenAPI 3.1、3.0 和 Swagger 2.0——JSON 或 YAML 格式。Swagger 2.0 会提前转换;外部和递归的 |
零代码工具生成 | 每个操作对应一个 MCP 工具,以 JSON Schema 2020-12 格式输出,支持完整的 |
凭据隔离 | spec 中声明的凭据参数会从工具 schema 中剥离,并在请求时注入。模型永远不会被要求生成其并不持有的密钥。 |
企业级身份验证 | API 密钥(header、query、cookie)、Bearer、HTTP Basic、带自动刷新的 OAuth2 client credentials,以及任意静态 header——可组合,每次请求都会应用。 |
多租户隔离 | 按调用方进行凭据透传,支持 header 白名单和 fail-closed 强制,因此一台共享服务器不意味着共享身份或共享账单。 |
默认高韧性 | 全抖动指数退避并遵循 |
默认安全的重试 | POST 和 PATCH 在未明确启用时绝不重试。重发可计费请求被视为比失败更糟。 |
攻击面控制 | 按标签、路径正则、方法或 |
上下文治理 | 响应会按可配置的预算截断,并附提示信息告知模型如何缩小请求范围。 |
双传输 | stdio 适用于个人、按用户划分的服务器;流式 HTTP 带 |
密钥卫生 | 支持 |
运维工具 |
|
可部署产物 |
|
文档
文档 | 内容 |
完整用户指南——心智模型、传输方式、凭据、多租户、过滤、schema 整形、可靠性、调试、部署和故障排查。 | |
详尽参考——每个 CLI 命令和 flag、每个配置键及类型和默认值、完整的环境变量表、Python API 和异常层级。 | |
贡献者和 agent 指南——命令、逐模块架构、承重不变量、约定和常见坑。 | |
Agent 技能定义——自主 agent 应如何选择命令、验证配置以及处理凭据。 |
许可证
Apache-2.0。详见 LICENSE。
引用
@misc{mcpscribe2026,
title = {mcp-scribe: production-grade MCP servers from OpenAPI schemas},
author = {Gomez, Kye},
year = {2026},
url = {https://github.com/kyegomez/mcp-scribe}
}@misc{mcp2024,
title = {Model Context Protocol},
author = {Anthropic},
year = {2024},
url = {https://modelcontextprotocol.io}
}This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAutomatically converts any OpenAPI specification into an MCP server, exposing all HTTP endpoints as callable tools with support for various authentication methods and request types.2
- FlicenseNot gradedqualityDmaintenanceDynamically converts any API with an OpenAPI v3 specification into MCP tools for AI assistants. It supports multiple authentication methods including OAuth2, Bearer tokens, and API keys for flexible integration.
- AlicenseNot gradedqualityAmaintenanceTurns any OpenAPI/Swagger API into MCP tools, enabling AI assistants to call REST API endpoints directly.2MIT
- AlicenseNot gradedqualityDmaintenanceExposes OpenAPI endpoints as MCP tools, enabling LLMs to discover and interact with REST APIs through the MCP protocol.13MIT
Related MCP Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/The-Swarm-Corporation/mcp-scribe'
If you have feedback or need assistance with the MCP directory API, please join our Discord server