M

MCP Openapi Proxy

mcp-openapi-proxy是一个Python包,实现了一个模型上下文协议(MCP)服务器,用于将OpenAPI规范的REST API动态暴露为MCP工具,便于集成到MCP工作流中。
2.5分
95

什么是MCP开放API代理?

MCP开放API代理是一个将REST API动态转换为MCP工具的服务器,使开发者可以轻松集成和使用各种API。

如何使用MCP开放API代理?

只需配置OpenAPI规格文件URL,即可快速启用支持的API。

适用场景

适合需要快速集成多种API的项目,如自动化工具、数据集成平台等。

主要功能

动态生成工具自动创建MCP工具以对应OpenAPI定义中的每个有效端点。
简单模式提供预定义的一组工具,简化配置流程。
支持OpenAPI规范兼容OpenAPI v3,未来可能支持v2。
自定义认证支持通过JMESPath表达式进行认证。

优势与局限性

优势
快速集成多种API
动态生成工具无需手动配置
支持多种认证方式
局限性
对复杂API可能需要额外配置
依赖于有效的OpenAPI规格文件

如何使用

安装
通过PyPI安装MCP开放API代理。
配置
设置必要的环境变量如OPENAPI_SPEC_URL。
启动服务器
运行服务器以暴露API。

使用案例

Glama 示例快速验证Glama API。
Fly.io 示例管理Fly.io机器。

常见问题

如何确保OpenAPI规格文件有效?
如果API需要自定义认证怎么办?

相关资源

官方文档
MCP开放API代理的GitHub仓库。
OpenAPI规范
OpenAPI规范的官方网站。
安装
复制以下命令到你的Client进行配置
{
    "mcpServers": {
        "mcp-openapi-proxy": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "${OPENAPI_SPEC_URL}",
                "API_KEY": "${API_OPENAPI_KEY}"
            }
        }
    }
}

{
    "mcpServers": {
        "glama": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://glama.ai/api/mcp/openapi.json"
            }
        }
    }
}

{
    "mcpServers": {
        "flyio": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/abhiaagarwal/peristera/refs/heads/main/fly-machines-gen/fixed_spec.json",
                "API_KEY": "<your_flyio_token_here>"
            }
        }
    }
}

{
    "mcpServers": {
        "render": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://api-docs.render.com/openapi/6140fb3daeae351056086186",
                "TOOL_WHITELIST": "/services,/maintenance",
                "API_KEY": "your_render_token_here"
            }
        }
    }
}

{
    "mcpServers": {
        "slack": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json",
                "TOOL_WHITELIST": "/chat,/bots,/conversations,/reminders,/files,/users",
                "API_KEY": "<your_slack_bot_token, starts with xoxb>",
                "STRIP_PARAM": "token",
                "TOOL_NAME_PREFIX": "slack_"
            }
        }
    }
}

{
    "mcpServers": {
        "getzep": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/getzep.swagger.json",
                "TOOL_WHITELIST": "/sessions",
                "API_KEY": "<your_getzep_api_key>",
                "API_AUTH_TYPE": "Api-Key",
                "TOOL_NAME_PREFIX": "zep_"
            }
        }
    }
}

{
    "mcpServers": {
        "virustotal": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/virustotal.openapi.yml",
                "EXTRA_HEADERS": "x-apikey: ${VIRUSTOTAL_API_KEY}",
                "OPENAPI_SPEC_FORMAT": "yaml"
            }
        }
    }
}

{
  "mcpServers": {
    "notion": {
      "command": "uvx",
      "args": [
        "mcp-openapi-proxy"
      ],
      "env": {
          "API_KEY": "ntn_<your_key>",
          "OPENAPI_SPEC_URL": "https://storage.googleapis.com/versori-assets/public-specs/20240214/NotionAPI.yml",
          "SERVER_URL_OVERRIDE": "https://api.notion.com",
          "EXTRA_HEADERS": "Notion-Version: 2022-06-28"
      }
    }
  }
}

{
  "mcpServers": {
    "asana": {
      "command": "uvx",
      "args": [
        "mcp-openapi-proxy"
      ],
      "env": {
        "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/Asana/openapi/refs/heads/master/defs/asana_oas.yaml",
        "SERVER_URL_OVERRIDE": "https://app.asana.com/api/1.0",
        "TOOL_WHITELIST": "/workspaces,/tasks,/projects,/users",
        "API_KEY": "${ASANA_API_KEY}"
      }
    }
  }
}

{
    "mcpServers": {
        "apisguru": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/apis.guru/2.2.0/openapi.yaml"
            }
        }
    }
}

{
    "mcpServers": {
        "netbox": {
            "command": "uvx",
            "args": ["mcp-openapi-proxy"],
            "env": {
                "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/netbox.dev/3.4/openapi.yaml",
                "API_KEY": "${NETBOX_API_KEY}"
            }
        }
    }
}

{
  "mcpServers": {
    "wolframalpha": {
      "command": "uvx",
      "args": [
        "mcp-openapi-proxy"
      ],
      "env": {
        "OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/wolframalpha.com/v0.1/openapi.yaml",
        "API_KEY": "${WOLFRAM_LLM_APP_ID}"
      }
    }
  }
}
注意:您的密钥属于敏感信息,请勿与任何人分享。
精选MCP服务推荐
D
Duckduckgo MCP Server
已认证
DuckDuckGo搜索MCP服务器,为Claude等LLM提供网页搜索和内容抓取服务
Python
1.2K
4.3分
F
Figma Context MCP
Framelink Figma MCP Server是一个为AI编程工具(如Cursor)提供Figma设计数据访问的服务器,通过简化Figma API响应,帮助AI更准确地实现设计到代码的一键转换。
TypeScript
7.0K
4.5分
F
Firecrawl MCP Server
Firecrawl MCP Server是一个集成Firecrawl网页抓取能力的模型上下文协议服务器,提供丰富的网页抓取、搜索和内容提取功能。
TypeScript
4.4K
5分
M
Minimax MCP Server
MiniMax Model Context Protocol (MCP) 是一个官方服务器,支持与强大的文本转语音、视频/图像生成API交互,适用于多种客户端工具如Claude Desktop、Cursor等。
Python
1.1K
4.8分
C
Context7
Context7 MCP是一个为AI编程助手提供实时、版本特定文档和代码示例的服务,通过Model Context Protocol直接集成到提示中,解决LLM使用过时信息的问题。
TypeScript
5.6K
4.7分
E
Edgeone Pages MCP Server
EdgeOne Pages MCP是一个通过MCP协议快速部署HTML内容到EdgeOne Pages并获取公开URL的服务
TypeScript
429
4.8分
B
Baidu Map
已认证
百度地图MCP Server是国内首个兼容MCP协议的地图服务,提供地理编码、路线规划等10个标准化API接口,支持Python和Typescript快速接入,赋能智能体实现地图相关功能。
Python
997
4.5分
E
Exa Web Search
已认证
Exa MCP Server是一个为AI助手(如Claude)提供网络搜索功能的服务器,通过Exa AI搜索API实现实时、安全的网络信息获取。
TypeScript
2.1K
5分
AIbase
智启未来,您的人工智能解决方案智库
© 2025AIbase