Repository navigation
Description
Epic: STDIO Transport Support (Broker + Shim Architecture)
Add STDIO transport support and multi-instance VS support via a central Broker and lightweight STDIO Shim.
Summary
A central Broker.exe manages multiple VS instances — each Server.exe registers with the broker on startup, and the broker transparently proxies MCP tool calls to the correct instance. A lightweight Shim.exe bridges MCP STDIO transport to the broker's HTTP/SSE endpoint, enabling Claude Desktop and Claude Code integration. Existing Server.exe and VS Extension core plumbing remain largely unchanged.
Key insight: Instead of inverting the pipe architecture (original plan), a broker + shim approach solves both STDIO transport (#18) and multi-instance support (#54) with minimal changes to existing code.
Architecture
```
┌──────────────┐ ┌──────────────┐
│ VS Instance 1│ │ VS Instance 2│
│ Server.exe │ │ Server.exe │
│ (port: auto) │ │ (port: auto) │
└──────┬───────┘ └──────┬───────┘
│ register │ register
▼ ▼
┌─────────────────────────────────────┐
│ Broker.exe │
│ HTTP/SSE on port 5100 (default) │
│ MCP tools: list_instances, │
│ select_instance │
│ Transparent proxy to selected │
│ instance's Server.exe │
│ Health checks (15s interval) │
│ 30s shutdown timer after last VS │
└──────────┬──────────────────────────┘
│
┌─────┴──────┐
▼ ▼
HTTP client Shim.exe
(:5100/sse) (STDIO → :5100)
▲
│ spawns
Claude Desktop/Code
```
Design Decisions
| Decision | Choice |
|---|---|
| Broker binary | Separate Broker.exe |
| Instance identity | Solution path + directory + display name + PID |
| Routing | One connection = one instance |
| Instance matching | Auto-match by working directory, fallback to list |
| Broker lifecycle | Timeout 30s after last VS, then exit |
| Server↔Broker comm | Each Server.exe keeps HTTP, broker proxies |
| Broker port | Default 5100, configurable in VS settings |
| Discovery | MCP tools on broker (list_instances, select_instance) |
| Proxy mode | Transparent — broker re-exposes instance tools |
| Port allocation | Server.exe binds port 0, reports actual port to broker |
| No-selection behavior | Error with instance list |
| No-solution VS | Registers with null solution info |
| Standalone mode | Setting to disable broker (preserves current behavior) |
| Shim | Separate Shim.exe, bridges STDIO to broker HTTP |
Sub-Issues
Phase 1: Shared
- feat(shared): add broker communication models and RPC contract update #58 - feat(shared): add broker communication models and RPC contract update
Phase 2: Broker
- feat(broker): create Broker.exe with instance registry and MCP proxy #59 - feat(broker): create Broker.exe with instance registry and MCP proxy
Phase 3: Server Changes
- feat(server): add port 0 binding and broker registration #60 - feat(server): add port 0 binding and broker registration
Phase 4: Extension Changes
- feat(extension): add broker lifecycle management and solution change forwarding #61 - feat(extension): add broker lifecycle management and solution change forwarding
Phase 5: Shim
- feat(shim): create STDIO-to-broker bridge executable #62 - feat(shim): create STDIO-to-broker bridge executable
Phase 6: Packaging
- build(vsix): package Broker.exe and Shim.exe with extension #63 - build(vsix): package Broker.exe and Shim.exe with extension
Phase 7: Documentation
- docs: update README with STDIO transport configuration #26 - docs: update README with STDIO transport configuration
Dependencies
```
#58 (Shared) ──► #59 (Broker) ──┬──► #61 (Extension)
│
#60 (Server) ───┘
#62 (Shim) — parallel with Phase 3/4
#63 (Packaging) — after all projects exist
#26 (Docs) — last
```
Also Addresses
- Support for multiple instances of Visual Studio #54 - Support for multiple instances of Visual Studio
- no Https posible #55 - no Https posible (STDIO bypasses HTTP/HTTPS for local use)
Acceptance Criteria
- Broker manages multiple VS instance registrations
- Transparent proxy routes tool calls to selected instance
- STDIO transport works via Shim for Claude Desktop/Code
- HTTP/SSE transport works via broker for other clients
- Standalone mode (no broker) preserves current behavior
- Health checks detect and deregister crashed instances
- Solution changes reflected in broker registry
- All three executables ship in the VSIX
- Documentation updated
Activity