
为 AI 代理提供桥接,通过 MCP 与 OpenAPI 端点交互
概览
MCP-OpenAPI 服务器是一个桥梁,使 AI 代理能够通过模型上下文协议(MCP)发现并与您现有的 API 端点交互。通过将 OpenAPI 定义的服务作为带有正确类型、认证和选择性端点暴露的 MCP 工具,简化了基于云的 AI 代理与外部服务之间的集成,无需定制工具开发。 虽然许多MCP实现依赖stdiofor本地集成和命令行工具,但本项目专注于SSE传输,以支持多租户服务器端架构。 - :轻松将你的OpenAPI服务暴露给AI代理,无需重建API或创建自定义MCP工具。非常适合希望实现AI与其平台集成的SaaS公司。 - :将您的服务器端代理连接到多个外部服务,参数类型正确。非常适合构建能够无缝交互Zendesk、Stripe及其他API系统的助手。
概述(AI 翻译)
MCP-OpenAPI 服务器是一个桥梁,使 AI 代理能够通过模型上下文协议(MCP)发现并与您现有的 API 端点交互。通过将 OpenAPI 定义的服务作为带有正确类型、认证和选择性端点暴露的 MCP 工具,简化了基于云的 AI 代理与外部服务之间的集成,无需定制工具开发。
虽然许多MCP实现依赖stdiofor本地集成和命令行工具,但本项目专注于SSE传输,以支持多租户服务器端架构。
这是给谁的?
-
API 提供者:轻松将您的OpenAPI服务暴露给AI代理,无需重建API或创建自定义MCP工具。非常适合希望实现AI集成的SaaS公司。
-
AI 代理开发者:将您的服务器端代理连接到多个外部服务,参数配置正确。非常适合构建能够无缝与 Zendesk、Stripe 及其他 API 交互的助手。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP-OpenAPI Server
MCP-OpenAPI Server is a bridge that enables AI agents to discover and interact with your existing API endpoints through the Model Context Protocol (MCP). By exposing OpenAPI-defined services as MCP tools with proper typing, authentication, and selective endpoint exposure, it simplifies integration between cloud-based AI agents and external services without requiring custom tool development.
While many MCP implementations rely on stdiofor local integrations and command-line tools, this project focuses on SSE transport to enable a multi-tenant server-side architecture.
Who is This For?
-
API Providers: Easily expose your OpenAPI services to AI agents without rebuilding APIs or creating custom MCP tools. Perfect for SaaS companies wanting to enable AI integration with their platform.
-
AI Agent Developers: Connect your server-side agents to multiple external services with properly typed arguments. Ideal for building assistants that can seamlessly interact with systems like Zendesk, Stripe, and other APIs.
-
Enterprise Integration Teams: Create standardized access patterns for AI agents to interact with your internal systems while maintaining proper authentication and permissions.
-
Prototype Developers: Quickly test AI-API interactions before investing in a dedicated MCP implementation, helping identify improvements to your API structure and documentation.
Key Features
- SSE Transport: This server leverages the SSE transport for MCP (rather than Stdio) so it works well for multiple agent clients.
- Each OpenAPI server is available at a separate route
//sse(e.g.,https://my-mcp-server/stripe/sse).
- Each OpenAPI server is available at a separate route
- Selective Route Exposure: Expose only the routes/tools you want for your agents to be aware of, using a regex on the route.
- Authentication Forwarding: Share the same MCP tools across multiple users by forwarding the appropriate authorization headers and/or query parameters.
- Type Safety: Tools are generated with typed arguments based on the OpenAPI schema.
- JSON bodies and parameters are converted appropriately with supported for nested objects and more complex schemas.
Running
Start the Server
Define your servers in servers.yaml following the structure in servers.yaml.example and:
servers:
- namespace: stripe
# Forward the Authorization header to the Stripe API
forward_headers:
- Authorization
name: Stripe API
url: https://raw.githubusercontent.com/stripe/openapi/refs/heads/master/openapi/spec3.yaml
base_url: https://api.stripe.com
# Select which API paths to expose over MCP. Each matching path will become a tool with arguments
# from the query parameters or the JSON body.
# For example, we're only exposing the endpoints to GET/POST a customer.
paths:
- /v1/customers$
- namespace: zendesk
安装
docker run -p 8000:8000 -v $(pwd)/servers.yaml:/app/servers.yaml mcp-openapi