Skip to content

list_pages tool breaks in v0.19.0 when used after closing the selected page #1138

@acotto-san

Description

@acotto-san

Hi, I'm experiencing an issue with the list_pages tool in the latest version (v0.19.0) of chrome-devtools-mcp.

Tool

  • list_pages
  • Description: Get a list of pages open in the browser.
  • Parameters: None

Steps to reproduce

  1. Call list_pages to get the initial list of open pages.
  2. Close the selected page.
  3. Call list_pages again.

Test script used

tests/integration/test_chrome_devtools_mcp_client.py:63

async def test_should_return_list_of_pages_after_closed_selected_page(self):
    """Test that we can call the list_pages tool and get a response."""
    try:
        # first call to ensure the page list is populated
        first_try = await self.mcp_session.call_tool("list_pages", {})
        print("First try result:", first_try.content[0].text)

        # here I close the selected page
        time.sleep(3)

        second_try = await self.mcp_session.call_tool("list_pages", {})
        print("Second try result:", second_try.content[0].text)

    except Exception as e:
        raise e

Output

First try result: ## Pages
1: https://www.google.com/ [selected]
2: https://www.youtube.com/
Second try result: The selected page has been closed. Call list_pages to see open pages.

Expected

After closing the selected page, list_pages should return the updated list of open pages.

Actual

It returns:
The selected page has been closed. Call list_pages to see open pages.

Environment

  • chrome-devtools-mcp: v0.19.0 (Latest)
  • MCP client: ClientSession from mcp 1.25.0

MCP configuration

npc -y chrome-devtools-mcp@latest --experimental-interop-tools --autoConnect

Chrome DevTools MCP version

0.19.0

Chrome version

145.0.7632.160 (arm64)

Coding agent version

manually tested

Model version

manually tested

Chat log

No response

Node version

24.8.0

Operating system

macOS

Extra checklist

  • I want to provide a PR to fix this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions