A unified MCP (Model Context Protocol) bridge system that connects Claude Desktop with Cursor IDE, providing seamless integration between the AI assistant and the code editor.
✅ MCP Bridge Successfully Tested on August 17, 2025
This project follows the Lego Block methodology - separate components that work together as one unified system:
- Lego Block 1: MCP Server (
server.ts) - Handles MCP protocol communication - Lego Block 2: VS Code Extension (
extension.ts) - Integrates with Cursor IDE via WebSocket
# Clone and setup
git clone https://github.com/Y1ssh/mcp_test.git
cd mcp_test
npm install
# Build everything
npm run build
# Start the MCP server
npm run devmcp_test/
├── package.json # Unified dependencies
├── tsconfig.json # Server TypeScript config
├── tsconfig.extension.json # Extension TypeScript config
├── src/
│ ├── server.ts # MCP Server (Lego Block 1)
│ ├── cursor-controller.ts # File operations controller
│ ├── extension.ts # VS Code Extension (Lego Block 2)
│ ├── mcp-client.ts # WebSocket MCP client
│ ├── cursor-api.ts # Cursor IDE API wrapper
│ └── types.ts # Shared type definitions
├── dist/ # Built MCP server files
├── out/ # Built extension files
└── README.md # This file
| Command | Description |
|---|---|
npm install |
Install all dependencies |
npm run build |
Build both server and extension |
npm run build-server |
Build only the MCP server |
npm run build-extension |
Build only the VS Code extension |
npm run dev |
Build and start MCP server |
npm run start |
Start the built MCP server |
npm run watch |
Watch and rebuild server on changes |
npm run watch-extension |
Watch and rebuild extension on changes |
- Handles MCP protocol communication with Claude Desktop
- Provides file operations, command execution, and workspace management
- Built as ES modules for modern JavaScript compatibility
- Connects MCP server with Cursor IDE
- Handles real-time communication between components
- Manages connection status and automatic reconnection
- Integrates directly with Cursor IDE interface
- Provides file opening, workspace browsing, and command execution
- Shows connection status in the status bar
npm installnpm run buildAdd to your Claude Desktop MCP configuration:
{
"mcpServers": {
"cursor-bridge": {
"command": "node",
"args": ["path/to/mcp_test/dist/server.js"],
"env": {}
}
}
}Copy the built extension to your VS Code extensions directory or use the VS Code extension development host.
npm run devThe server provides these tools to Claude:
- edit_file: Edit file contents
- read_file: Read file contents
- open_file: Open files in Cursor at specific lines
- list_files: List workspace files
- run_command: Execute system commands
Claude Desktop ←→ MCP Server (3056) ←→ WebSocket Bridge (3057) ←→ Cursor IDE Extension
- Claude sends MCP requests to the server
- Server processes requests and communicates with Cursor via WebSocket
- Extension receives WebSocket messages and executes actions in Cursor
- Results flow back through the same chain
npm run dev- Look for "MCP Connected" in VS Code status bar
- Check VS Code Developer Console for extension logs
Port conflicts: Ensure ports 3056 and 3057 are available Extension not loading: Check VS Code extension is properly installed Connection issues: Verify both server and extension are running
# Terminal 1: Watch server changes
npm run watch
# Terminal 2: Watch extension changes
npm run watch-extension- Add types to
src/types.ts - Implement server-side logic in
src/server.ts - Add extension handlers in
src/extension.ts - Update both TypeScript configs as needed
@modelcontextprotocol/sdk: MCP protocol implementationws: WebSocket communication
typescript: TypeScript compiler@types/node: Node.js type definitions@types/vscode: VS Code extension types@types/ws: WebSocket type definitions
- Fork the repository
- Create a feature branch
- Make your changes
- Test both server and extension components
- Submit a pull request
This project is licensed under the MIT License.