mcp
AGENTS.md7.3k starsChanged 6 days agoApache-2.0View on GitHub
Browser MCP's open-source core: the MCP server and the extension's browser control, which AI apps use to drive the user's own Chrome. See README.md for how the parts fit together.
Files
AGENTS.md
Browser MCP's open-source core: the MCP server and the extension's browser control, which AI apps use to drive the user's own Chrome. See README.md for how the parts fit together.
packages/protocol(@browsermcp/protocol): the protocol between the extension and the daemon (frames, pairing, ports, close codes), and the extension IDs the daemon accepts.packages/mcp(@browsermcp/mcp): the MCP server, published to npm: the thin process each AI app runs, the daemon and its command engine. Read itsAGENTS.mdbefore changing it.packages/extension-core(@browsermcp/extension-core): browser control for a Chromium extension's background (addBrowserControl(),handleBrowserControlMessages()), a content script (@browsermcp/extension-core/content:handleFrameRemovalRequests(), which the extension declares in its manifest for<all_urls>in all frames, so it can remove other extensions' frames that block attaching, idle until the background asks) and popup (@browsermcp/extension-core/popup:useBrowserControl(),sendBrowserControlMessage()). It's source, not built: extensions bundle it.apps/extension(@browsermcp/extension): the extension people build from this repo, "Browser MCP (self-built)":extension-coreand a popup, in English. Its manifest's fixedkey(extension-key.ts) gives every build the IDSELF_BUILT_EXTENSION_ID, which the daemon accepts.
Conventions
- On its own: nothing here imports anything but these
@browsermcp/*packages and npm packages, and a fresh clone must install, typecheck, test and build. Refer to other packages by name (@browsermcp/mcp), not by path. - Protocol changes go into both sides at once: the daemon (
@browsermcp/mcp'ssrc/relay/) andextension-core. The protocol is versioned (RELAY_PROTOCOL_VERSION): each side tells the user which one to update when it meets an incompatible one. - Extensions built on
extension-corepass what they add (analytics, review prompts) as hooks (onEvent,onActivity), so browser control itself sends nothing anywhere. Its popup messages go through its ownruntime.onMessagelistener, beside any the extension has. - The popup's text: the smoke test finds the popup's elements by their English text ("Allow", "Code: …", "Connected…", "Stop", "Resume", "In use"), so keep those, or change the test with them.
- Chromium only: Firefox has no
debuggerAPI. - Tests: Vitest next to the code. Never bind or connect to ports 9009–9012 or touch
~/.browsermcp: use random ports,--portand a temporaryBROWSER_MCP_HOME, and stop only the processes a test started.
Commands
pnpm build,pnpm typecheck,pnpm test: every package.pnpm lint,pnpm format: in the public repo, Oxlint and Oxfmt withpublic-root/.oxlintrc.jsonand.oxfmtrc.json(its root files). In the private monorepo the root's configs lint and formatoss/instead, so keep the two alike (pnpm oss:export --checkruns the public ones on an export)..github/workflows/ci.ymlruns all of these in the public repo.pnpm smoke: the end-to-end smoke test (apps/extension/scripts/smoke-browser-control.ts), which builds the extension in development mode and the server, and drives the extension through the server in headless Chromium. Run it after changing browser control, the protocol or the daemon.--extension <dir>runs it against another development build (production builds ignore the fake 0.1.x server's port).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

