内容
智 MCP 适配器
这是一个给小智反向 MCP 接入场景使用的桥接器。它会主动连接小智提供的反向,并把一个或多个标准 MCP 服务挂到这条连接后面。
## 运行
本地运行:
```bash
pip install -r requirements.txt
npm install --prefix ui-new
npm run build --prefix ui-new
copy .env.example .env
python app.py
```
打开 `http://127.0.0.1:8765`。
## 鉴权与持久化
从现在开始,不再要求你手动预先创建 `auth_config.json`。
容器默认把持久化目录设为 `/app/data`,首次进入网页时:
- 如果还没有管理员配置
- 或者密码仍然是弱密码
页面会强制进入初始化流程,并自动把鉴权文件写到:
```text
/app/data/auth_config.json
```
## 配置
默认配置文件是 [mcp_config.json](./mcp_config.json)。
示例:
```json
{
"upstreams": [
{
"name": "小智-A",
"endpoint": "wss://你的小智接入点"
}
"mcpServers": {
"示例-远程MCP "type": "streamablehttp",
"url": "httpMCP服务器:8000/mcp"
}
},
" [
{
"upstream": "小智-A",
"示例-远程MCP"
}
]
}
```
说明:
- 如果 `upstreams` 和 `bindings` 为空,适配器仍然会兼容 `MCP_ENDPOINT`
- `mcpServers` 支持 `streamablehttp`、`http`、`sse`、`## Docker
```bash
docker compose up --build -d
```
不需要手动创建 `auth_config.json`。
只要保证 [docker-compose.yml](./docker-compose.yml) 同目录下有一个可持久化的 `data/` 目录即可,程序会自己把鉴权配置写进去。
## 前端
React 管理台在 [ui-new](./ui-new)。