1. Conduid
  2. Agents
  3. Visual Studio MCP
MCP server · Agents

Visual Studio MCP

Connect AI agents (Claude, ChatGPT, Gemini, etc.) to Visual Studio 2022/2026. MCP server for autonomous debugging, build management, and error analysis via COM.

34Low

Scored 6 months ago · breakdown

About Visual Studio MCP

Visual Studio MCP is an MCP server in the Agents category: connect AI agents (Claude, ChatGPT, Gemini, etc.) to Visual Studio 2022/2026. MCP server for autonomous debugging, build management, and error analysis via COM.

Install

From source
git clone https://github.com/alon-mini/visual-studio-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (4)

GetErrorListReturns all errors and warnings from the Error List

Parameters not published.

GetSolutionInfoReturns current solution path and list of projects

Parameters not published.

ListOutputPanesLists all Output Window panes (Build, Debug, etc.)

Parameters not published.

ReadOutputPaneReads content from a specific pane (with truncation)

Parameters not published.

Ask AI

✦

Ask AI about Visual Studio MCP

Powered by Claude · Grounded in docs

I know everything about Visual Studio MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

Visual Studio MCP Bridge

A Model Context Protocol (MCP) server that connects AI coding assistants (like Claude) to Visual Studio 2022/2026 via COM automation.

This bridge enables AI agents to:

  • 📖 Read build output, debug logs, and error lists
  • 🔨 Build solutions and check for errors
  • 🐛 Start/stop debugging sessions
  • 📍 Inspect call stacks at breakpoints

Perfect for autonomous AI-driven development workflows where the agent can build, test, and debug without human intervention.


🚀 Quick Start

Prerequisites

  • Windows 10/11
  • .NET 8.0 SDK or higher
  • Visual Studio 2022 or 2026 (must be running)
  • Claude Desktop or another MCP-compatible client

Installation

  1. Clone and build:

    git clone https://github.com/YOUR_USERNAME/vs-mcp-bridge.git
    cd vs-mcp-bridge
    dotnet publish -c Release -f net8.0 -r win-x64 --self-contained false
    
  2. Register with Claude:

    claude mcp add vs-bridge -- "<full-path>\bin\Release\net8.0\win-x64\publish\VisualStudioMcpServer.exe"
    
  3. Open Visual Studio with any solution, then start using the tools!


🛠️ Available Tools

Information Tools

Tool Description
GetSolutionInfo Returns current solution path and list of projects
ListOutputPanes Lists all Output Window panes (Build, Debug, etc.)
ReadOutputPane Reads content from a specific pane (with truncation)
GetErrorList Returns all errors and warnings from the Error List

Build & Debug Tools

Tool Description
BuildSolution Builds the solution and returns success/error count
StartDebugging Starts debugging (F5)
StartWithoutDebugging Runs without debugger (Ctrl+F5)
StopDebugging Stops the current debug session
GetDebuggerState Returns current state (design/running/breakpoint)
GetCallStack Returns call stack when stopped at a breakpoint

🤖 Autonomous Testing Workflow

Claude can now run this autonomous development loop:

1. BuildSolution → Check for compile errors
2. If errors: GetErrorList → Analyze and fix code → Rebuild
3. If success: StartDebugging
4. GetDebuggerState → Monitor execution
5. If at breakpoint: GetCallStack → Analyze the issue
6. StopDebugging → Make fixes → Repeat

⚙️ Technical Details

COM Message Filter

Visual Studio is a single-threaded COM server. When VS is busy (building, debugging), it rejects COM calls. This bridge implements IOleMessageFilter to automatically retry rejected calls.

.NET Core Compatibility

Since Marshal.GetActiveObject was removed in .NET Core, this project uses P/Invoke to oleaut32.dll and ole32.dll for COM object retrieval.

STAThread Requirement

COM automation requires a Single-Threaded Apartment (STA). The main thread is marked with [STAThread] to ensure proper COM interop.


📋 Tool Parameters

ReadOutputPane

paneName: string   - Name (or partial name) of the pane to read
maxLines: int      - Max lines to return from end (default: 50, 0 = all)

BuildSolution

waitForBuild: bool - Wait for completion (default: true)
format: string     - Output format: "text" or "json"

GetErrorList / GetSolutionInfo / GetDebuggerState / GetCallStack

format: string     - Output format: "text" or "json"

🔧 Troubleshooting

Issue Solution
"No VS instance found" Ensure Visual Studio is running with a solution open
Tools not appearing Restart Claude after re-registering the MCP
COM errors Make sure VS isn't in a modal dialog (e.g., unsaved changes prompt)

📄 License

MIT License - see LICENSE for details.


🤝 Contributing

Contributions welcome! Feel free to open issues or PRs.

Ideas for future tools:

  • SetBreakpoint - Add/remove breakpoints programmatically
  • EvaluateExpression - Evaluate expressions in debugger context
  • OpenFile - Open specific files in VS editor
  • NavigateToError - Jump to error location

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Visual Studio MCP

How do I install Visual Studio MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Visual Studio MCP safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Visual Studio MCP still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.