MCP门户🚀
终极模型上下文协议中心
将来自多个MCP服务器的工具聚合到一个具有动态发现和跨平台Docker支持的统一门户中。
 ](https://docker.com) 
______________________________________________________________________
🏁 快速设置(推荐:Docker)
导航到要存储此内容的文件夹(repo、mcps等)
打开终端并输入以下内容:
git clone https://github.com/Chillbruhhh/MCPportal.git
cd MCPportal🚀 Docker(推荐)
- 构建Docker镜像:
docker build -t mcp-portal -f docker/Dockerfile .- 运行容器:
docker run -d -p 8020:8020 --name mcp-portal mcp-portal或使用自动检测:
python run-docker.py- 打开Web UI:
- 访问 http://localhost:8020 在您的浏览器中。
🐍 Python(替代)
- 安装依赖项:
pip install -r requirements.txt- 启动门户:
python -m mcp_gateway.main- 打开Web UI:
- 访问 http://localhost:8020 在您的浏览器中。
______________________________________________________________________
✨ 特性
- 🔍 动态MCP发现:从Cursor、VS Code、Claude Desktop等自动查找和集成MCP服务器
- 🌐 统一API:所有MCP工具和资源的单一端点
- 🐳 Docker就绪:具有自动配置安装功能的跨平台集装箱化
- ⚡ 实时管理:用于服务器管理、工具探索和配置编辑的Web UI
- 🔧 交叉平台的:可在Windows、macOS和Linux上使用智能命令翻译
- 📊 监控:内置日志记录、健康检查和性能指标
🚀 快速开始
地方发展
# Clone and install
git clone https://github.com/Chillbruhhh/MCPPortal.git
cd mcp-portal
pip install -r requirements.txt
# Start the portal
python -m mcp_gateway.main
# Open web UI: http://localhost:8020Docker部署
# Build image
docker build -t mcp-portal -f docker/Dockerfile .
# Auto-detect and run with your MCPs
python run-docker.py🎯 运作原理
MCP Portal会自动从IDE配置中发现MCP服务器,并将其聚合到一个统一的界面中:
flowchart TB
subgraph subGraph0["🔍 Discovery Phase"]
D["Configuration Scanner"]
A["Cursor IDE
Configuration"]
B["VS Code
Settings"]
C["Claude Desktop
Config"]
E["Other IDEs
Config Files"]
end
subgraph subGraph1["🚀 MCP Portal Core"]
F["Server Discovery Engine"]
G["Configuration Parser"]
H["Server Registry"]
I["Process Manager"]
J["Tool Aggregator"]
K["Unified API Server"]
end
subgraph subGraph2["📡 MCP Servers"]
direction LR
S1["Search Engine
MCP Server"]
S2["Database Tools
MCP Server"]
S3["Browser Control
MCP Server"]
S4["File System
MCP Server"]
S5["Web Scraping
MCP Server"]
S6["Code Analysis
MCP Server"]
end
subgraph subGraph3["🛠️ Aggregated Tools"]
direction LR
T1["web_search"]
T2["database_query"]
T3["take_screenshot"]
T4["read_file"]
T5["scrape_website"]
T6["analyze_code"]
end
subgraph subGraph4["🎛️ Management Dashboard"]
N["Web UI Dashboard
Monitor & Control MCP Servers"]
N1["Server Status Monitor"]
N2["Tool Management"]
N3["Configuration Editor"]
N4["Real-time Logs"]
end
subgraph subGraph5["🌐 AI Agent Interface"]
L["REST API
Tool Endpoints"]
M["WebSocket/SSE
Real-time Events"]
end
subgraph subGraph6["🤖 AI Agents & Applications"]
O["Claude Desktop
AI Assistant"]
P["ChatGPT
AI Assistant"]
Q["Custom AI Apps
Autonomous Agents"]
R["Development Tools
AI-Powered IDEs"]
S["Multi-Agent Systems
Agent Frameworks"]
end
subgraph subGraph7["🔄 Workflow"]
direction TB
W2["Parse MCP Settings"]
W1["Scan IDE Configs"]
W3["Start MCP Servers"]
W4["Aggregate Tools"]
W5["Expose Unified API"]
W6["AI Agents Call Tools"]
W7["Return Results"]
end
A --> D
B --> D
C --> D
E --> D
D --> F
F --> G
G --> H
H --> I
I --> J
J --> K & T1 & T2 & T3 & T4 & T5 & T6
K --> N & L & M
N --> N1 & N2 & N3 & N4
L --> O & P & R & S
M --> Q
I -.-> S1 & S2 & S3 & S4 & S5 & S6
W1 --> W2
W2 --> W3
W3 --> W4
W4 --> W5
W5 --> W6
W6 --> W7
D:::discoveryStyle
A:::discoveryStyle
B:::discoveryStyle
C:::discoveryStyle
E:::discoveryStyle
F:::portalStyle
G:::portalStyle
H:::portalStyle
I:::portalStyle
J:::portalStyle
K:::portalStyle
S1:::serverStyle
S2:::serverStyle
S3:::serverStyle
S4:::serverStyle
S5:::serverStyle
S6:::serverStyle
T1:::toolStyle
T2:::toolStyle
T3:::toolStyle
T4:::toolStyle
T5:::toolStyle
T6:::toolStyle
N:::dashboardStyle
N1:::dashboardStyle
N2:::dashboardStyle
N3:::dashboardStyle
N4:::dashboardStyle
L:::interfaceStyle
M:::interfaceStyle
O:::aiStyle
P:::aiStyle
Q:::aiStyle
R:::aiStyle
S:::aiStyle
W2:::workflowStyle
W1:::workflowStyle
W3:::workflowStyle
W4:::workflowStyle
W5:::workflowStyle
W6:::workflowStyle
W7:::workflowStyle
classDef discoveryStyle fill:#e3f2fd,stroke:#1976d2,stroke-width:2px,color:#000
classDef portalStyle fill:#f3e5f5,stroke:#7b1fa2,stroke-width:3px,color:#000
classDef serverStyle fill:#e8f5e8,stroke:#388e3c,stroke-width:2px,color:#000
classDef toolStyle fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000
classDef dashboardStyle fill:#fff8e1,stroke:#ff8f00,stroke-width:2px,color:#000
classDef interfaceStyle fill:#fce4ec,stroke:#c2185b,stroke-width:2px,color:#000
classDef aiStyle fill:#e1f5fe,stroke:#0288d1,stroke-width:3px,color:#000
classDef workflowStyle fill:#f1f8e9,stroke:#689f38,stroke-width:2px,color:#000🛠️ 支持的IDE和MCP源
- 光标IDE (
.cursor/mcp.json) - VS代码 (
settings.json) - 克劳德桌面 (
claude_desktop_config.json) - 帆板运动 (
.windsurf/mcp_servers.json) - Continue.dev (
.continue/config.json) - 自定义配置
📋 API终点
| 端点 | 方法 | 描述 |
|---|---|---|
/ | GET | Web UI仪表板 |
/api/v1/servers | GET | 列出所有MCP服务器 |
/api/v1/tools | GET | 列出所有聚合工具 |
/api/v1/resources | GET | 列出所有资源 |
/api/v1/config | GET/POST | 管理MCP配置 |
/api/v1/servers/refresh | POST | 刷新服务器发现 |
/api/v1/mcp | SSE/POST | 工具执行/事件的主MCP端点 |
/sse | GET | 服务器发送实时更新事件 |
🔧 配置
环境变量
MCP_PORTAL_PORT=8020
MCP_PORTAL_HOST=0.0.0.0
MCP_PORTAL_LOG_LEVEL=INFO手动配置
{
"mcpServers": {
"mcp-portal": {
"type": "sse",
"url": "http://localhost:8020/api/v1/mcp"
}
}
}Windsurf用户须知:使用serverUrl而不是url在您的配置中:
{
"mcpServers": {
"mcp-portal": {
"transport": "sse",
"serverUrl": "http://localhost:8020/api/v1/mcp"
}
}
}克劳德代码
claude mcp add-json mcp-portal '{"type":"sse","url":"http://localhost:8020/api/v1/mcp"}' --scope user🐳 Docker生产部署
使用Docker Compose
# 1. Build the Docker image
docker build -t mcp-portal .
# 2. Run the container
docker run -d -p 8020:8020 --name mcp-portal mcp-portal
# 3. Open the web UI
# Visit http://localhost:8020 in your browser生产脚本
# Build and run production container
./docker/build.sh prod
# View logs
docker logs mcp-portal-container
# Stop
docker stop mcp-portal-container📖 使用示例
列出可用工具
curl http://localhost:8020/api/v1/tools执行工具
curl -X POST http://localhost:8020/api/v1/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool": "brave-search", "arguments": {"query": "MCP documentation"}}'Web UI功能
- 服务器管理:启用/禁用MCP服务器
- 工具资源管理器:交互式浏览和测试工具
- 配置编辑器:使用JSON验证编辑MCP配置
- 实时监控:实时服务器状态和日志
🧪 测试
# Run tests
pytest tests/
# Run with coverage
pytest --cov=mcp_gateway tests/
# Test specific functionality
pytest tests/test_discovery.py -v🤝 贡献
我们欢迎捐款!请查看我们的 贡献指南 了解详情。
- 分叉存储库
- 创建要素分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
📝 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
🎉 致谢
______________________________________________________________________
准备好释放MCP生态系统的全部潜力了吗? ⭐ 启动此回购并开始使用 python run-docker.py!
