vscode-helper
Click on "Deploy 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-helper open src/server.ts"
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 Helper
A command-line helper tool for controlling VSCode from the terminal and AI agents. This project provides both a standalone CLI interface and an MCP server for AI agent integration, enabling workspace management, file operations, and VSCode control.
Features
Smart Workspace Detection: Automatically detects active VSCode workspaces using VSCode's own status API
CLI Interface: Comprehensive command-line tool for VSCode control
JSON Output Support: Structured output for scripting and automation
File Operations: Open, create, and manage files in VSCode
Workspace Management: List, detect, and work with open VSCode workspaces
Terminal Integration: Execute commands in VSCode terminal
Search Capabilities: Search files and content across workspace
MCP Server: Full MCP server implementation for AI agent integration
Related MCP server: vscode-playwright-mcp
Installation
From Source
npm install
npm run build
npm install -g .Global Installation
npm install -g vscode-helperUsage
CLI Commands
Workspace Management
# Show current active VSCode workspace
vscode-helper workspace
# List all open VSCode workspaces
vscode-helper workspaces
# Get workspace info as JSON
vscode-helper workspace --json
vscode-helper workspaces --jsonFile Operations
# Open a file in VSCode
vscode-helper open src/server.ts
# Open file at specific line
vscode-helper open src/server.ts --line 42
# Create a new file
vscode-helper create newfile.txt --content "Hello World"
# Select/highlight file in VSCode file explorer
vscode-helper select package.json
# Reveal file in VSCode file explorer
vscode-helper reveal src/server.tsWorkspace Search
# Search for files
vscode-helper search package --type files
# Search file content
vscode-helper search "VSCode" --type content
# Get search results as JSON
vscode-helper search "error" --type content --json
# List workspace files
vscode-helper files
vscode-helper files --jsonTerminal & Navigation
# Run a terminal command
vscode-helper run "npm install"
# Focus VSCode file explorer
vscode-helper focus-explorerMCP Server
# Start MCP server for AI agent integration
vscode-helper serverKey Features
Smart Workspace Detection
The tool intelligently detects your active VSCode workspace by:
Using VSCode's built-in
code --statusAPI to get currently open workspacesPrioritizing workspaces that contain your current working directory
Falling back to workspace indicators (.git, package.json, etc.)
Using VSCode's recent workspace storage as final fallback
Context-Aware File Operations
When you run vscode-helper select package.json from any terminal location, it will find and select the package.json file in your currently active VSCode workspace, not the terminal's current directory.
JSON Output Support
Most commands support --json flag for structured output:
--jsonflag provides machine-readable output for scriptingRegular output provides human-friendly formatting
Perfect for integration with other tools and scripts
MCP Server Integration
To integrate with AI agents like Claude Code, add this server to your MCP configuration:
{
"mcpServers": {
"vscode-helper": {
"command": "vscode-helper",
"args": ["server"]
}
}
}MCP Tools Available:
open_file: Open files in VSCoderun_terminal_command: Execute terminal commandscreate_file: Create new filessearch_workspace: Search files or contentreveal_in_explorer: Reveal files in VSCode file explorerfocus_explorer: Focus the VSCode file explorer viewselect_file_in_explorer: Select/highlight files in VSCode file explorer
MCP Resources Available:
vscode://workspace/files: List workspace filesvscode://editor/content: Current editor content (requires extension)
Architecture
The project consists of:
VSCode Controller (
src/vscode-controller.ts): Core VSCode integration and workspace detection logicCLI Interface (
src/cli.ts): Command-line wrapper with argument parsingMCP Server (
src/server.ts): Handles MCP protocol communication for AI agents
Requirements
Node.js 18+
VSCode installed and accessible via
codecommandLinux/Ubuntu (primary target platform)
TypeScript for development
Development
# Install dependencies
npm install
# Build
npm run build
# Install locally for testing
npm install -g .
# Run in development
npm run dev
# Test CLI directly
npm run cli -- workspacesExamples
Working with Multiple VSCode Windows
# List all open VSCode workspaces
$ vscode-helper workspaces
Open VSCode workspaces (3):
project-a - /home/user/projects/project-a
project-b - /home/user/projects/project-b
project-c - /home/user/projects/project-c
# Get the active workspace (based on current context)
$ vscode-helper workspace
Active VSCode workspace: /home/user/projects/project-a
# Select a file in the active workspace from anywhere
$ cd /tmp
$ vscode-helper select src/main.py
Successfully selected src/main.py in VSCode file explorer (workspace: /home/user/projects/project-a)JSON Integration
# Get workspace data for scripting
$ vscode-helper workspaces --json | jq '.[].name'
"project-a"
"project-b"
"project-c"
# Search and process results
$ vscode-helper search "TODO" --type content --json | jq '.results'Limitations
Primarily designed for Linux/Ubuntu environments
Some features require VSCode to be running
Terminal integration may vary by desktop environment
MCP server mode is designed for local usage only
Contributing
This project focuses on local VSCode automation and AI agent integration. Feel free to fork and adapt for your specific needs.
Available Tools
7 toolscreate_fileB
Create a new file with content
Inputs: path (required), content (required).
focus_explorerB
Focus the VSCode file explorer view
Inputs: no named parameters.
open_fileC
Open a file in VSCode
Inputs: path (required), line.
reveal_in_explorerB
Reveal a file in VSCode file explorer
Inputs: path (required).
run_terminal_commandB
Execute a command in VSCode terminal
Inputs: command (required), cwd.
search_workspaceA
Search for files or content in workspace
Inputs: type (required), query (required).
select_file_in_explorerB
Select/highlight a file in VSCode file explorer
Inputs: path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have clearly distinct purposes, but reveal_in_explorer and select_file_in_explorer overlap significantly since both involve highlighting/selecting a file in the explorer. focus_explorer is distinct enough, but the explorer-related trio creates minor ambiguity.
All tool names follow a consistent snake_case verb_noun pattern (open_file, run_terminal_command, create_file, search_workspace). The explorer-related tools use a consistent verb_in_explorer style, making the naming predictable and coherent.
Seven tools is well-scoped for a VSCode helper covering file operations, terminal execution, workspace search, and explorer interaction. Each tool earns its place without unnecessary redundancy or bloat.
The core VSCode helper workflows are covered: opening/creating files, running terminal commands, searching the workspace, and navigating the explorer. Minor gaps exist such as editing existing files or managing open editors, but these can be worked around and the toolset is coherent for its stated purpose.
Maintenance
Related MCP Connectors
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Manage files and folders directly from your workspace. Read and write files, list directories, cre…
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to programmatically control and automate VSCode by interacting with its UI, executing commands, and inspecting the DOM structure. It supports advanced workflows like UI testing, extension development, and debugging through a standalone VSCode instance.15 npm8MIT
- AlicenseNot gradedqualityCmaintenanceGives LLMs full control over VS Code — click UI elements, type code, run commands, take screenshots, read editor state, and record GIFs.14 npmMIT
- AlicenseBqualityDmaintenanceProvides AI assistants with VS Code integration for file operations, command execution, project analysis, and development workflow automation.29MIT
- AlicenseNot gradedqualityBmaintenanceExposes a running VS Code instance to AI agents via MCP, enabling file operations, LSP diagnostics, terminal commands, Git workflows, and refactoring.23MIT