Skip to content

Gemini CLI should clean up/close mcp servers it launches on exit #13391

@natorion

Description

@natorion

What happened?

This is related to ChromeDevTools/chrome-devtools-mcp#484. We observe the same behavior in Gemini CLI. Debugged browser instances, when they are created with the ephemeral Chrome profiles are not closed when Gemini CLI is quit.

Rough user flow:

  1. A user has our MCP server set-up with the standard config.
  2. In Gemini CLI session A they start utilizing it and everything works fine (tool call success)
  3. The user closes session A and this does not seem to tear down our MCP server properlyl.
  4. later on, the user starts another Gemini CLI session B.
  5. Our MCP is going to be utilized but our list_pages tool returns a tool failure, because the Chrome instance referenced in the config is still running (tool call failure)
  6. The user manually needs to kill the old chrome processes to get going.

What did you expect to happen?

The opened browser instance/mcp server is closed.

Client information

Client Information

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

> /about
About Gemini CLI                                                                                      │
│                                                                                                       │
│ CLI Version                        0.16.0                                                             │
│ Git Commit                         230056cc                                                           │
│ Model                              auto                                                               │
│ Sandbox                            no sandbox                                                         │
│ OS                                 darwin

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalityhelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!priority/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