mcpo+OpenWebUI
A secure MCP-to-OpenAPI proxy server that converts MCP tools into OpenAPI compatible HTTP servers, with support for multiple server types and automatic API documentation.
⚡️ mcpo+OpenWebUI 結合MCP的開源聊天工具
📁 專案架構
核心功能
- MCP 工具轉換為 OpenAPI 兼容的 HTTP 服務器
- 支援多種 MCP 服務器類型
- 自動生成 API 文檔
- 提供安全認證機制
支援的服務器類型
- 標準 MCP 服務器
- SSE 兼容服務器
- Streamable HTTP 兼容服務器
🚀 部署方式
系統需求
- Python 3.8+
- uv(推薦)
部署選項
- 使用 uv 部署
uvx mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command
- 使用 Python pip 部署
pip install mcpo
mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command
- 使用 Docker 部署
docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "top-secret" -- your_mcp_server_command
🐳 Docker 部署
使用 Docker 啟動
- 直接使用 Docker 映像
docker run -p 8000:8000 ghcr.io/open-webui/mcpo:main --api-key "top-secret" -- your_mcp_server_command
- 使用 docker-compose 啟動
# 啟動服務
docker-compose up -d
# 查看日誌
docker-compose logs -f
# 停止服務
docker-compose down
Docker 部署注意事項
- 環境配置
- 使用
.env文件管理 API 密鑰等敏感信息 - 可通過環境變數覆蓋預設配置
- 訪問路徑
- 主服務器:http://localhost:8000
- API 文檔:http://localhost:8000/docs
- 安全建議
- 生產環境請修改預設端口
- 使用強密碼作為 API 密鑰
- 定期更新 Docker 映像
📝 語法說明
基本命令格式
mcpo [選項] -- 命令
常用選項
--port: 指定服務器端口(預設:8000)--api-key: 設置 API 密鑰--server-type: 指定服務器類型(sse/streamable_http)--config: 指定配置文件路徑
配置文件格式
{
"mcpServers": {
"服務器名稱": {
"command": "命令",
"args": ["參數1", "參數2"],
"type": "服務器類型", // 可選
"url": "服務器URL" // 可選
}
}
}
服務器類型配置
- 標準 MCP 服務器
{
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
- SSE 服務器
{
"type": "sse",
"url": "http://127.0.0.1:8001/sse"
}
- Streamable HTTP 服務器
{
"type": "streamable_http",
"url": "http://127.0.0.1:8002/mcp"
}
🔧 開發環境設置
- 克隆專案
git clone https://github.com/open-webui/mcpo.git
cd mcpo
- 安裝依賴
uv sync --dev
- 運行測試
uv run pytest
⚠️ 注意事項
安全建議
- 始終使用 API key 保護服務器
- 避免在生產環境使用預設端口
- 定期更新依賴包
訪問路徑
- 主服務器:http://localhost:8000
- API 文檔:http://localhost:8000/docs
- 工具特定文檔:http://localhost:8000//docs
常見問題
- 確保 Python 版本符合要求
- 檢查端口是否被占用
- 驗證 API key 設置
- 確認服務器類型配置正確
📚 相關資源
🤝 貢獻指南
歡迎提交 Pull Request 或開 Issue 討論新功能。
相关服务器
Scout Monitoring MCP
赞助Put performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
赞助Access financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
My MCP Server
A remote MCP server deployable on Cloudflare Workers without authentication.
Python Local
An interactive Python REPL environment with persistent session history.
Remote MCP Server Kindler
A template for deploying a remote MCP server without authentication on Cloudflare Workers.
Code Council
Your AI Code Review Council - Get diverse perspectives from multiple AI models in parallel.
Base MCP Server
An MCP server providing onchain tools for AI applications to interact with the Base Network and Coinbase API.
Context7
Provides up-to-date, version-specific documentation and code examples for libraries directly into your prompt.
cesium-mcp
AI-powered CesiumJS 3D globe control — 43 tools for camera, entities, layers, animation, and interaction via MCP protocol. Also available as a remote server via Streamable HTTP.
PlantUML-MCP-Server
MCP server that provides PlantUML diagram generation capabilities
Prompts MCP Server
An MCP server for managing and serving prompts from markdown files with YAML frontmatter support.
Sequential Thinking Multi-Agent System (MAS)
An MCP agent that utilizes a Multi-Agent System (MAS) for sequential thinking and problem-solving.