Skip to content

Commit a9432bd

Browse files
committed
docs: update README with multi-session usage and session tools
1 parent 46e2caf commit a9432bd

1 file changed

Lines changed: 54 additions & 3 deletions

File tree

README.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Chrome DevTools for reliable automation, in-depth debugging, and performance ana
1111

1212
## Key features
1313

14+
- **Multi-session support**: Run multiple isolated Chrome instances simultaneously,
15+
each identified by a unique `sessionId`. Perfect for parallel testing, A/B
16+
comparisons, and multi-account workflows.
1417
- **Get performance insights**: Uses [Chrome
1518
DevTools](https://github.com/ChromeDevTools/devtools-frontend) to record
1619
traces and extract actionable performance insights.
@@ -344,15 +347,22 @@ Check the performance of https://developers.chrome.com
344347

345348
Your MCP client should open the browser and record a performance trace.
346349

350+
> [!IMPORTANT]
351+
> All tools require a `sessionId` parameter. You must call `create_session` first to obtain one. The returned `sessionId` must be passed to every subsequent tool call.
352+
347353
> [!NOTE]
348-
> The MCP server will start the browser automatically once the MCP client uses a tool that requires a running browser instance. Connecting to the Chrome DevTools MCP server on its own will not automatically start the browser.
354+
> Each session launches an isolated Chrome instance. Multiple sessions can run simultaneously for parallel testing. Use `list_sessions` to see active sessions and `close_session` to clean up when done.
349355
350356
## Tools
351357

352358
If you run into any issues, checkout our [troubleshooting guide](./docs/troubleshooting.md).
353359

354360
<!-- BEGIN AUTO GENERATED TOOLS -->
355361

362+
- **Session management** (3 tools)
363+
- [`create_session`](docs/tool-reference.md#create_session)
364+
- [`list_sessions`](docs/tool-reference.md#list_sessions)
365+
- [`close_session`](docs/tool-reference.md#close_session)
356366
- **Input automation** (8 tools)
357367
- [`click`](docs/tool-reference.md#click)
358368
- [`drag`](docs/tool-reference.md#drag)
@@ -527,10 +537,51 @@ You can also run `npx chrome-devtools-mcp@latest --help` to see all available co
527537

528538
## Concepts
529539

540+
### Multi-session support
541+
542+
The Chrome DevTools MCP server supports running multiple Chrome browser sessions simultaneously. Each session is an isolated Chrome instance with its own pages, cookies, and state.
543+
544+
#### Workflow
545+
546+
1. **Create a session** — call `create_session` to launch a new Chrome instance. You receive a unique `sessionId`.
547+
2. **Use tools** — pass the `sessionId` to every tool call (`click`, `navigate_page`, `take_screenshot`, etc.).
548+
3. **Close the session** — call `close_session` when done to shut down the Chrome instance and free resources.
549+
550+
```
551+
# Step 1: Create two sessions
552+
create_session(label="desktop", viewport="1920x1080") → sessionId: "a1b2c3d4"
553+
create_session(label="mobile", viewport="375x812", headless=true) → sessionId: "e5f6g7h8"
554+
555+
# Step 2: Use tools with the session ID
556+
navigate_page(sessionId="a1b2c3d4", url="https://example.com")
557+
navigate_page(sessionId="e5f6g7h8", url="https://example.com")
558+
take_screenshot(sessionId="a1b2c3d4")
559+
take_screenshot(sessionId="e5f6g7h8")
560+
561+
# Step 3: Clean up
562+
close_session(sessionId="a1b2c3d4")
563+
close_session(sessionId="e5f6g7h8")
564+
```
565+
566+
#### Session parameters
567+
568+
| Parameter | Type | Description |
569+
| ---------- | ------- | ---------------------------------------------------------- |
570+
| `headless` | boolean | Run in headless (no UI) mode. Default: `false`. |
571+
| `viewport` | string | Initial viewport size, e.g. `"1280x720"`. |
572+
| `label` | string | Human-readable label, e.g. `"login-test"`. |
573+
| `url` | string | URL to navigate to after creation. Default: `about:blank`. |
574+
575+
#### Session isolation
576+
577+
- Each session uses a temporary user data directory that is automatically cleaned up when the session closes.
578+
- Sessions do not share cookies, localStorage, or any browser state.
579+
- Operations within a session are serialized (mutex-protected), but different sessions run in parallel.
580+
- If a browser disconnects unexpectedly, the session is automatically purged.
581+
530582
### User data directory
531583

532-
`chrome-devtools-mcp` starts a Chrome's stable channel instance using the following user
533-
data directory:
584+
When connecting to a running Chrome instance (via `--browser-url` or `--autoConnect`), Chrome uses the following user data directory:
534585

535586
- Linux / macOS: `$HOME/.cache/chrome-devtools-mcp/chrome-profile-$CHANNEL`
536587
- Windows: `%HOMEPATH%/.cache/chrome-devtools-mcp/chrome-profile-$CHANNEL`

0 commit comments

Comments
 (0)