Socket
Book a DemoInstallSign in
Socket

mcp-bridge-claude-to-vscode

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-bridge-claude-to-vscode

VSCode MCP relay that supports multiple servers

0.0.33
latest
npmnpm
Version published
Weekly downloads
83
107.5%
Maintainers
1
Weekly downloads
 
Created
Source

VSCode as MCP Relay

This is a Node.js implementation of an MCP (Mechanism, Control, Policy) relay for VSCode extensions. It's based on the Go implementation in ../mcp-relay/main.go but adds the following features:

Features

  • Multiple Server Support: Scans ports from the specified port to +10 to discover and connect to multiple MCP Bridges.
  • Custom Protocol Extensions: Implements custom protocol messages for:
    • Client notifying server: "You are now the main server"
    • Server requesting to client: "I want to be the main server"
  • Fallback Capability: Can switch between available servers if the primary becomes unresponsive.

Installation

cd packages/relay
npm install -g

Usage

vscode-as-mcp-relay --server-url http://localhost:60100 --listen-port 6011

Command Line Options

  • --server-url: Base URL of the MCP Bridge (default: http://localhost:60100)
  • --listen-port: Starting port to listen for incoming JSON-RPC messages (default: 6011)

Custom Protocol

The relay implements a custom protocol for communication between clients and servers:

  • Registration:

    {
      "clientUrl": "http://localhost:PORT",
      "features": ["relay_protocol_v1"]
    }
    
  • Set Main Server (Client to Server):

    {
      "jsonrpc": "2.0",
      "method": "$relay",
      "params": {
        "type": "set_main",
        "clientPort": PORT
      }
    }
    
  • Request to be Main (Server to Client):

    {
      "jsonrpc": "2.0",
      "method": "$relay",
      "params": {
        "type": "request_main",
        "serverUrl": "http://localhost:PORT"
      }
    }
    

How It Works

  • The relay scans ports to discover available MCP Bridges.
  • It registers with all discovered servers.
  • It establishes the first discovered server as the primary.
  • It processes stdin and relays messages to the active server.
  • If a server requests to be the main server, the relay can switch its active connection.
  • If the active server becomes unresponsive, the relay can fail over to another server.

Keywords

vscode

FAQs

Package last updated on 05 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.