VSCode Context MCP
@vilasone455
MCP Server to Connect with VS Code IDE
概要
What is VSCode Context MCP?
VSCode Context MCP is a Model Context Protocol (MCP) server that bridges AI assistants with your VSCode environment. It gives AI models access to current VSCode context (active files, open tabs, terminal output, diagnostics), enables filesystem operations with controls, and allows shell command execution in a controlled way. It is designed for developers who want context-aware AI help during software development.
How to use VSCode Context MCP?
Install the VSCode extension from the provided VSIX package, then build the server with npm install && npm run build. Configure Claude Desktop to invoke the built server via a JSON entry. After setup, prompt an MCP‑compatible assistant like Claude to use VSCode context (e.g., “Check my current VSCode project and tell me what files I have open”). Files can also be added to context using keyboard shortcuts or the command palette.
Key features of VSCode Context MCP
- Access current project path and active file details.
- List open editor tabs and retrieve diagnostics (errors/warnings).
- Fetch terminal output and attached workspace files.
- Read, write, edit, create, move, and search files.
- Run shell commands with output capture in a controlled environment.
Use cases of VSCode Context MCP
- AI assistant understands your active code context to make relevant suggestions.
- Debug issues by giving the assistant access to terminal output and diagnostics.
- Perform file operations (read, edit, create) on your behalf without switching contexts.
- Generate directory trees or search for files to help navigate large projects.
FAQ from VSCode Context MCP
What security precautions should I take?
Be careful what commands you ask the server to run. In Claude Desktop, use “Approve Once” instead of “Allow for This Chat” so you can review each action. Deny any command you don’t trust. The server does not yet implement comprehensive security measures.
What prerequisites are needed to run VSCode Context MCP?
You need Node.js installed, the VSCode extension set up, and an MCP‑compatible assistant (e.g., Claude Desktop) configured to point to the built server. It is recommended to uninstall similar MCP servers (like filesystem MCP) beforehand to avoid conflicts.
How do I add files to Claude context?
You can add the current file by pressing Ctrl+L (Cmd+L on macOS) or add only selected text with Ctrl+I (Cmd+I). Alternatively, open the command palette and search for “Add File to Context” or “Add Selection to Context”.
Does the server support multiple VSCode projects at once?
According to the roadmap, support for multiple VSCode projects is planned but not yet implemented. Currently it works with a single project.
Where does the context data come from?
All context data (active file, tabs, terminal, diagnostics) is retrieved from your local VSCode environment. The server uses the VSCode extension to access this information and does not send data to external services.