Skip to main content
Playwright MCP provides a unified tool for managing browser tabs. This allows you to work with multiple pages simultaneously, which is useful for workflows that require comparing content across different pages or managing multiple web applications.

browser_tabs

List, create, close, or select a browser tab.
string
required
Operation to perform. Available actions:
  • list - List all open tabs
  • create - Create a new tab
  • close - Close a tab
  • select - Switch to a specific tab
number
Tab index, used for close/select actions. If omitted for close, current tab is closed.
Read-only: No

Usage Examples

List All Tabs

Get a list of all currently open tabs with their indexes and URLs:
Response example:

Create a New Tab

Open a new blank tab:
The new tab will become the active tab. You can then use browser_navigate to navigate to a URL.

Switch to a Specific Tab

Switch to a tab by its index:
Use the list action first to see the available tab indexes before switching.

Close a Specific Tab

Close a tab by its index:

Close the Current Tab

Close the currently active tab without specifying an index:
If you close the last remaining tab, the browser context will remain open but empty. You can create a new tab to continue working.

Common Workflows

Compare Content Across Multiple Pages

  1. Navigate to the first page
  2. Create a new tab
  3. Navigate to the second page
  4. Take snapshots or screenshots of both
  5. Switch between tabs to compare

Managing Multiple Workflows

When working with multiple web applications or workflows:

Best Practices

Tab indexes can change when tabs are closed. Always use the list action to get current indexes before performing select or close operations.
Close tabs when you’re done with them to avoid confusion and reduce resource usage.
When working with multiple tabs, maintain a clear mental model or documentation of which tab contains what content.

Core Automation

Navigate and interact with pages in tabs

Page Snapshot

Capture content from different tabs