If the mcp launches an instance it should expose some way to close the browser
Is your feature request related to a problem? Please describe.
Right now there is no way to close the browser (via mcp) that is launched via mcp. Close page will refuse to close the only page.
Describe the solution you'd like
Expose to the mcp a way to close the browsers it launched
Describe alternatives you've considered
Using os utils to close manually
Additional context
No response
Currently the MCP client can close the browser by stopping the MCP server or you can close the browser manually. Does it work for you? Could you provide more details about the use case you have that requires closing the browser via the MCP tools?
We're using claude-agent-sdk-python and I guess they don't clean up the mcp servers that they start on exit. I think I can create an issue there.
@OrKoN Can you elaborate on the reason please why we precent closing the last tab?
A few thoughts:
- The server does not know when the client is finished
- The client can only guess that its actually finished (e.g. a user can jump between simultanous chat sessions)
- The client knows when the working session is done: When the client is closed or the server is shut down. At this point the server could get notified of impending shutdown and closes a debugged Chrome instances including its tabs IF its not pointing to default, ephemeral Chrome profile - I doubt users would appreciate us closing Chrome for their default profile when the server shuts down.
We're using claude-agent-sdk-python and I guess they don't clean up the mcp servers that they start on exit. I think I can create an issue there.
I think that's the best way forward for now. I also raised this issue for Gemini CLI in https://github.com/google-gemini/gemini-cli/issues/13391