Main components
Tool execution path
Every MCP tool call follows the same high-level path:- The MCP client sends a JSON-RPC
tools/call. - The server acquires a mutex so shared browser state is not mutated concurrently.
- Zod validates the input schema.
- The active session and page are resolved unless the tool does not require a session.
- The tool handler runs browser work through Playwright, CDP, or both.
- The page snapshot cache is invalidated if the DOM changed.
- The result is returned as text, image, or mixed MCP content.
Playwright and CDP
StableBrowse uses both Playwright and Chrome DevTools Protocol:
This split gives agents a human-readable page model while still allowing precise actions on real browser nodes.
Snapshot refs
Thesnapshot tool extracts the accessibility tree and assigns stable refs like [ref=e12] to interactive elements.
Those refs are consumed by:
clickfillfill_forminteract.hoverinteract.select_optioninteract.draginteract.upload_filescreenshotfor element screenshots
Why compound tools exist
The implementation contains many browser operations, but the MCP surface exposes 17 tools:- direct tools for the common fast path
- compound tools for action families
storage tool with actions.
Knowledge graphs
Theknowledge tool lets agents consult bundled site knowledge before broad exploration. It can return:
- indexed sites
- relevant page nodes, regions, actions, and selectors
- known flow graphs
- deterministic site strategies, such as Amazon product extraction
Safety and isolation
Browser MCP is designed for controlled automation:- each session has isolated browser context state
- optional persistent profiles can preserve login state
- proxies and fingerprints can be set per session
- session/page limits prevent unbounded browser growth
- all parameters are schema-validated
- tool calls are serialized to avoid race conditions
HTTP mode
HTTP mode exposes:
Use HTTP mode when the MCP server needs to run as a local service or inside an environment where stdio is not convenient.
Hosted HTTP deployments should run with DynamoDB API-key auth enabled. The server hashes the incoming bearer key, looks it up in the StableBrowse API-key table, rejects revoked keys, and binds the MCP session to the authenticated business.
