OW

open-webui/mcpo

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

4415 stars 508 forks 质量 78 趋势 33MIT

一个简单、安全的MCP到OpenAPI代理服务器

概览

即时将任何MCP工具暴露为兼容OpenAPI的HTTP服务器。 mcpo 是一个非常简单的代理,它通过标准 RESTful OpenAPI 接收 MCP 服务器命令,从而让它能够访问,所以你的工具“只是”能和期望 OpenAPI 服务器的 LLM 代理和应用兼容。 没有自定义协议。没有胶水代码。没有麻烦。 MCP 服务器通常通过原始 stdio 通信,具体如下: - 🔓 本质上不安全 - ❌ 与大多数工具不兼容 - 🧩 缺少文档、认证、错误处理等标准功能。 MCPO解决了所有这些问题——而且毫不费力: - ✅ 即时支持OpenAPI工具、SDK和用户界面 - 🛡 通过可信的网络标准增加安全性、稳定性和可扩展性 - 🧠 自动生成交互式文档,无需配置 - 🔌 纯HTTP——无套接字、无胶水代码、无意外 感觉像是“再迈一步”的,其实是少了一步却有更好的结果。

概述(AI 翻译)

即时将任何MCP工具暴露为兼容OpenAPI的HTTP服务器。

mcpo 是一个非常简单的代理,它通过标准 RESTful OpenAPI 接收 MCP 服务器命令,从而让它能够访问,所以你的工具“只是”能和期望 OpenAPI 服务器的 LLM 代理和应用兼容。

没有自定义协议。没有胶水代码。没有麻烦。

🤔 为什么用mcpo而不是Native MCP?

MCP 服务器通常通过原始 stdio 通信,具体如下:

  • 🔓 天生不安全感
  • ❌ 与大多数工具不兼容
  • 🧩 缺少文档、认证、错误处理等标准功能。

MCPO解决了所有这些问题——而且毫不费力:

  • ✅ 可即时兼容OpenAPI工具、SDK和用户界面
  • 🛡 通过可信的网络标准增加安全性、稳定性和可扩展性
  • 🧠 自动生成所有工具的交互式文档,无需配置
  • 🔌 使用纯HTTP——无套接字,无胶合代码,无意外

感觉像是“再迈一步”的,其实是少了一步却有更好的结果。

MCPO让你的AI工具既可用、安全又互操作——现在就无任何麻烦。

🚀 快速使用

我们推荐用UV,因为启动速度极快且配置零。

或者,如果你用的是Python:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

⚡️ mcpo

Expose any MCP tool as an OpenAPI-compatible HTTP server—instantly.

mcpo is a dead-simple proxy that takes an MCP server command and makes it accessible via standard RESTful OpenAPI, so your tools “just work” with LLM agents and apps expecting OpenAPI servers.

No custom protocol. No glue code. No hassle.

🤔 Why Use mcpo Instead of Native MCP?

MCP servers usually speak over raw stdio, which is:

  • 🔓 Inherently insecure
  • ❌ Incompatible with most tools
  • 🧩 Missing standard features like docs, auth, error handling, etc.

mcpo solves all of that—without extra effort:

  • ✅ Works instantly with OpenAPI tools, SDKs, and UIs
  • 🛡 Adds security, stability, and scalability using trusted web standards
  • 🧠 Auto-generates interactive docs for every tool, no config needed
  • 🔌 Uses pure HTTP—no sockets, no glue code, no surprises

What feels like “one more step” is really fewer steps with better outcomes.

mcpo makes your AI tools usable, secure, and interoperable—right now, with zero hassle.

🚀 Quick Usage

We recommend using uv for lightning-fast startup and zero config.

uvx mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

Or, if you’re using Python:

pip install mcpo
mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

To use an SSE-compatible MCP server, simply specify the server type and endpoint:

mcpo --port 8000 --api-key "top-secret" --server-type "sse" -- http://127.0.0.1:8001/sse

You can also provide headers for the SSE connection:

mcpo --port 8000 --api-key "top-secret" --server-type "sse" --header '{"Authorization": "Bearer token", "X-Custom-Header": "value"}' -- http://127.0.0.1:8001/sse

To use a Streamable HTTP-compatible MCP server, specify the server type and endpoint:

mcpo --port 8000 --api-key "top-secret" --server-type "streamable-http" -- http://127.0.0.1:8002/mcp

You can also run mcpo via Docker with no installation:

docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "top-secret" -- your_mcp_server_command

Example:

uvx mcpo --port 8000 --api-key "top-secret" -- uvx mcp-server-time --local-timezone=America/New_York

That’s it. Your MCP tool is now available at http://localhost:8000 with a generated OpenAPI schema — test it live at http://localhost:8000/docs.

🤝 To integrate with Open WebUI after launching the server, check our docs.

🌐 Serving Under a Subpath (--root-path)

If you need to serve mcpo behind a reverse proxy or under a subpath (e.g., /api/mcpo), use the --root-path argument:

mcpo --port 8000 --root-path "/api/mcpo" --api-key "top-secret" -- your_mcp_server_command

All routes will be served under the specified root path, e.g. http://localhost:8000/api/mcpo/memory.

🔄 Using a Config File

在 GitHub 查看完整 README

安装

npx -y @modelcontextprotocol/server-memory
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"] }, "time": { "command": "uvx", "args": ["mcp-server-time", "--local-timezone=America/New_York"], "disabledTools": ["convert_time"] // Disable specific tools if needed }, "mcp_sse": { "type": "sse", // Explicitly define type "url": "http://127.0.0.1:8001/sse", "headers": { "Authorization": "Bearer token", "X-Custom-Header": "value" } }, "mcp_streamable_http": { "type": "streamable-http", "url": "http://127.0.0.1:8002/mcp" } // Streamable HTTP MCP Server } }