Browserless MCP in VS Code
VS Code connects Copilot agent mode to the hosted Browserless MCP server through an mcp.json file. Local sessions prompt for your API token instead of storing it in plain text, while Copilot harness sessions sign in with OAuth. Once it's connected, VS Code can scrape, search, crawl, and drive a cloud browser with the Browserless MCP tools.
- A Browserless API token from your account dashboard, or a Browserless account for OAuth sign-in
- VS Code with GitHub Copilot enabled
Connect to the hosted server
The hosted server runs at https://mcp.browserless.io/mcp, so there's nothing to install.
Install in one click. VS Code opens an install prompt for the Browserless MCP server, which signs in with your Browserless account over OAuth. This works in both Local and Copilot harness sessions.
Install in VS CodeConfigure it manually. To use an API token instead, run MCP: Open User Configuration from the Command Palette to open your user-level mcp.json, or create .vscode/mcp.json in a workspace. Then add:
{
"inputs": [
{
"type": "promptString",
"id": "browserless-token",
"description": "Browserless API token",
"password": true
}
],
"servers": {
"browserless": {
"type": "http",
"url": "https://mcp.browserless.io/mcp",
"headers": {
"Authorization": "Bearer ${input:browserless-token}"
}
}
}
}
VS Code prompts for the token the first time the server starts and stores it securely, so it never sits in the file. VS Code's file uses a top-level servers key, not mcpServers.
The token prompt only works in Local sessions. VS Code doesn't forward servers that need ${input:...} values to Copilot harness sessions, even after you've entered the token locally. For those, drop the inputs and headers blocks and sign in with OAuth instead.
To use a region other than US West, add an x-browserless-api-url header, or a browserlessUrl query parameter on the server URL for clients that only take a URL. See regional endpoints.
Run the server locally
To run the MCP server process on your machine instead, use the @browserless.io/mcp npm package over stdio. You need Node.js 24 or newer. Browser work still runs on Browserless, so this is mainly for pinning a server version (add it to the package name, for example @browserless.io/mcp@1.41.0) or pointing at a self-hosted instance with BROWSERLESS_API_URL. Both setups use the server name browserless, so replace the hosted entry with this one rather than adding both.
Add to the same mcp.json:
{
"inputs": [
{
"type": "promptString",
"id": "browserless-token",
"description": "Browserless API token",
"password": true
}
],
"servers": {
"browserless": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@browserless.io/mcp"],
"env": {
"BROWSERLESS_TOKEN": "${input:browserless-token}"
}
}
}
}
Check the connection
Run MCP: List Servers from the Command Palette. browserless should be running, and you can start, restart, or open its output log from there. Then switch Copilot Chat to agent mode and open the tools picker.
FAQ & Troubleshooting
Should I add the server to settings.json instead?
Use mcp.json. Older guides, including earlier versions of this page, put an "mcp" block in settings.json, but current VS Code documentation only covers mcp.json files. Move the entry into the user-level mcp.json (MCP: Open User Configuration) or .vscode/mcp.json, under a top-level servers key.
Copilot still shows old tools after a server update
VS Code caches the tool list. Run MCP: Reset Cached Tools, then restart the server from MCP: List Servers.
The server connects but every tool call returns 401 Unauthorized
The token is missing or wrong. Copy it again from your account dashboard and check the header reads Bearer followed by the token, with no quotes or trailing whitespace inside the value. If you used an environment variable, confirm it's set in the environment the client was launched from. GUI apps started from the dock or Start menu don't see variables exported in your shell profile.
The connection fails with an SSE error like Non-200 status code (400)
The hosted server speaks Streamable HTTP only and doesn't support the legacy SSE transport. Check the client entry is using its HTTP transport (see the config above), not an SSE one.