Repro
Add an stdio MCP source via the UI with dotenv-style env, e.g.:
IBKR_HOST="127.0.0.1"
IBKR_PORT="4002"
Behavior
Child process receives IBKR_HOST = "127.0.0.1" (literal 11-char string with quotes), schema/Config validation in the child fails, child exits, and the API returns McpToolDiscoveryError surfaced as a generic "Failed connecting via stdio".
Cause
parseStdioEnv in packages/plugins/mcp/src/react/AddMcpSource.tsx:516 does a naive =-split + .trim() — it does not interpret surrounding quotes as syntactic.
Secondary: connectClient in packages/plugins/mcp/src/sdk/connection.ts:88-94 discards the underlying error, so the UI can't show the real cause.
Fix
Parse env like dotenv: matched surrounding "…" or '…' are treated as delimiters (with the usual escape handling inside double quotes). Optionally also propagate the underlying error message into McpConnectionError for better debuggability.
Repro
Add an stdio MCP source via the UI with dotenv-style env, e.g.:
Behavior
Child process receives
IBKR_HOST="127.0.0.1"(literal 11-char string with quotes), schema/Config validation in the child fails, child exits, and the API returnsMcpToolDiscoveryErrorsurfaced as a generic "Failed connecting via stdio".Cause
parseStdioEnvinpackages/plugins/mcp/src/react/AddMcpSource.tsx:516does a naive=-split +.trim()— it does not interpret surrounding quotes as syntactic.Secondary:
connectClientinpackages/plugins/mcp/src/sdk/connection.ts:88-94discards the underlying error, so the UI can't show the real cause.Fix
Parse env like dotenv: matched surrounding
"…"or'…'are treated as delimiters (with the usual escape handling inside double quotes). Optionally also propagate the underlying error message intoMcpConnectionErrorfor better debuggability.