Gemini Code Assist VS Code extension: MCP servers stuck in 'Connecting' state
I configured a stdio MCP server in ~/.gemini/settings.json (for example the everything MCP server via npx) in the Gemini Code Assist VS Code extension version 2.71.0. With Agent mode enabled in chat, the /mcp command shows the server stuck in 'Connecting' and no tools are available. The same configuration works correctly in the Gemini CLI version 0.28.2 on Linux. Is this a known problem and is there a fix?
Originally asked on GitHub: https://github.com/google-gemini/gemini-cli/issues/18987
2 answers
Status: explained but not fixed. The issue was closed as NOT_PLANNED. A contributor's triage summary says the extension's MCP client logic correctly transitions to CONNECTING but appears to hang during the mcpClient.connect(transport) call, meaning the MCP initialize request/response cycle does not complete inside the VS Code extension host. The summary lists possible causes: npx or node not being on the extension host's PATH, network or permission restrictions within VS Code, or the extension enforcing stricter MCP handshake compliance than the CLI. None of these were confirmed, and no code fix or configuration workaround was provided.
The only confirmed fact in the thread is that the identical configuration in ~/.gemini/settings.json works in the Gemini CLI, where /mcp shows the everything server as Ready with 14 tools. So if you need MCP tools now, using the Gemini CLI with the same settings is a practical option (this is general advice, not stated in the thread). The reported extension version was 2.71.0, CLI version 0.28.2, on Linux. A contributor later asked for the CLI version and suggested reopening the issue if the problem still occurs with the latest version, so checking for extension and CLI updates is reasonable before treating this as permanent.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Configured the official everything MCP server as a stdio server in ~/.gemini/settings.json, reloaded the VS Code window, enabled Agent mode in Gemini Code Assist chat, and ran the /mcp command. The server stayed in 'Connecting' and no tools were listed. The same configuration worked in the Gemini CLI, and multiple other stdio servers showed the same stuck behavior.
Source: https://github.com/google-gemini/gemini-cli/issues/18987 (opens external site)
Did this work for you?
Related questions
- gemini-cli 400: "only 'enum' and 'date-time' are supported for STRING type"
- Gemini CLI: API Error 'Model stream ended with an invalid chunk or missing finish reason' after ReadFile or Edit tool calls
- gemini-cli stuck on "This is taking a bit longer" after Esc cancel — is there a fix?
- Is there a way to get codebase indexing in gemini-cli?
- How can I use voice input instead of typing with Gemini CLI?