Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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, a server that will not connect is usually caused by a wrong command, args, or cwd, missing dependencies, a server command the CLI cannot execute (permissions), or server-side errors on stderr.

How to fix it

  1. Fix 1.

    Run /mcp list in a session, or gemini mcp list from your shell, to see connection errors for each configured 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; and make sure the CLI can execute the server command.

  3. Fix 3.

    If tool calls time out rather than disconnect, increase the per-server timeout in settings.json (milliseconds; default 600,000 ms = 10 minutes). Timeout configuration was simplified in v0.4.0 (#7661).

    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 /mcp list in a session, or gemini mcp list from your shell, to see connection errors for each configured 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.