VsDebugMcp Bridge让 AI Agent 看见并使用你正在运行的 Visual Studio。 VsDebugMcp Bridge 通过 MCP 将本地 Visual Studio 2026 / Visual Studio 18.x 的解决方案上下文、构建流程、错误信息和输出窗口连接到外部 AI Agent。
不再让 Agent 猜测 Visual Studio 的状态当代码真正由 Visual Studio、MSBuild、MSVC 或解决方案配置驱动时,仅访问工作区文件并不足以回答这些问题:
VsDebugMcp Bridge 为这些问题提供一条本机 MCP 通道,让 Agent 使用 Visual Studio 的真实状态,而不是根据文件和命令行结果进行猜测。
你可以做什么发现 Visual Studio 上下文
控制真实的 Visual Studio 构建
把构建结果交给 Agent
* 安全地处理多个实例每个 Visual Studio 进程都会注册独立的 当前 MCP 工具
五分钟开始使用1. 安装扩展安装 VsDebugMcp Bridge VSIX,然后重启 Visual Studio。 2. 打开解决方案在 Visual Studio 中打开需要交给 Agent 使用的解决方案。VSIX 加载后会自动启动随扩展打包的 self-contained Host,无需单独安装或手动运行 Host。 3. 配置 MCP 客户端
4. 验证连接让 Agent 依次调用:
如果工具定义刚刚发生变化,请重新加载 MCP 客户端,使其重新发现工具。 一个典型工作流
Build task 状态保存在 Visual Studio Bridge 中,不依赖单次 MCP 请求或 Named Pipe 连接的生命周期。 工作原理
本机优先的安全边界
当前状态
这是一个 Early Access 项目,工具接口和能力可能随着验证结果继续调整。 后续方向在保持本机安全边界和显式状态 handle 的前提下,后续阶段计划验证:
暂不考虑:
这些项目代表计划方向,不表示当前版本已经提供,也不承诺具体发布日期。 要求
常见问题是否需要单独安装 .NET 或启动 Host?不需要。VSIX 包含 可以连接另一台计算机上的 Visual Studio 吗?不可以。VsDebugMcp Bridge 有意限制为本机使用。 为什么
|
| Workflow | Tools |
|---|---|
| Health and discovery | vs_health, vs_capabilities |
| Instance discovery | vs_list_instances, vs_find_instances |
| Solution context | vs_get_projects_in_solution |
| Build lifecycle | vs_run_build, vs_get_build_status, vs_cancel_build |
| Diagnostics and output | vs_get_errors, vs_get_output_window_logs |
Get started in five minutes
1. Install the extension
Install the VsDebugMcp Bridge VSIX, then restart Visual Studio.
2. Open a solution
Open the solution you want the agent to use. When the VSIX loads, it automatically starts the packaged self-contained Host. There is no separate Host installation or manual startup step.
3. Configure your MCP client
{
"servers": {
"vs-debug-mcp": {
"type": "http",
"url": "http://127.0.0.1:43260"
}
},
"inputs": []
}
4. Verify the connection
Ask the agent to call:
vs_healthvs_list_instancesvs_capabilitiesvs_get_projects_in_solution
Reload the MCP client after tool definitions change so it can discover the updated tools.
A typical workflow
Discover Visual Studio instances
→ select a vsInstanceId
→ read solution projects
→ start a build with the active configuration
→ poll status using buildTaskId
→ read Build Output
→ continue with the real compiler result
Build task state lives in the Visual Studio Bridge and does not depend on the lifetime of an individual MCP request or Named Pipe connection.
How it works
MCP Client / AI Agent
→ Streamable HTTP on 127.0.0.1:43260
→ Shared VsDebugMcp.Host
→ vsInstanceId Registry and Router
→ Per-instance Named Pipe RPC
→ Visual Studio VSIX Bridge
→ Visual Studio
- MCP clients use one stable local URL.
- One Host is shared per Windows user, while each Visual Studio instance has a separate Bridge pipe.
- The VSIX sends a heartbeat every 5 seconds; the Host removes an instance after 15 seconds without a heartbeat.
- The Host exits after the final Visual Studio instance is removed.
Local-first security boundary
- HTTP binds only to IPv4 loopback
127.0.0.1:43260 - Host control and Bridge pipes are restricted to the current Windows user
- No external network binding or remote Visual Studio access
- No arbitrary command execution, process control, or file editing in the current release
- Logs must not contain request payloads, credentials, environment variables, or raw Visual Studio Copilot logs
Current status
| Status | Capabilities |
|---|---|
| End-to-end validated | Automatic Host startup, MCP tool discovery, multi-instance routing, project discovery, build start/status/cancel, Build Output |
| Implemented, still under validation | Error Table build diagnostics |
| Not available yet | Debugger, tests, file read/search/edit, remote access, general process control |
This is an Early Access project. Tool contracts and capabilities may evolve as validation continues.
Roadmap
Future validation tracks include:
- File reading and code search
- Test discovery and test execution
- Debug sessions, threads, call stacks, breakpoints, and expression evaluation
- Broader IDE diagnostics and output providers
These are planned directions, not features available in the current release, and no delivery dates are promised.
Requirements
- Visual Studio 2026 / Visual Studio 18.x
- An MCP client with Streamable HTTP support
- Windows
win-x64 - IPv4 loopback and local Named Pipe communication
FAQ
Do I need to install .NET or start the Host separately?
No. The VSIX packages a win-x64 self-contained Host and ensures that it is running when Visual Studio loads the extension.
Can it connect to Visual Studio on another computer?
No. VsDebugMcp Bridge is intentionally local-only.
Why can vs_get_errors return diagnostics_unavailable?
Some project systems display compiler errors in Build Output without exposing them through the public Visual Studio Error Table data source currently available to the extension. Use vs_get_output_window_logs to retrieve the raw build output.
What happens if port 43260 is already in use?
The Host fails safely instead of selecting an unpredictable port or terminating the process that owns it.