Integrations
Embeds a terminal recording demonstration of the MCP server functionality
References GitHub for the project roadmap and contribution process
Enables GitHub Copilot to interact with OpenAPI services through the MCP server, allowing Copilot to use tools defined by the OpenAPI specification
🤖 OpenAPI MCP 服务器
将任何 OpenAPI 服务转换为模型上下文协议 (MCP) 服务器的命令行工具,实现与支持 MCP 规范的 AI 代理和工具的无缝集成。
此工具仍处于早期开发阶段。路线图请点击此处
什么是模型上下文协议(MCP)?
模型上下文协议 (MCP) 是 AI 代理与外部工具和服务交互的标准化协议。它为 AI 模型提供了一种一致的方式,使其能够通过统一的接口发现、理解和利用各种功能,从而更轻松地构建能够与多种服务交互的 AI 应用。
什么是 OpenAPI?
OpenAPI(以前称为 Swagger)是一种机器可读接口文件的规范,用于描述、生成、使用和可视化 RESTful Web 服务。它允许人类和计算机无需访问源代码或其他文档即可发现和理解服务的功能。
关于此项目
该中间件充当 OpenAPI 服务和 MCP 客户端之间的桥梁。它:
- 将 OpenAPI 规范文件作为输入
- 自动生成符合 MCP 标准的服务器
- 将传入请求代理到实际的 OpenAPI 服务
- 在 MCP 和 REST 约定之间进行转换
这使得任何具有 OpenAPI 规范的现有 REST API 都可以立即被理解 MCP 的 AI 代理访问,而无需对原始服务进行任何修改。
安装
用法
选项
-s, --spec <path>
(必需):OpenAPI 规范文件的路径(环境:OMP_OPENAPI_SPEC_FILE
)-t, --target <url>
(可选):API 服务的目标 URL(默认值:“ http://localhost:8080 ”,环境变量:OMP_TARGET_BASE_URL
)-p, --port <number>
(可选): 运行 MCP 服务器的端口 (默认值: "3000", 环境变量:PORT
)-V, --version
:显示版本号-h, --help
:显示命令帮助
例子
为 Petstore API 启动 MCP 服务器
测试
MCP 检查器
要测试您的 MCP 服务器,您可以使用模型上下文协议:
- 安装 MCP 检查器:
- 启动 MCP 服务器
- 导航到检查器的 UI 并填写以
/mcp
结尾的正确服务器路径,例如http://localhost:3000/mcp
- 现在您可以与 MCP 服务器进行交互了。MCP 检查器将显示有关请求和响应的详细信息。
使用 VS Code
使用 VS Code 的内置代理模式更容易做到这一点:
- 打开 VS Code 并启用代理模式:
- 按
Cmd/Ctrl + Shift + P
- 输入“切换 GitHub Copilot 代理模式”
- 选择“启用”
- 按
- 添加您的 MCP 服务器:
- 按
Cmd/Ctrl + Shift + P
- 输入“MCP:添加服务器”
- 输入您的 MCP 服务器 URL,例如
http://localhost:3000/mcp
,以/mcp
结尾
- 按
- 您的 github copilot 聊天应该会采用它所拥有的新工具!
- 现在,您可以通过 VS Code 的代理界面与 MCP 服务器进行交互。尝试询问它“现在有多少只宠物可用?”
有关如何在 VS Code 中使用 MCP 服务器的更多信息, 请参阅
贡献
欢迎贡献!请随时提交 Pull 请求。路线图在这里
执照
麻省理工学院
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
将任何 OpenAPI 服务转换为模型上下文协议 (MCP) 服务器的命令行工具,实现与支持 MCP 规范的 AI 代理和工具的无缝集成。
Related MCP Servers
- -securityAlicense-qualityAn MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.Last updated -2PythonMIT License
Open-Ledger-MCP-Serverofficial
-securityAlicense-qualityA Model Context Protocol (MCP) server implementation for the OpenLedger API. This server provides structured context to AI models according to the MCP specification.Last updated -8TypeScriptApache 2.0- -securityFlicense-qualityA Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.Last updated -9Python
- -securityAlicense-qualityA zero-configuration tool that automatically converts FastAPI endpoints into Model Context Protocol (MCP) tools, enabling AI systems to interact with your API through natural language.Last updated -1PythonMIT License