|
2 | 2 |
|
3 | 3 | As long as Claude Desktop does not support connecting to remote servers, you can use this script to run a bridge from stdio to HTTP SSE (Server-Sent Events) endpoint.
|
4 | 4 |
|
5 |
| -## Install claude_gateway |
6 |
| - |
7 |
| -You can install the package globally or use it directly with npx: |
| 5 | +## Install mcp-server-and-gw |
8 | 6 |
|
9 | 7 | ```shell
|
10 |
| -# install |
| 8 | +# 1. install |
11 | 9 | npm install -g mcp-server-and-gw
|
12 |
| - |
13 |
| -# Run with npx |
14 |
| -npx claude_gateway http://localhost:8808/ |
15 |
| - |
16 |
| -# Using environment variables |
17 |
| -MCP_HOST=localhost MCP_PORT=8808 npx claude_gateway |
| 10 | +# 2. Or run directly with npx |
| 11 | +npx mcp-server-and-gw http://localhost:8808/ |
| 12 | +# ...you can use environment variables too |
| 13 | +MCP_HOST=localhost MCP_PORT=8808 npx mcp-server-and-gw |
18 | 14 | ```
|
19 | 15 |
|
20 | 16 | ## Add Configuration into Claude
|
21 | 17 |
|
22 | 18 | > The bridge script is node javasscript, but your server code can be whatever you use.
|
23 | 19 |
|
24 |
| -A [Model Context Protocol](https://www.anthropic.com/news/model-context-protocol) gateway [src/claude_gateway.ts](src/claude_gateway.ts) from [stdio](https://spec.modelcontextprotocol.io/specification/basic/transports/#stdio) to [HTTP SSE](https://spec.modelcontextprotocol.io/specification/basic/transports/#http-with-sse) transport. |
| 20 | +A [Model Context Protocol](https://www.anthropic.com/news/model-context-protocol) gateway [src/mcp-server-and-gw.ts](src/mcp-server-and-gw.ts) from [stdio](https://spec.modelcontextprotocol.io/specification/basic/transports/#stdio) to [HTTP SSE](https://spec.modelcontextprotocol.io/specification/basic/transports/#http-with-sse) transport. |
25 | 21 |
|
26 | 22 | ```shell
|
27 | 23 | ## 1. Build
|
28 | 24 | yarn install
|
29 | 25 | yarn build
|
30 | 26 |
|
31 | 27 | ## 2. Copy the code or update the claude_desktop_config.json
|
32 |
| -## NOTE: Ensure that npx is in the PATH, os use full path. |
| 28 | +## NOTE: Ensure that npx is in the PATH, or use full path like /opt/homebrew/bin/npx |
33 | 29 | echo '{
|
34 | 30 | "mcpServers": {
|
35 | 31 | "Claude Gateway Example": {
|
36 |
| - "command": "/opt/homebrew/bin/npx", |
| 32 | + "command": "npx", |
37 | 33 | "args": [
|
38 |
| - "claude_gateway", "http://localhost:8808/" |
| 34 | + "mcp-server-and-gw", "http://localhost:8808/" |
39 | 35 | ]
|
40 | 36 | }
|
41 | 37 | }
|
|
0 commit comments