MCP SSE Bridge
A lightweight Node.js bridge that connects a local Stdio-based MCP client (like Claude Desktop or IDEs) to a remote SSE-based MCP server.
Specs
- Transport: Bridges
StdioServerTransport(local) <->SSEClientTransport(remote). - Input: JSON-RPC messages via Stdio.
- Output: JSON-RPC messages via Server-Sent Events (SSE) and HTTP POST.
- Dependencies:
@modelcontextprotocol/sdkeventsource(polyfill for Node.js)
Build
-
Install Dependencies
bash npm install -
Build Bundle
This project usesesbuildto bundle the script and its dependencies into a single file.bash npm run build
The output file will be located atdist/sse-bridge.js.
Usage
Via npx
You can run the bridge directly without installation using npx:```bash
npx -y @smn3786/mcp-sse-bridge <remote-sse-url>
### Local Usage
Run the bundled script using Node.js:```bash
node dist/sse-bridge.js <remote-sse-url>
Configuration Examples
1. Using Local Installation (Recommended)
Install via npm install @smn3786/mcp-sse-bridge, then configure:```json
{
"mcpServers": {
"shadcn-mcp-server": {
"command": "node",
"args": [
"/absolute/path/to/node_modules/@smn3786/mcp-sse-bridge/dist/sse-bridge.js",
"http://<remote-ip>:<port>/sse"
]
}
}
}
#### 2. Using npx```json
{
"mcpServers": {
"shadcn-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smn3786/mcp-sse-bridge",
"http://<remote-ip>:<port>/sse"
]
}
}
}
