claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] VSCode Extension: Add SSE transport support for MCP servers (already supported in CLI)

Open AsiaOstrich opened this issue 3 months ago • 5 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I need to use a custom MCP server (knowledgeforge-rag) that runs on a remote machine and uses SSE (Server-Sent Events) transport. This server is accessible via SSH tunnel at http://localhost:8090/sse.

Current Situation:

  • The Claude CLI can connect to this SSE-based MCP server successfully
  • The VSCode Claude Code extension fails with error: "SSE MCP servers are currently not supported in native builds"
  • This forces me to switch between VSCode and terminal, breaking my integrated workflow

Impact on Workflow:

  • I cannot access my knowledge base from within VSCode
  • I must context-switch to terminal to run claude --print commands
  • This disrupts the seamless development experience that Claude Code provides
  • stdio-based MCP servers (excel, word, powerpoint) work fine, but SSE servers don't

Why This Matters: SSE transport is essential for remote MCP servers, especially those behind SSH tunnels or deployed on separate machines. This creates feature disparity between CLI and VSCode extension.

Proposed Solution

Add SSE transport support to the VSCode Claude Code extension, matching the existing CLI capabilities.

Ideal User Experience:

  1. Configuration: Users can define SSE MCP servers in .mcp.json: { "mcpServers": { "knowledgeforge-rag": { "type": "sse", "url": "http://localhost:8090/sse" } } }

  2. Connection: When VSCode reloads, the extension connects to SSE servers just like stdio servers

  3. Status: The /mcp command shows SSE servers as "connected" alongside stdio servers:

    • excel (stdio): ✅ Connected
    • word (stdio): ✅ Connected
    • knowledgeforge-rag (sse): ✅ Connected
  4. Usage: Users can interact with SSE-based MCP tools seamlessly within VSCode, without needing to switch to terminal

Technical Implementation:

  • Reuse the existing SSE transport implementation from Claude CLI
  • Ensure proper error handling for network issues
  • Support authentication headers if needed (similar to CLI's -H flag)

Alternative Solutions

Current Workaround: Using Claude CLI in terminal: claude --print "query using knowledgeforge"

Limitations:

  • Breaks VSCode workflow integration
  • Cannot use MCP tools in the natural conversation flow
  • Must copy/paste results between terminal and VSCode
  • Loses context of the current file/project

Other Alternatives Considered:

  1. Converting to stdio transport: Would require significant server-side changes and doesn't work for remote servers
  2. HTTP proxy wrapper: Added complexity and latency
  3. Waiting for SSH port forwarding improvements: Not a real solution to the core problem

None of these alternatives provide the seamless experience that native SSE support would offer.

Priority

High - Significant impact on productivity

Feature Category

MCP server integration

Use Case Example

Scenario: Knowledge-Enhanced Development

Setup:

  • I maintain a custom knowledge base (knowledgeforge-rag) on a remote server (100.72.185.20)
  • I connect via SSH tunnel: ssh -i ~/.ssh/id_mcp_knowledgeforge -L 8090:localhost:8090 -N -f [email protected]
  • The server runs on port 8090 with SSE endpoint at /sse

Current Workflow (Broken):

  1. I'm working in VSCode on a project file
  2. I need to query my knowledge base about system architecture
  3. Claude Code shows knowledgeforge-rag: ❌ failed in /mcp status
  4. I must switch to terminal and run claude --print "explain IWSE system architecture"
  5. I copy the response back to VSCode
  6. Context is lost between terminal and editor

Desired Workflow (With SSE Support):

  1. I'm working in VSCode on a project file
  2. I ask Claude Code: "Query the knowledge base about IWSE system architecture"
  3. Claude Code uses the knowledgeforge-rag MCP server seamlessly
  4. I get the response directly in the conversation
  5. I can continue working without context switching

Step-by-Step:

  1. Configure .mcp.json with SSE server URL
  2. Reload VSCode window
  3. Verify /mcp shows knowledgeforge-rag as connected ✅
  4. In Claude Code chat, naturally ask questions that trigger MCP tools
  5. Claude Code calls the SSE-based MCP server in the background
  6. Results appear inline in the conversation
  7. Development continues seamlessly

Additional Context

Evidence:

1. CLI Works Successfully: $ claude mcp list knowledgeforge-rag: http://localhost:8090/sse (SSE) - ✓ Connected $ claude mcp get knowledgeforge-rag knowledgeforge-rag: Status: ✓ Connected Type: sse URL: http://localhost:8090/sse

2. Server Responds Correctly: $ curl -H "Accept: text/event-stream" http://localhost:8090/sse event: endpoint data: /messages/?session_id=51558452b48b409f82e0ac0c277ce6aa

3. VSCode Extension Error: From Developer Tools Console: [ERROR] MCP server "knowledgeforge-rag" Connection failed: SSE MCP servers are currently not supported in native builds.

Environment:

  • OS: macOS (Darwin 24.6.0)
  • VSCode: September 2025 (version 1.105), Release date: October 9, 2025
  • Claude Code Extension: 2.0.14
  • Claude CLI: Latest (SSE support confirmed working)

Technical Considerations:

  • SSE is a W3C standard (Server-Sent Events)
  • Long-lived HTTP connections with event stream
  • Already implemented in Claude CLI codebase
  • Similar to WebSocket but simpler (unidirectional)

Related Information:

  • Issue #381 confirms SSE support was added to CLI in v0.2.54
  • No existing issue found for VSCode extension SSE support
  • This creates feature parity between CLI and VSCode extension

AsiaOstrich avatar Oct 14 '25 10:10 AsiaOstrich