⚡ MCPO 配置管理器
用于管理的Web用户界面 MCPO(Master Chief Petty Officer) (模型上下文协议到OpenAPI)服务器。
特点/功能
- 🎨(彩绘/艺术创作) 双输入模式 - 基于表单的用户界面和JSON编辑器
- 🐳(海豚) Docker就绪 - 单个集装箱,单一(或“单次”)
docker-compose up命令 - ⚡(闪电符号,常用于表示快速、能量或惊人的事物) 通用运行时 - 支持uvx、npx和docker命令
- 🔐(锁形符号,常用于表示保密、安全或密码等) 认证 可选通过Caddy进行HTTP基本认证 + 使用MCPO API密钥保护
快速入门```bash
1. Set up environment variables
cp .env.example .env
Edit .env and set MCPO_API_KEY (required)
2. Start the service
docker-compose up -d
3. Access the UI
open http://localhost
4. View MCPO API docs
open http://localhost:8000//docs
**你将获得:**
- 用户界面:http://localhost(端口80)
- MCPO API:http://localhost:8000
- 包含默认时间服务器(可删除/替换)
- 配置更改时自动重启
## 服务器类型
用户界面支持三种类型的MCP服务器:
类型 · 描述 · 示例用例
项目 · 描述 · 其他信息 · ** · ** STDIO(标准输入输出)
命令行工具 · Python/Node.js MCP 服务器 · ** · ** 上海证券交易所
服务器发送事件 · 远程HTTP端点 · ** · ** 可流式传输的HTTP
## · HTTP 流媒体 · 自定义流媒体服务器
STDIO Servers (uvx, npx, docker)```json
{
"mcpServers": {
"time": {
"command": "uvx",
"args": ["mcp-server-time", "--local-timezone=America/New_York"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"docker-example": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/time"]
}
}
}
SSE Server```json
{
"mcpServers": {
"remote-sse": {
"type": "sse",
"url": "http://127.0.0.1:8001/sse",
"headers": {
"Authorization": "Bearer token"
}
}
}
}
Streamable HTTP Server```json
{
"mcpServers": {
"http-stream": {
"type": "streamable-http",
"url": "http://127.0.0.1:8002/mcp"
}
}
}
配置示例
建筑学
- 单个容器包含三个流程: Caddy(高尔夫球童)
- (端口80) - 反向代理,支持可选的HTTP基本认证 Streamlit 用户界面
- (localhost:8501) - 管理配置的网页界面 MCPO服务器
- (端口 8000) - 代理,将 MCP 服务器作为 OpenAPI 暴露出来 内置监视器
/config- 监视器```
┌─────────────────────────────────────┐
│ Container (mcpo-ui) │
│ │
│ ┌─────────┐ ┌─────────────┐ │
│ │Caddy:80 │────>│Streamlit │ │
│ │(+auth) │ │localhost:8501│ │
│ └─────────┘ └──────┬──────┘ │
│ │ │
│ ▼ │
│ config.json │
│ │ │
│ ▼ │
│ ┌──────────┐ │
│ │MCPO:8000 │ │
│ └──────────┘ │
│ (auto-restarts) │
└─────────────────────────────────────┘
## 目录,更改时重启MCPO```bash
# Copy project to new directory
cp -r . ../instance2
cd ../instance2
# Create .env with different ports and container name
cat > .env < Server returns 404
故障排除
- MCPO不在服务器根目录提供内容。请通过以下方式访问工具: `http://localhost:8000//docs`
- 文档: `http://localhost:8000//` 工具:
```bash
# ✅ View docs
curl http://localhost:8000/time/docs
# ✅ Call tool
curl -X POST http://localhost:8000/time/get_current_time \
-H "Content-Type: application/json" \
-d '{"timezone": "America/New_York"}'```
Changes not reflected
```bash
# Check watcher logs
docker logs
# Manual restart
docker restart```
Docker permission errors (Linux)
```bash
# Add user to docker group
sudo usermod -aG docker $USER
newgrp docker```
Container won't start
```bash
# View logs
docker-compose logs -f
# Rebuild
docker-compose up -d --build```
______________________________________________________________________
**(邮局)**
├── ui/ # Streamlit UI source files
│ ├── app.py # Main UI application
│ ├── config.example.json # Default config template
│ └── requirements.txt # Python dependencies
├── Caddyfile # Caddy reverse proxy config (HTTP Basic Auth)
├── entrypoint.sh # Container entrypoint (manages all processes)
├── Dockerfile # Single image with Caddy + UI + MCPO + watcher
├── docker-compose.yml # Development setup
├── docker-compose.prod.yml # Production setup
└── config/ # Volume for config.json (auto-created)```
项目结构:
生产部署
# Using docker-compose.prod.yml
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
使用来自 GitHub Container Registry 的预构建镜像:
ghcr.io/tonghualabs/mcpo-ui:latest
```
