Skip to content

McpClientManager.stopExtension does not disconnect extension-backed MCP clients #24050

@ryrenz

Description

@ryrenz

What happened?

McpClientManager.stopExtension() removes extension-backed MCP servers from
allServerConfigs, but it does not always disconnect the corresponding running
client.

The current implementation passes the MCP server name to
disconnectClient(), but disconnectClient() expects the computed client key.

As a result, the extension can appear unloaded in config state while the
backing MCP client remains connected.

What did you expect to happen?

Stopping an extension should also disconnect its extension-backed MCP clients.

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
  CLI Version: 0.35.1
  Git Commit: 8804fb770
  Model: Auto (Gemini 3)
  Sandbox: no sandbox
  OS: darwin
  Auth Method: Signed in with Google
  Tier: Gemini Code Assist in Google One AI Pro

Login information

No response

Anything else we need to know?

This may also be related to extension reload/update inconsistencies such as
#14527, but this report is specifically about the incorrect disconnect behavior
in stopExtension().

Metadata

Metadata

Assignees

Labels

area/extensionsIssues related to Gemini CLI extensions capabilitypriority/p2Important but can be addressed in a future release.type/bug

Type

No fields configured for Bug.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions