Skip to content

feat(browser): update chrome-devtools-mcp#21177

Closed
kunal-10-cloud wants to merge 8 commits intogoogle-gemini:mainfrom
kunal-10-cloud:feat/update-chrome-devtools-mcp
Closed

feat(browser): update chrome-devtools-mcp#21177
kunal-10-cloud wants to merge 8 commits intogoogle-gemini:mainfrom
kunal-10-cloud:feat/update-chrome-devtools-mcp

Conversation

@kunal-10-cloud
Copy link
Copy Markdown
Contributor

Summary

Update chrome-devtools-mcp to version 0.18.1 and replace the custom type_text tool implementation with the native version now provided by the MCP server.

Details

  • Upgraded MCP server version to 0.18.1.
  • Removed custom type_text implementation and related declarative tool classes.
  • Refactored tool creation to use dynamic discovery for type_text.
  • Updated unit tests to align with native tool discovery.

Related Issues

Closes #20983

How to Validate

  1. Run browser agent unit tests: npm test -w @google/gemini-cli-core -- src/agents/browser
  2. Verify type_text is correctly discovered from the MCP server.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • [] Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

…_text

Update chrome-devtools-mcp to version 0.18.1 to consume the native type_text functionality instead of the locally kept character-by-character equivalent. This allows simplification of the tools returned context for the browser agent directly replacing TypeTextDeclarativeTool with dynamic inclusion.
@kunal-10-cloud kunal-10-cloud requested a review from a team as a code owner March 4, 2026 22:40
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the browser agent's interaction with browser automation by upgrading the chrome-devtools-mcp dependency. This upgrade allows the system to leverage the newly available native type_text tool directly from the MCP server, eliminating the need for a previously custom-built implementation. The change streamlines the tool integration process, reduces internal code complexity, and ensures the agent benefits from the latest features and optimizations provided by the underlying browser control mechanism.

Highlights

  • Dependency Update: The chrome-devtools-mcp dependency has been updated to version 0.18.1.
  • Native type_text Tool Adoption: The custom implementation of the type_text tool has been removed and replaced with the native version now provided by the updated chrome-devtools-mcp server.
  • Code Simplification: The TypeTextInvocation and TypeTextDeclarativeTool classes, which housed the custom type_text logic, have been removed, simplifying the codebase.
  • Dynamic Tool Discovery: Tool creation has been refactored to dynamically discover type_text from the MCP server, aligning with how other native tools are handled.
  • Unit Test Alignment: Unit tests have been updated to reflect the change in type_text discovery and adjusted expected tool counts.
Changelog
  • packages/core/src/agents/browser/browserAgentFactory.test.ts
    • Added 'type_text' to the mock list of browser manager tools.
    • Adjusted expected tool counts in tests to account for 'type_text' being a standard MCP tool.
  • packages/core/src/agents/browser/browserManager.ts
    • Updated the CHROME_DEVTOOLS_MCP_VERSION constant from 0.17.1 to 0.18.1.
  • packages/core/src/agents/browser/mcpToolWrapper.test.ts
    • Modified assertions to expect 2 tools instead of 3, reflecting the removal of the custom 'type_text' tool from the dynamically discovered list.
  • packages/core/src/agents/browser/mcpToolWrapper.ts
    • Removed the TypeTextInvocation class, which implemented the custom 'type_text' logic.
    • Removed the TypeTextDeclarativeTool class, which wrapped the custom 'type_text' tool for declarative use.
    • Updated the createMcpDeclarativeTools function to no longer explicitly add the custom 'type_text' tool, relying solely on dynamically discovered MCP tools.
Activity
  • The pull request was created by kunal-10-cloud.
  • The author provided a detailed summary of changes, validation steps, and a pre-merge checklist, indicating thorough preparation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly updates the chrome-devtools-mcp dependency to version 0.18.1 and refactors the browser agent to use the native type_text tool provided by the updated MCP server. The removal of the custom TypeTextInvocation and TypeTextDeclarativeTool classes simplifies the codebase and likely improves performance. The associated test files have been updated appropriately to reflect these changes. The implementation is clean and aligns with the stated goals.

@kunal-10-cloud
Copy link
Copy Markdown
Contributor Author

kunal-10-cloud commented Mar 4, 2026

hi @jacob314, @gsquared94 please review this pr once whenever you get time, and let me know if any changes are required

@gemini-cli gemini-cli bot added the area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality label Mar 4, 2026
@gsquared94 gsquared94 self-assigned this Mar 9, 2026
@kunal-10-cloud
Copy link
Copy Markdown
Contributor Author

@gsquared94 are there any changes required here?

@gsquared94
Copy link
Copy Markdown
Contributor

gsquared94 commented Mar 10, 2026

@gsquared94 are there any changes required here?

There was a regression fixed in #21766 due to which I couldn't test this earlier. Will review again.

Can you update this test to include type_text packages/core/src/agents/browser/browserAgentFactory.test.ts?

@gemini-cli gemini-cli bot added the 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. label Mar 12, 2026
@kunal-10-cloud
Copy link
Copy Markdown
Contributor Author

kunal-10-cloud commented Mar 12, 2026

@gsquared94 are there any changes required here?

There was a regression fixed in #21766 due to which I couldn't test this earlier. Will review again.

Can you update this test to include type_text packages/core/src/agents/browser/browserAgentFactory.test.ts?

Hi @gsquared94, have added the same

@lesteral
Copy link
Copy Markdown

Fixes #20587 (also). Thank you.

@kunal-10-cloud
Copy link
Copy Markdown
Contributor Author

@gsquared94 are there any more changes required?

@lesteral
Copy link
Copy Markdown

@kunal-10-cloud - I think this has been fixed by #22213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to latest chrome-dev-tools mcp server release and use type_text tool

3 participants