vscode-playwright-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vscode-playwright-mcplaunch VS Code and take a screenshot of the editor"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
vscode-playwright-mcp
A VS Code-aware layer on top of @playwright/mcp. Gives LLMs full control over VS Code — click UI elements, type code, run commands, take screenshots, read editor state, and record GIFs.
Use cases:
E2E testing of VS Code extensions
Automated VS Code workflows and tasks
AI-driven code editing and refactoring
Interactive demos and tutorials
Testing themes, keybindings, and settings
How It Works
Built on top of @playwright/mcp, which provides generic Electron automation (click, type, screenshot, etc.). We add a VS Code-specific layer: isolated launch with temp user-data-dir, command palette automation, editor state scraping, and Monaco-aware tools.
Generic tools from @playwright/mcp are aliased to vscode_* names for a unified LLM experience. Before vscode_launch, only 1 tool is visible (lazy discovery saves ~10k context tokens). After launch, all 26 tools appear.
Related MCP server: VSCode Automation MCP
Requirements
Node.js >= 22
VS Code installed locally (auto-detected on macOS and Linux)
Quick Start
{
"mcpServers": {
"vscode": {
"command": "npx",
"args": ["-y", "vscode-playwright-mcp"]
}
}
}Custom VS Code binary:
{
"mcpServers": {
"vscode": {
"command": "npx",
"args": ["-y", "vscode-playwright-mcp", "--vscode-path", "/path/to/code"]
}
}
}Tools
Lifecycle
Tool | Description |
| Launch an isolated VS Code instance. Options: workspace, extensions, viewport size, settings. |
| Close VS Code and clean up temp files/processes. |
Vision (aliased from @playwright/mcp)
Tool | Description |
| Full-window screenshot. |
| Accessibility tree with |
| Cropped screenshot of a specific region (native — Monaco-aware). |
| Search a11y tree by role/name, returns refs (native). |
Mouse & Keyboard (aliased from @playwright/mcp)
Tool | Description |
| Click by ref, element description, or coordinates. |
| Type text into focused element. |
| Press key combinations (e.g., |
| Hover to reveal tooltips. |
| Drag from one point to another. |
| Click at exact pixel coordinates. |
| Hover at exact pixel coordinates. |
| Drag between exact pixel coordinates. |
| Select from dropdown/combobox. |
| Fill form inputs. |
VS Code Commands (native)
Tool | Description |
| Execute a VS Code command via Command Palette automation. |
| Open and activate a file by path with verification. |
State (native)
Tool | Description |
| Read editor state: active file, cursor, diagnostics, completions, peek widget. |
| Read hover tooltip content as text. |
Advanced (mixed)
Tool | Description |
| Run JavaScript in the VS Code renderer process (aliased). |
| Wait for selector state, text, or delay (aliased). |
| Retrieve console messages from renderer (aliased). |
| Resize the VS Code window and viewport (native). |
| Scroll up/down by amount (native). |
| Record actions as animated GIF (native). |
Interaction Strategies
Ref-based (preferred for UI):
vscode_snapshot→ see[ref=eN]annotations →vscode_click(ref="e5"). Deterministic, no coordinate guessing.Keyboard-first (preferred for navigation):
vscode_snapshot→ see shortcuts →vscode_press_key. Fastest for commands.Visual (required for editor content): Monaco editor is opaque to accessibility APIs.
vscode_screenshotorvscode_zoom→ read the image →vscode_click_xy(x, y).
How is this different from Playwright MCP?
This project is built on top of @playwright/mcp, not a replacement. Playwright MCP provides generic Electron automation. We add:
Isolated VS Code launch with temp user-data-dir, suppressed Welcome tab, settings injection
Command palette automation (
vscode_run_command) — execute commands by nameEditor state scraping (
vscode_get_state) — cursor, diagnostics, completions, peek widgetMonaco-aware tools (
vscode_zoom,vscode_find_element) — the editor is invisible to generic a11y toolsLazy tool discovery — 1 tool visible before launch, all ~26 after (saves context tokens)
GIF recording of VS Code sessions
Development
npm run build # Build with tsup
npm run dev # Build in watch mode
npm test # Run unit tests (vitest)
npm run test:integration # Run integration tests (requires VS Code)
npm run test:e2e # Run E2E tests (full MCP protocol loop)
npm run typecheck # Type-check with tsc
npm run lint # Lint with ESLintLicense
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mykhlv/vscode-playwright-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server