From 1419d88491bfc0ea3c3f1d7e70845db46e52dd92 Mon Sep 17 00:00:00 2001 From: johnlin Date: Mon, 6 Apr 2026 10:23:06 +0800 Subject: [PATCH] fix: use standard MCP config key "url" instead of "httpUrl" Align with the MCP specification (and Claude Desktop) which uses "url" for streamable HTTP server configuration. The non-standard "httpUrl" key caused servers configured with "url" to be incorrectly treated as stdio, leading to startup failures. Co-Authored-By: Claude Opus 4.6 --- README.md | 4 ++-- bot/agent.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5df991f..8da4a35 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ Create a `servers_config.json` file to add your MCP servers. If this file is not } ``` -For HTTP-based MCP servers (Streamable HTTP), use `httpUrl`: +For HTTP-based MCP servers (Streamable HTTP), use `url`: ```json { "mcpServers": { "my-server": { - "httpUrl": "https://mcp.example.com/mcp", + "url": "https://mcp.example.com/mcp", "headers": { "Accept": "application/json, text/event-stream" } diff --git a/bot/agent.py b/bot/agent.py index d944d2a..3a0ce8f 100644 --- a/bot/agent.py +++ b/bot/agent.py @@ -104,12 +104,12 @@ def truncate_history(self, chat_id: str) -> None: def from_dict(cls, name: str, config: dict[str, Any]) -> OpenAIAgent: mcp_servers: list[MCPServerStreamableHttp | MCPServerStdio] = [] for mcp_srv in config.get("mcpServers", {}).values(): - if "httpUrl" in mcp_srv: + if "url" in mcp_srv: mcp_servers.append( MCPServerStreamableHttp( client_session_timeout_seconds=MCP_SESSION_TIMEOUT_SECONDS, params={ - "url": mcp_srv["httpUrl"], + "url": mcp_srv["url"], "headers": mcp_srv.get("headers", {}), }, )