Fire in da houseTop Tip:Most people pay up to $340 per month for Perplexity, MidJourney, Runway, ChatGPT, and more - but you can get them all your AI tools for $15 with Galaxy. It's free to test!Fire in da houseCheck it out

vscode-as-mcp-server

MCP.Pizza Chef: acomagu

vscode-as-mcp-server is a VSCode extension that transforms Visual Studio Code into an MCP server, exposing features like file viewing, code editing with real-time LLM feedback, terminal command execution, and URL previewing. It enables advanced AI-assisted coding workflows by integrating with MCP clients such as Claude Desktop, allowing seamless interaction with code diffs, diagnostics, and terminal operations directly from AI tools.

Use This MCP server To

Review and accept or reject LLM-proposed code changes via diffs Send real-time diagnostic messages to LLMs for immediate code corrections Execute commands in VSCode's integrated terminal with control over execution mode Preview URLs within VSCode's built-in browser for live web app previews Enable AI tools to interact with VSCode files and terminal for enhanced coding workflows

README

VSCode as MCP Server

Marketplace

A VSCode extension that turns your VSCode into an MCP server, enabling advanced coding assistance from MCP clients like Claude Desktop.

Key Features

Code Editing Support

  • Review proposed code changes from an LLM through diffs, allowing you to accept, reject, or provide feedback.
  • Real-time diagnostic messages (e.g., type errors) sent instantly to the LLM for immediate corrections.

Code editing diff

Terminal Operations

  • Execute commands within VSCode’s integrated terminal (supports background/foreground execution, and timeout settings).

Preview Tools

  • Preview URLs directly within VSCode’s built-in browser (e.g., automatically opens browser preview after starting a Vite server).

Preview tool

Multi-instance Switching

  • Easily switch the MCP server between multiple open VSCode windows.(Just by clicking the status bar item)

Instance switching

Relay Functionality (Experimental)

  • Relay and expose built-in MCP servers introduced in VSCode 1.99 externally.
  • Allows external access to tools provided by other MCP extensions, such as GitHub Copilot.

Available Built-in Tools

  • execute_command: Execute commands in VSCode’s integrated terminal
  • code_checker: Retrieve current diagnostics for your code
  • focus_editor: Focus specific locations within files
  • list_debug_sessions / start_debug_session / restart_debug_session / stop_debug_session: Manage debug sessions
  • text_editor: File operations (view, replace, create, insert, undo)
  • list_directory: List directory contents in a tree format
  • get_terminal_output: Fetch output from a specified terminal
  • list_vscode_commands / execute_vscode_command: List and execute arbitrary VSCode commands
  • preview_url: Open URLs within VSCode’s integrated browser

Installation & Setup

  1. Install the extension from the VSCode Marketplace.

  2. Configure your MCP client:

    • Using mcp-installer: You can simply instruct it to "install the vscode-as-mcp-server MCP server".
    • Other clients like Claude Desktop: Add the following to your configuration file (claude_desktop_config.json):
    {
      "mcpServers": {
        "vscode": {
          "command": "npx",
          "args": ["vscode-as-mcp-server"]
        }
      }
    }
  3. Check the MCP server status in the bottom-right VSCode status bar:

    • (Server icon): Server is running
    • ∅: Click to start the server

Server status indicator

Motivation

This extension was developed to mitigate high costs associated with metered coding tools (like Roo Code and Cursor). It's an affordable, self-hosted alternative built directly into VSCode.

Bug reports and feedback are very welcome! 🙇

Future Roadmap

  • Ability to select which built-in MCP servers to expose
  • WebView-based approval UI (similar to Roo Code)
  • Integration with VSCode's file history (Timeline)
  • Instant toggling of auto-approvals and tool activation/deactivation
  • Customizable server port configuration

vscode-as-mcp-server FAQ

How do I install vscode-as-mcp-server?
Install it as a VSCode extension from the Visual Studio Marketplace and enable it to start the MCP server functionality.
Can vscode-as-mcp-server handle real-time code diagnostics?
Yes, it sends real-time diagnostic messages like type errors to connected LLMs for immediate feedback and corrections.
Does this MCP server support terminal command execution?
Yes, it supports executing commands in VSCode's integrated terminal, including background and foreground modes with timeout settings.
How does vscode-as-mcp-server integrate with AI clients?
It exposes VSCode features as MCP endpoints, allowing clients like Claude Desktop to interact with files, code diffs, terminal, and previews.
Can I preview web URLs inside VSCode using this server?
Yes, it supports previewing URLs directly within VSCode's built-in browser, useful for live web app previews.
Is vscode-as-mcp-server limited to any specific LLM providers?
No, it is provider-agnostic and works with various LLMs including OpenAI, Claude, and Gemini.
What kind of feedback can I provide on code changes?
You can accept, reject, or provide detailed feedback on LLM-proposed code diffs directly through the MCP interface.
Does it support multi-step interactions with the code environment?
Yes, it enables multi-step reasoning by allowing LLMs to see real-time code state, diagnostics, and terminal outputs for complex workflows.