|
| 1 | +--- |
| 2 | +title: Expand transport compatibility with proxy stdio |
| 3 | +description: |
| 4 | + How to use the thv proxy stdio command to enable Claude Desktop and other |
| 5 | + stdio-only clients to connect to MCP servers using SSE or HTTP transport. |
| 6 | +--- |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +Claude Desktop and many other MCP clients only support MCP servers that |
| 11 | +communicate via stdio transport. However, many popular MCP servers use |
| 12 | +Server-Sent Events (SSE) or Streamable-HTTP transport protocols. This means |
| 13 | +that out of the box, these clients cannot connect to those servers. |
| 14 | + |
| 15 | +ToolHive overcomes this limitation with the `thv proxy stdio` command. This |
| 16 | +command transforms servers using SSE or Streamable-HTTP into stdio-compatible |
| 17 | +processes, immediately expanding the tools available to stdio-only clients like |
| 18 | +Claude Desktop. |
| 19 | + |
| 20 | +## How it works |
| 21 | + |
| 22 | +The `thv proxy stdio` command wraps an existing MCP server—regardless of its |
| 23 | +transport method—and exposes it as a stdio-compatible process. When you use |
| 24 | +this command: |
| 25 | + |
| 26 | +1. ToolHive continues to run the MCP server (for example, `osv`) in its |
| 27 | + container with its default transport (SSE, HTTP, or other). |
| 28 | +2. The `thv proxy stdio` command sets up a stdio-level wrapper pointing to that |
| 29 | + existing server. |
| 30 | +3. Tools exposed by this MCP are recognized in your client and are ready to be |
| 31 | + used. |
| 32 | +4. Your client interacts with this wrapper just like any other stdio MCP |
| 33 | + server. The client has no idea whether the underlying server uses SSE or |
| 34 | + HTTP. |
| 35 | + |
| 36 | +## Usage example |
| 37 | + |
| 38 | +Here's how to configure an SSE-based MCP server to work with Claude Desktop. |
| 39 | + |
| 40 | +First, run an MCP server with SSE transport: |
| 41 | + |
| 42 | +```bash |
| 43 | +thv run osv --transport sse --name osv |
| 44 | +``` |
| 45 | + |
| 46 | +Then configure Claude Desktop to use the proxy stdio command. Update your |
| 47 | +Claude Desktop configuration file (typically located at |
| 48 | +`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS): |
| 49 | + |
| 50 | +```json |
| 51 | +{ |
| 52 | + "mcpServers": { |
| 53 | + "osv": { |
| 54 | + "command": "thv", |
| 55 | + "args": ["proxy", "stdio", "osv"] |
| 56 | + } |
| 57 | + } |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +:::tip |
| 62 | + |
| 63 | +The workload name you pass to `thv proxy stdio` (in this case, `osv`) must |
| 64 | +match the name you used when running the server with `thv run`. |
| 65 | + |
| 66 | +::: |
| 67 | + |
| 68 | +After restarting Claude Desktop, the MCP server's tools will be available for |
| 69 | +use, even though it uses SSE transport. |
| 70 | + |
| 71 | + |
| 72 | +## Related commands |
| 73 | + |
| 74 | +- [`thv run`](../reference/cli/thv_run.md) - Run an MCP server with ToolHive |
| 75 | +- [`thv proxy stdio`](../reference/cli/thv_proxy_stdio.md) - CLI reference for |
| 76 | + the proxy stdio command |
| 77 | +- [`thv proxy tunnel`](../reference/cli/thv_proxy_tunnel.md) - Create a tunnel |
| 78 | + proxy for remote MCP servers |
| 79 | + |
| 80 | +## See also |
| 81 | + |
| 82 | +- [Client configuration](client-configuration.mdx) - Configure MCP clients to |
| 83 | + connect to ToolHive servers |
| 84 | +- [Run MCP servers](run-mcp-servers.mdx) - Learn how to run MCP servers with |
| 85 | + ToolHive |
0 commit comments