diff --git a/backend/app/gateway/routers/mcp.py b/backend/app/gateway/routers/mcp.py index 3e6e9f9588..7c54daba0d 100644 --- a/backend/app/gateway/routers/mcp.py +++ b/backend/app/gateway/routers/mcp.py @@ -1,4 +1,5 @@ import asyncio +import json import logging import os import re @@ -793,7 +794,8 @@ def _validate_mcp_update_request( status_code=status.HTTP_400_BAD_REQUEST, detail=( f"Bundled MCP server '{name}' uses a different Python interpreter. " - f"Edit this server's JSON and set 'command' to {sys.executable!r}. " + f"Edit this server's JSON and set 'command' to {json.dumps(sys.executable)} " + f"(raw path for terminal use: {sys.executable}). " "Keep its capability metadata and credentials unchanged to preserve Agent selections; do not delete and reinstall it." ), )