Home/Wiki Errors/Gemini CLI
Gemini CLI / MCP

DISCONNECTED - Gemini CLI MCP server is not connected or has errors

Gemini CLI registered an MCP server, but the server is not usable for tool calls.

Gemini CLI MCP disconnectedGemini CLI MCP OAuth tokensGemini CLI server not connected
Paste an error to match it against the wiki. / 粘贴报错后自动匹配。

Error text / 报错原文

  • DISCONNECTED
  • Server is not connected or has errors
  • mcp-oauth-tokens.json

What it means

Gemini CLI registered an MCP server, but the server is not usable for tool calls.

Most common causes

  • OAuth token in ~/.gemini/mcp-oauth-tokens.json is stale
  • Server command cannot start from the CLI environment
  • Dynamic OAuth discovery failed
  • Server crashed after initialization

Fastest fix

  • List MCP server status and identify the disconnected entry
  • Run the server command directly
  • Reauthenticate the affected MCP server
  • Check whether the command path is absolute

Safe fix

  • Pin local server package versions
  • Store OAuth tokens only in the CLI-managed token store
  • Use least-privilege scopes
  • Keep MCP logs out of public issues if they contain secrets

What not to do

  • Do not edit OAuth token JSON by hand unless backing it up first
  • Do not expose tokens in screenshots
  • Do not add global servers you do not need

How to confirm the fix

Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.

gemini mcp list
node --version
ls ~/.gemini

Related errors

Related tools

Sources