MCPO_浏览器代理
MCP->MCPO代理浏览器代理。
MCPO修复-流式HTTP服务器的仅配置启动
问题
mcpo 之前已立即退出 TypeError: 'NoneType' object is not subscriptable 每当a --server-type 争论与 --config 或者当使用JSON配置时 "streamable_http"在这种状态下, server_command 是 None,因此MCPO采用stdio模式而不是HTTP并关闭。
根本原因
这 type 字段必须使用连字符值(streamable-http)当连接到预运行的MCP服务(Playwright、TARS等)时,MCPO必须在仅配置模式下启动。传递CLI和配置参数混淆了MCPO的启动逻辑。
解决方案
- 删除尾随
--server-type … --论据。 - 创建
/config/config.json与适当streamable-http条目。 - 仅使用以下命令启动MCPO
--config旗帜。
参考config.json
{
"mcpServers": {
"mcp_playwright": {
"type": "streamable-http",
"url": "http://playwright-mcp:8931/mcp"
},
"mcp_tars": {
"type": "streamable-http",
"url": "http://ui-tars-mcp:8000/mcp"
}
}
}启动命令
docker run -it --rm \
--name mcpo-debug \
--network mcpo_browser-agent_v1_mcpnet \
-v $(pwd)/mcpo:/config \
-p 3880:3879 \
ghcr.io/open-webui/mcpo:latest \
mcpo --config /config/config.json --host 0.0.0.0 --port 3879预期结果
Starting MCP OpenAPI Proxy with config file: /config/config.json
INFO - Loaded MCP server: mcp_playwright
INFO - Loaded MCP server: mcp_tars
INFO - Connecting to http://playwright-mcp:8931/mcp
INFO - Connecting to http://ui-tars-mcp:8000/mcp
INFO - Uvicorn running on http://0.0.0.0:3879实现注意事项
- MCPO仅使用配置启动。
- 确保
typeJSON中的键使用streamable-http. - 删除冗余
--server-type来自所有docker compose和CLI调用的标志。 - 如果需要,在启动MCPO之前添加健康检查逻辑。
- Docker堆栈现在构建了一个修补的MCPO映像,其启动器将默认配置复制到
/config/config.json如果绑定挂载为空,则消除FileNotFoundError启动崩溃。
