Codebridge MCP
VSCode extension that hosts a multi-instance MCP server with intelligent VSCode coordination (LSP, selection, open files, etc.)
Installation
npx codebridge-mcpAsk AI about Codebridge MCP
Powered by Claude Β· Grounded in docs
I know everything about Codebridge MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
CodeBridge MCP
Transform your VSCode into a powerful MCP server - Give AI assistants seamless access to your entire development environment with intelligent multi-instance coordination.
π Quick Setup
1. Install & Auto-Start
- Install the CodeBridge MCP extension in VSCode
- Extension automatically starts as MCP server on port
9100 - Your VSCode is now accessible via MCP! π
2. Connect Your AI Assistant
Claude Code
claude mcp add --transport http codebridge http://localhost:9100/mcp
OpenCode Configuration
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"codebridge-mcp": {
"type": "local",
"command": [
"npx", "mcp-remote", "http://localhost:9100/mcp",
"--allow-http", "--transport", "http-only"
],
"enabled": true
}
}
}
Claude Desktop Configuration
{
"mcpServers": {
"codebridge-mcp": {
"command": "npx",
"args": [
"mcp-remote", "http://localhost:9100/mcp",
"--allow-http", "--transport", "http-only"
]
}
}
}
Any MCP Client
http://localhost:9100/mcp
β¨ Why Choose CodeBridge MCP?
ποΈ Full-Stack Development Made Easy
- Multi-Instance Support: React frontend (VSCode #1) + Node.js backend (VSCode #2) + Mobile app (VSCode #3) - all accessible through one MCP connection
- Intelligent Routing: AI automatically knows which workspace to target for each request
- Live Context: Real-time diagnostics, open files, and editor state - not just static files
- Zero Setup: Works with your existing VSCode setup, no LSP configuration needed
π€ AI-Powered Features
- Real-Time Analysis: AI sees live diagnostics and errors as you code
- Cross-Project Intelligence: AI understands relationships between frontend/backend code
- Context-Aware Suggestions: Based on your actual workspace state and current selection
- Rich Metadata: Symbols, references, definitions - full IDE context for AI
π οΈ Available MCP Tools
get_workspaces- Discover all VSCode instances and workspace foldersget_diagnostics- Live LSP diagnostics with workspace targetingget_open_files- Open files across all instances (aggregated)get_file_content- File content with workspace-specific routingget_selection- Selected text and context with workspace targetingfind_references- Cross-workspace symbol referencesfind_definition- Symbol definitions with workspace routingget_workspace_symbols- Symbol search across all workspacessearch_files- File search with workspace filtering
π Requirements
- VSCode 1.80.0+ - The extension runs inside VSCode
- Node.js 18+ - For MCP client connections (if using npm-based clients)
- No external dependencies - Everything is self-contained in the extension
Note: The extension creates an HTTP MCP server that any MCP-compatible client can connect to.
βοΈ Extension Settings
Server Configuration
codebridge-mcp.server.autoStart: Auto-start MCP server on activation (default: true)codebridge-mcp.server.port: Preferred MCP server port (default: 9100)codebridge-mcp.debug.enableLogging: Debug logging for troubleshooting (default: false)
Multi-Instance Coordination
codebridge-mcp.coordination.enabled: Enable multi-instance coordination (default: true)codebridge-mcp.coordination.mode: Force coordination mode - "auto", "master", "worker", "standalone" (default: "auto")codebridge-mcp.coordination.masterPort: Master instance port (default: 9100)codebridge-mcp.coordination.workerPortRange: Worker port range (default: [9101, 9199])
Failover & Reliability
codebridge-mcp.failover.enabled: Enable automatic failover (default: true)codebridge-mcp.failover.electionTimeout: Leader election timeout in ms (default: 5000)codebridge-mcp.failover.healthCheckInterval: Health check frequency in ms (default: 3000)
ποΈ Commands
Server Management
CodeBridge MCP: Start Server- Start the MCP serverCodeBridge MCP: Stop Server- Stop the MCP serverCodeBridge MCP: Show Server Status- Display server and workspace infoCodeBridge MCP: Toggle Debug Logging- Enable/disable debug logging
Multi-Instance Coordination
CodeBridge MCP: Show Coordination Status- Display master/worker status and connectionsCodeBridge MCP: List Connected Instances- Show all connected VSCode instancesCodeBridge MCP: Force Master Mode- Override coordination detection (advanced)CodeBridge MCP: Reset Coordination- Restart coordination system
3. Start Using MCP Tools
// Discover all your workspaces
await client.callTool("get_workspaces", {});
// Get real-time diagnostics from your code
await client.callTool("get_diagnostics", {
workspace: "MyProject"
});
// Access your open files
await client.callTool("get_open_files", {});
// Get your current selection
await client.callTool("get_selection", {});
4. Multi-Instance Setup (Advanced)
Perfect for full-stack development - have separate VSCode instances for frontend, backend, mobile app, etc., all accessible through one MCP connection!
Example workflow:
VSCode #1: React Frontend (port 9100 - Master)
VSCode #2: Node.js Backend (port 9101 - Worker)
VSCode #3: Mobile App (port 9102 - Worker)
β AI Assistant connects once to port 9100
β Gets unified access to all three codebases
β Can analyze frontend/backend interactions
β Routes tools to the right project automatically
ποΈ Architecture
Master-Worker Coordination
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β VSCode #1 β β VSCode #2 β β VSCode #3 β
β (Master) β β (Worker) β β (Worker) β
β Port: 9100 βββββΊβ Port: 9101 β β Port: 9102 β
β βββββββββββββ β β βββββββββββββ β β βββββββββββββ β
β βMCP Server β β β βLocal Toolsβ β β βLocal Toolsβ β
β β+ Coord β β β β β β β β β β
β βββββββββββββ β β βββββββββββββ β β βββββββββββββ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β²
β
ββββββββββββββ
β MCP Client β (Always connects to port 9100)
ββββββββββββββ
Technical Stack
- Express.js: HTTP server and coordination endpoints
- @modelcontextprotocol/sdk: Standards-compliant MCP transport
- VSCode API: Direct access for optimal performance
- TypeScript: Full type safety and robust error handling
- Leader Election: Raft-inspired consensus for fault tolerance
π§ Development
Build and package the extension:
# Install dependencies
bun install
# Build the extension
bun run build
# Package for distribution
bun run package
# Run in development mode
bun run dev
π Troubleshooting
Port Already in Use
If port 9100 is occupied, the extension will automatically find the next available port (9101, 9102, etc.). Check VSCode status bar or run CodeBridge MCP: Show Server Status to see the actual port.
Connection Issues
- Ensure VSCode extension is running (
CodeBridge MCP: Show Server Status) - Verify the MCP endpoint URL matches your server port
- Check firewall settings allow localhost connections
- Enable debug logging:
CodeBridge MCP: Toggle Debug Logging
Multi-Instance Issues
- Only connect MCP clients to the master instance (usually port 9100)
- Use
CodeBridge MCP: Show Coordination Statusto check master/worker roles - Reset coordination if needed:
CodeBridge MCP: Reset Coordination
# Install dependencies
bun install
# Build the extension
bun run build
# Package for distribution
bun run package
# Run in development mode
bun run dev
π€ Contributing
See DEVELOPMENT.md for technical details and contribution guidelines.
