# MCP HTTP–Stdio Bridge

This package is a transparent proxy between stdio and HTTP for MCP servers. It allows apps like Claude Desktop to connect to MCP servers using the [Streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) when `http` is not allowed.

>  Note: Use this in trusted environments for local MCP servers on unencrypted connections. Always use HTTPS for connecting to remote MCP servers.

## Claude Desktop Configuration

Edit `~/Library/Application\ Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "My Server": {
      "command": "npx",
      "args": ["-y", "@depasquale/mcp-http-stdio-bridge", "--url", "http://localhost:8080/mcp"]
    }
  }
}
```

Restart Claude Desktop after saving.

## Options

| Flag               | Description                                        |
| ------------------ | -------------------------------------------------- |
| `--url <url>`      | Server URL (default: `http://localhost:52274/mcp`) |
| `--insecure`, `-k` | Accept self-signed certificates                    |
| `-h`, `--help`     | Show help                                          |

## How It Works

The bridge is content-agnostic: it forwards raw JSON-RPC messages without parsing MCP protocol content. Only transport-level concerns are handled:

- Session management via `mcp-session-id` header
- SSE connection with automatic reconnection
- Graceful shutdown with session cleanup

Transport errors cause the bridge to exit, mimicking broken pipe behavior for the client.
