Skip to content

feat(transport): add STDIO transport support #18

@CalvinAllen

Description

@CalvinAllen

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

Phase 2: Broker

Phase 3: Server Changes

Phase 4: Extension Changes

Phase 5: Shim

Phase 6: Packaging

Phase 7: Documentation

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

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions