Skip to content

Commit f1bbb3a

Browse files
committed
feat: improve MCP server config handling and error reporting
1 parent 4304503 commit f1bbb3a

File tree

1 file changed

+5
-2
lines changed
  • src/datapilot/core/mcp_utils

1 file changed

+5
-2
lines changed

src/datapilot/core/mcp_utils/mcp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ def create_mcp_proxy():
5656
mcp_config = config.get("mcp", {})
5757

5858
# Select server
59-
servers = mcp_config.get("servers", {})
59+
# Support both "servers" and "mcpServers" naming conventions
60+
servers = mcp_config.get("mcpServers", mcp_config.get("servers", {}))
6061
server_names = list(servers.keys())
6162

6263
if not server_names:
63-
raise click.UsageError("No servers configured in mcp config")
64+
ctx = click.get_current_context()
65+
click.secho("Error: No servers configured in mcp config (tried keys: 'mcpServers' and 'servers')", fg="red")
66+
ctx.exit(1)
6467

6568
if len(server_names) > 1:
6669
server_name = click.prompt(

0 commit comments

Comments
 (0)