Automate your browser with AI.
Website
•
Docs
Browser MCP is an MCP server + Chrome extension that allows you to automate your browser using AI applications like VS Code, Claude, Cursor, and Windsurf.
- ⚡ Fast: Automation happens locally on your machine, resulting in better performance without network latency.
- 🔒 Private: Since automation happens locally, your browser activity stays on your device and isn't sent to remote servers.
- 👤 Logged In: Uses your existing browser profile, keeping you logged into all your services.
- 🥷🏼 Stealth: Avoids basic bot detection and CAPTCHAs by using your real browser fingerprint.
Browser MCP now supports authentication using a user-generated token (up to 64 characters). This token must be set both on the server and in the browser extension.
- On the server:
- Pass the token as a CLI argument:
--token <your-token> - Or set the environment variable:
BROWSER_MCP_AUTH_TOKEN=<your-token>
- Pass the token as a CLI argument:
- In the browser extension:
- After enabling the extension, you will be prompted to enter the same token. Enter the exact token you used for the server.
- The browser extension will send the token to the server when connecting.
- The server will only accept connections and requests from extensions that provide the correct token.
- If the token is missing or incorrect, the connection will be rejected.
Note:
- The token can be any string up to 64 characters. It is recommended to use a strong, random value.
- Keep your token secret. Anyone with access to the token can control your browser via Browser MCP.
To allow the Browser MCP Chrome extension to read your authentication token, you may need to set an environment variable for Chrome. This is especially useful if the extension is configured to read the token from your environment.
-
Open your terminal.
-
Start Chrome with the environment variable set:
BROWSER_MCP_AUTH_TOKEN=<your-token> open -a "/Applications/Google Chrome.app"
Or, if you use
google-chromefrom the command line:BROWSER_MCP_AUTH_TOKEN=<your-token> google-chrome
- Open Command Prompt (cmd.exe).
- Run:
set BROWSER_MCP_AUTH_TOKEN=<your-token> start chrome
Note: Replace
<your-token>with your actual token. This ensures Chrome (and the extension) can access the token from the environment.
To use Browser MCP with an MCP-compatible client (such as Cursor, VS Code, or other tools), add the following to your MCP client configuration file (e.g., .mcp.json or settings.json):
{
"mcpServers": {
"browsermcp": {
"command": "npx",
"args": ["@browsermcp/mcp@latest", "--token", "<your-token>"]
}
}
}- Replace
<your-token>with your chosen authentication token (up to 64 characters). - This will ensure the MCP client starts the Browser MCP server with the correct token.
The Browser MCP Chrome extension now includes an options page where you can:
- Set your authentication token (up to 64 characters).
- Set a port override (if you want to use a port other than the default 9234).
To access the options page:
- Go to
chrome://extensions/in Chrome. - Find "Browser MCP" and click "Details".
- Click "Extension options" or "Options".
- Enter your token and (optionally) the port, then save.
The extension will use these settings for all future connections.
The extension now reports its capabilities to the server and clients, including:
- Extension name and version
- Supported features:
token-auth,port-override,capabilities-report
You (or your client) can request these capabilities via a message to the extension, or they will be sent automatically after authentication.
If you want to specify a custom port, update your MCP client configuration as follows:
{
"mcpServers": {
"browsermcp": {
"command": "npx",
"args": ["@browsermcp/mcp@latest", "--token", "<your-token>", "--port", "<your-port>"]
}
}
}- Replace
<your-token>with your authentication token. - Replace
<your-port>with your chosen port (if overriding the default).
If you do not specify a port, the default (9234) will be used.
This repo contains all the core MCP code for Browser MCP, but currently cannot yet be built on its own due to dependencies on utils and types from the monorepo where it's developed.
Browser MCP was adapted from the Playwright MCP server in order to automate the user's browser rather than creating new browser instances. This allows using the user's existing browser profile to use logged-in sessions and avoid bot detection mechanisms that commonly block automated browser use.