Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,9 @@ Check the performance of https://developers.chrome.com

> [!NOTE]
> The <code>autoConnect</code> option requires the user to start Chrome. If the user has multiple active profiles, the MCP server will connect to the default profile (as determined by Chrome). The MCP server has access to all open windows for the selected profile.
>
> [!NOTE]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please revert unrelated changes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

okay

> Network requests that occurred before the MCP server connected are not available via <code>list_network_requests</code> / <code>get_network_request</code>. If you need those, start the MCP server first or reload the page after it connects.

The Chrome DevTools MCP server will try to connect to your running Chrome
instance. It shows a dialog asking for user permission.
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ export async function createMcpServer(
? context.getPageById(params.pageId)
: context.getSelectedMcpPage();
response.setPage(page);
if (page.getDialog() && tool.name !== 'handle_dialog') {
throw new Error(
'A browser dialog is open. Call handle_dialog to accept or dismiss it before continuing.',
);
}
await tool.handler(
{
params,
Expand Down