Skip to content
Back to search

vscode-browser-mcp

Lets Claude Code (or any MCP client) use VS Code's built-in browser, through one MCP server shared by every VS Code window

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/gerbillinae--vscode-browser-mcp/badge.svg)](/listings/gerbillinae--vscode-browser-mcp)

HTML

<a href="/listings/gerbillinae--vscode-browser-mcp"><img src="/api/listings/gerbillinae--vscode-browser-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install the `.vsix` (see Build), then reload VS Code. On start the extension adds this to Claude Code's user config, `~/.claude.json`, if it isn't there already:

"mcpServers": { "vscode-browser": { "type": "http", "url": "http://127.0.0.1:3799/mcp" } }

Turn that off with `browserMcp.configureClaude`, or run **Browser MCP: Register with Claude Code** to do it by hand. Start a new Claude Code session afterwards. Claude Code connects when a session starts, so VS Code must already be running.

Settings: `browserMcp.port` (default 3799; every window must use the same one) and `browserMcp.configureClaude` (default on).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 93 lines
  1. # Browser MCP for VS Code
  2. Lets Claude Code, or any MCP client, use the browser built into VS Code:
  3. open pages, read them, take screenshots, click, type and run JavaScript. You
  4. watch it happen in your editor, in a browser that has your cookies and
  5. reaches your localhost.
  6. Every VS Code window runs the extension, and they share one MCP server at
  7. `http://127.0.0.1:3799/mcp`, so a single config entry reaches every window.
  8. ## How it works
  9. ```
  10. Claude Code ──HTTP MCP──▶ hub window (holds port 3799) ──▶ its browser
  11. │
  12. └─WebSocket /peer─▶ other windows ──▶ their browsers
  13. ```
  14. - **Election.** Each window tries to bind the port. The one that succeeds is
  15. the hub: it serves MCP at `/mcp`. The others join it at `/peer` and run the
  16. calls it forwards. When the hub window closes, the rest run the election
  17. again; one becomes the new hub and the others rejoin it. MCP sessions on
  18. the old hub end, and clients start new ones.
  19. - **Which window a call goes to**, in order:
  20. 1. the `window` argument, by name or id (`browser_windows` lists them);
  21. 2. the window whose workspace folder holds the client's
  22. [roots](https://modelcontextprotocol.io/specification/latest/client/roots)
  23. (Claude Code's working directory), the deepest folder first;
  24. 3. the window you focused most recently.
  25. Every result starts with the window used and why.
  26. - **The browser** is VS Code's integrated browser, launched through an
  27. `editor-browser` debug session (VS Code 1.112+, built-in JavaScript
  28. debugger) whose `requestCDPProxy` gives a Chrome DevTools Protocol socket.
  29. One browser tab per window; `browser_open` opens it when it is closed.
  30. ## Tools
  31. | Tool | |
  32. |---|---|
  33. | `browser_windows` | The windows, and which one is the default for you |
  34. | `browser_open` | Open a URL and wait for it to load |
  35. | `browser_screenshot` | PNG of the visible page, or `fullPage` |
  36. | `browser_read` | The page's text, accessibility tree, or HTML |
  37. | `browser_click` | By CSS selector or by visible text |
  38. | `browser_type` | Into an input; optionally `clear` first and `submit` with Enter |
  39. | `browser_eval` | A JavaScript expression's value, as JSON |
  40. | `browser_console` | Recent console messages and uncaught exceptions |
  41. ## Setup
  42. Install the `.vsix` (see Build), then reload VS Code. On start the
  43. extension adds this to Claude Code's user config, `~/.claude.json`, if it
  44. isn't there already:
  45. ```json
  46. "mcpServers": { "vscode-browser": { "type": "http", "url": "http://127.0.0.1:3799/mcp" } }
  47. ```
  48. Turn that off with `browserMcp.configureClaude`, or run **Browser MCP:
  49. Register with Claude Code** to do it by hand. Start a new Claude Code
  50. session afterwards. Claude Code connects when a session starts, so VS Code
  51. must already be running.
  52. Settings: `browserMcp.port` (default 3799; every window must use the same
  53. one) and `browserMcp.configureClaude` (default on).
  54. ## Security
  55. - Everything listens on `127.0.0.1` only.
  56. - Requests whose `Host` isn't `127.0.0.1:<port>` or `localhost:<port>` are
  57. refused (DNS rebinding), and so are requests with an `Origin` header (web
  58. pages). MCP clients and windows send neither.
  59. - Windows join the hub only with the secret in
  60. `~/.vscode-browser-mcp/secret`, which the first window creates.
  61. - The MCP endpoint has no token: any program running as you can use it, as
  62. with any local MCP server. `browser_eval` runs any JavaScript in the open
  63. page, which is logged in as you wherever your browser is.
  64. ## Build
  65. Needs Node 22.18+ (for running TypeScript tests directly).
  66. ```sh
  67. npm install
  68. npm test # hub, peers, routing, security, config, with fake windows
  69. npm run package # type-check, bundle, and write vscode-browser-mcp-<version>.vsix
  70. code --install-extension vscode-browser-mcp-0.1.0.vsix
  71. ```
  72. `src/` splits into the parts with no VS Code dependency, tested in plain
  73. Node (`protocol`, `routing`, `hub`, `node`, `tools`, `page`, `cdp`,
  74. `claude-config`), and the two that need VS Code (`browser`, `extension`).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.