@dotmcp/tunnel 1.0.1 β 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# @dotmcp/tunnel
|
|
2
|
+
|
|
3
|
+
Connect your local MCP servers to the [dotMCP Marketplace](https://dotmcp.io) without deploying code to the cloud.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- π **Expose local MCP servers** to the marketplace
|
|
8
|
+
- π **Secure WebSocket connection** with TLS encryption
|
|
9
|
+
- π **Auto-reconnect** with exponential backoff
|
|
10
|
+
- π» **Works with any MCP server** - Node.js, Python, or any language
|
|
11
|
+
- π **Zero cloud deployment** - keep your code on-premise or on your own cloud
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install globally
|
|
17
|
+
npm install -g @dotmcp/tunnel
|
|
18
|
+
|
|
19
|
+
# Or run directly with npx
|
|
20
|
+
npx @dotmcp/tunnel --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### 1. Create a Tunnel Server on dotMCP
|
|
26
|
+
|
|
27
|
+
1. Go to [app.dotmcp.io](https://app.dotmcp.io) and log in
|
|
28
|
+
2. Navigate to **Dashboard** β **My Servers** β **New Server**
|
|
29
|
+
3. Select **"Tunnel (Local MCP Server)"**
|
|
30
|
+
4. Enter your server name and description
|
|
31
|
+
5. Copy your **Tunnel Key** from the server settings
|
|
32
|
+
|
|
33
|
+
### 2. Create Configuration
|
|
34
|
+
|
|
35
|
+
Create a `tunnel.yaml` file:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
key: "dott_your_tunnel_key_here"
|
|
39
|
+
|
|
40
|
+
servers:
|
|
41
|
+
- id: "your-server-id"
|
|
42
|
+
command: "node"
|
|
43
|
+
args: ["./my-mcp-server.js"]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Start the Tunnel
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
dotmcp-tunnel -c tunnel.yaml
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Configuration Reference
|
|
53
|
+
|
|
54
|
+
### Basic Configuration
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
key: "dott_xxx..."
|
|
58
|
+
|
|
59
|
+
servers:
|
|
60
|
+
- id: "server-id-from-dashboard"
|
|
61
|
+
command: "node"
|
|
62
|
+
args: ["server.js"]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Full Configuration Options
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
key: "dott_xxx..."
|
|
69
|
+
|
|
70
|
+
# Optional: Custom relay URL (defaults to wss://relay.dotmcp.io)
|
|
71
|
+
# relay: "wss://relay.dotmcp.io"
|
|
72
|
+
|
|
73
|
+
servers:
|
|
74
|
+
- id: "server-id"
|
|
75
|
+
|
|
76
|
+
# Option 1: Command-based (stdio transport)
|
|
77
|
+
command: "node"
|
|
78
|
+
args: ["./server.js", "--flag"]
|
|
79
|
+
cwd: "/path/to/working/directory"
|
|
80
|
+
env:
|
|
81
|
+
API_KEY: "secret"
|
|
82
|
+
DEBUG: "true"
|
|
83
|
+
|
|
84
|
+
# Option 2: HTTP-based (for running servers)
|
|
85
|
+
# url: "http://localhost:3000/mcp"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## CLI Usage
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Start tunnel with config file
|
|
92
|
+
dotmcp-tunnel -c tunnel.yaml
|
|
93
|
+
|
|
94
|
+
# Start with verbose logging
|
|
95
|
+
dotmcp-tunnel -c tunnel.yaml -v
|
|
96
|
+
|
|
97
|
+
# Show help
|
|
98
|
+
dotmcp-tunnel --help
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Examples
|
|
102
|
+
|
|
103
|
+
### Node.js MCP Server
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
key: "dott_xxx..."
|
|
107
|
+
servers:
|
|
108
|
+
- id: "my-server"
|
|
109
|
+
command: "node"
|
|
110
|
+
args: ["server.js"]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Using NPM Packages
|
|
114
|
+
|
|
115
|
+
Expose the official MCP demo server:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
key: "dott_xxx..."
|
|
119
|
+
servers:
|
|
120
|
+
- id: "demo-server"
|
|
121
|
+
command: "npx"
|
|
122
|
+
args: ["-y", "@modelcontextprotocol/server-everything"]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Python MCP Server
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
key: "dott_xxx..."
|
|
129
|
+
servers:
|
|
130
|
+
- id: "python-server"
|
|
131
|
+
command: "python"
|
|
132
|
+
args: ["-m", "my_mcp_server"]
|
|
133
|
+
cwd: "/home/user/mcp-project"
|
|
134
|
+
env:
|
|
135
|
+
PYTHONPATH: "/home/user/mcp-project"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Multiple Servers
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
key: "dott_xxx..."
|
|
142
|
+
servers:
|
|
143
|
+
- id: "weather-api"
|
|
144
|
+
command: "node"
|
|
145
|
+
args: ["./servers/weather.js"]
|
|
146
|
+
|
|
147
|
+
- id: "database-tools"
|
|
148
|
+
command: "node"
|
|
149
|
+
args: ["./servers/database.js"]
|
|
150
|
+
env:
|
|
151
|
+
DB_HOST: "localhost"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## How It Works
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
βββββββββββββββββββ WebSocket βββββββββββββββββββ
|
|
158
|
+
β dotmcp-tunnel βββββββββββββββββββββΊβ Relay Server β
|
|
159
|
+
β (your machine) β β (Cloudflare) β
|
|
160
|
+
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
|
|
161
|
+
β stdio β
|
|
162
|
+
βΌ βΌ
|
|
163
|
+
βββββββββββββββββββ βββββββββββββββββββ
|
|
164
|
+
β Local MCP Serverβ β Proxy Worker β
|
|
165
|
+
β (Node/Python) β β (deployed) β
|
|
166
|
+
βββββββββββββββββββ ββββββββββ¬βββββββββ
|
|
167
|
+
β
|
|
168
|
+
βΌ
|
|
169
|
+
βββββββββββββββββββ
|
|
170
|
+
β API Consumers β
|
|
171
|
+
β (Claude, apps) β
|
|
172
|
+
βββββββββββββββββββ
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
1. **Tunnel daemon** connects to relay via secure WebSocket
|
|
176
|
+
2. **Relay** holds the connection and routes requests
|
|
177
|
+
3. **Proxy worker** forwards API requests through relay to your tunnel
|
|
178
|
+
4. **Local MCP server** processes requests and returns responses
|
|
179
|
+
|
|
180
|
+
## Security
|
|
181
|
+
|
|
182
|
+
- π **Tunnel keys** are scoped to your account
|
|
183
|
+
- π **Traffic** is encrypted via WebSocket TLS
|
|
184
|
+
- π« **No inbound ports** required on your machine
|
|
185
|
+
- π **Keys can be rotated** from the dashboard
|
|
186
|
+
|
|
187
|
+
## Requirements
|
|
188
|
+
|
|
189
|
+
- Node.js >= 18.0.0
|
|
190
|
+
|
|
191
|
+
## Troubleshooting
|
|
192
|
+
|
|
193
|
+
### "Config file not found"
|
|
194
|
+
Create a `tunnel.yaml` file or specify the path with `-c path/to/config.yaml`
|
|
195
|
+
|
|
196
|
+
### "Connection closed immediately"
|
|
197
|
+
- Verify your tunnel key is correct
|
|
198
|
+
- Check that the server ID matches your dashboard
|
|
199
|
+
|
|
200
|
+
### "Tunnel connected but tools not syncing"
|
|
201
|
+
- Ensure your MCP server responds to `initialize` and `tools/list`
|
|
202
|
+
- Check server logs for errors with `-v` flag
|
|
203
|
+
|
|
204
|
+
## Links
|
|
205
|
+
|
|
206
|
+
- π [Full Documentation](https://docs.dotmcp.io/publishers/tunnel)
|
|
207
|
+
- π [dotMCP Marketplace](https://dotmcp.io)
|
|
208
|
+
- π¬ [Support](mailto:hello@dotmcp.io)
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
BUSL-1.1
|