豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Feature request: Multi-session support for parallel browser instances #926

@RobertWsp

Description

@RobertWsp

Problem

The current MCP server binds to a single Chrome instance for its entire lifetime. This means any MCP client (AI agent, test runner, automation script) can only interact with one browser at a time. To work with multiple browsers, users must start multiple MCP server processes and manage them externally.

Use Cases

1. AI agents researching multiple sources in parallel

This is the most natural use case given that the MCP server is designed for LLM integration. AI agents frequently need to:

  • Open multiple documentation sites simultaneously to cross-reference information
  • Search across different sources (GitHub, Stack Overflow, official docs) in parallel rather than sequentially
  • Compare content across multiple URLs without losing page state

Today, the agent must navigate away from one page to visit another, losing all context. With multiple sessions, it can keep all pages alive and switch between them.

2. Multi-user interaction testing

Testing real-time collaborative features requires simulating multiple users:

  • Chat applications: User A sends a message, verify User B receives it
  • Collaborative editing: Two users editing the same document simultaneously
  • Multiplayer flows: Testing turn-based or real-time interactions

Each user needs their own isolated browser with separate cookies, auth state, and session storage.

3. Authenticated vs unauthenticated comparison

Common debugging workflow:

  • Session A: Logged in as admin
  • Session B: Logged in as regular user
  • Session C: Not logged in

Compare how the same page renders across different auth states without logging in/out repeatedly.

4. CI/CD parallel test execution

A single MCP server could serve multiple test runners in a CI pipeline, each getting its own isolated browser. This avoids the overhead of spawning N separate MCP server processes and N separate Chrome instances managed externally.

5. Cross-viewport testing

Simultaneously test the same page across different viewport configurations:

  • Desktop (1920×1080)
  • Tablet (768×1024)
  • Mobile (375×812)

Each session runs with its own viewport settings, enabling side-by-side responsive testing.

Proposed API

A minimal approach:

Tool Purpose
create_session Launch a new Chrome instance, returns a unique sessionId
list_sessions List active sessions with metadata
close_session Shut down a specific session

All existing tools would accept an optional sessionId parameter. If omitted, a default/single session is used (fully backward compatible).

Prior Art

I have a working implementation in PR #899 that demonstrates this approach. Happy to iterate on the design based on feedback from this discussion.

Questions for Maintainers

  • Are there specific use cases above that resonate more with your roadmap?
  • Would you prefer a different API shape (e.g., session as a resource rather than a tool parameter)?
  • Any concerns about resource management (max sessions, TTL, cleanup) that should be addressed upfront?

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions