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 討論新功能。
Máy chủ liên quan
Scout Monitoring MCP
nhà tài trợPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
nhà tài trợAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
ASKME-CLI
A command-line interface to prompt users for their next plan or confirmation.
DeepWiki by Devin
Remote, no-auth MCP server providing AI-powered codebase context and answers
AWS DynamoDB
The official developer experience MCP Server for Amazon DynamoDB. This server provides DynamoDB expert design guidance and data modeling assistance.
Dappier MCP Server
An MCP server for interacting with Dappier's Retrieval-Augmented Generation (RAG) models.
AppDeploy
AppDeploy lets you deploy a real, full-stack web app directly from an AI chat and turn your AI conversations into live apps, without leaving the chat or touching infrastructure.
Claude Memory MCP Server
A persistent memory server for Large Language Models, designed to integrate with the Claude desktop application. It supports tiered memory, semantic search, and automatic memory management.
Tabby-MCP-Server
A Tabby plugin implementing an MCP server for AI-powered terminal control and automation.
Chrome Debug MCP
This MCP allows you to record browser interactions with a chrome extension that include screenshots and console logs. The data is then saved to a local database that feeds the data to an AI system like claude code to search.
Bloomfilter
Let AI agents search, register, and manage domains via API
MCP Server Automation CLI
A CLI tool to automate packaging MCP servers as Docker images and deploying them to AWS ECS.