Skip to main content
Watch: Anthropic Just Hit the Brakes on Its Next AI Model

Gemini CLI error

Gemini CLI: MCP error -32000: Connection closed

Error message
MCP error -32000: Connection closed

Status: WorkaroundLast verified 3 documented fixes4 sources

What it means

A configured MCP server process exited or closed its stdio/HTTP connection, so the server shows as DISCONNECTED and its tools are unavailable.

Causes

  • Per the MCP server docs ("Server won't connect", status DISCONNECTED), check that command, args, and cwd are correct, that the server command works when run directly, that required packages are installed, the CLI output for errors, and that the CLI can execute the server command.

How to fix it

  1. Fix 1.

    Run gemini mcp list from your shell to see connection errors for all configured servers. In a session, /mcp list re-enables detailed diagnostics for a server.

    Snippet
    gemini mcp list
  2. Fix 2.

    Follow the docs checklist: verify command, args, and cwd; run the server command directly to confirm it works; make sure required packages are installed; review the CLI output for errors; make sure the CLI can execute the server command; and check stderr for server-side errors.

  3. Fix 3.

    If tool calls time out rather than disconnect, increase the per-server timeout in settings.json (milliseconds; default 600,000ms = 10 minutes). #7661 ("Simplify MCP server timeout configuration") fixed the timeout setting not being honored; a reply in #7324 found the fix in the v0.4.0 preview series.

    JSON
    {
      "mcpServers": {
        "my-server": {
          "timeout": 600000
        }
      }
    }

More Gemini CLI errors

All 19 Gemini CLI errors

FAQ

What does "MCP error -32000: Connection closed" mean in Gemini CLI?

A configured MCP server process exited or closed its stdio/HTTP connection, so the server shows as DISCONNECTED and its tools are unavailable.

How do I fix "MCP error -32000: Connection closed"?

There are 3 documented fixes. Start with the first: Run gemini mcp list from your shell to see connection errors for all configured servers. In a session, /mcp list re-enables detailed diagnostics for a server.

Is this Gemini CLI error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it.

Sources

Last verified against 4 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.