@nimbletools/mcp-http-bridge 1.0.0 → 1.0.3
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/LICENSE +2 -2
- package/README.md +73 -21
- package/dist/bridge.d.ts +1 -0
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +78 -12
- package/dist/bridge.js.map +1 -1
- package/dist/cli.js +7 -1
- package/dist/cli.js.map +1 -1
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 NimbleBrain, Inc.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
# MCP HTTP Bridge
|
|
1
|
+
# NimbleTools - MCP HTTP Bridge
|
|
2
2
|
|
|
3
3
|
Bridge the Model Context Protocol (MCP) stdio interface to HTTP-based MCP services. This allows MCP clients like Claude Code to seamlessly connect to remote MCP servers running over HTTP.
|
|
4
4
|
|
|
5
|
+
For more information about MCP and related tools, visit [www.nimbletools.ai](http://www.nimbletools.ai).
|
|
6
|
+
|
|
5
7
|
## Requirements
|
|
6
8
|
|
|
7
|
-
- Node.js
|
|
8
|
-
- npm
|
|
9
|
+
- Node.js 20.0.0 or higher
|
|
10
|
+
- npm 9.0.0 or higher
|
|
9
11
|
|
|
10
12
|
## Installation
|
|
11
13
|
|
|
@@ -42,8 +44,10 @@ Add to your Claude Code configuration:
|
|
|
42
44
|
"command": "npx",
|
|
43
45
|
"args": [
|
|
44
46
|
"@nimbletools/mcp-http-bridge",
|
|
45
|
-
"--endpoint",
|
|
46
|
-
"
|
|
47
|
+
"--endpoint",
|
|
48
|
+
"https://api.example.com/mcp",
|
|
49
|
+
"--token",
|
|
50
|
+
"your-bearer-token"
|
|
47
51
|
]
|
|
48
52
|
}
|
|
49
53
|
}
|
|
@@ -59,9 +63,7 @@ For better security, use environment variables:
|
|
|
59
63
|
"mcpServers": {
|
|
60
64
|
"my-remote-server": {
|
|
61
65
|
"command": "mcp-http-bridge",
|
|
62
|
-
"args": [
|
|
63
|
-
"--endpoint", "https://api.example.com/mcp"
|
|
64
|
-
],
|
|
66
|
+
"args": ["--endpoint", "https://api.example.com/mcp"],
|
|
65
67
|
"env": {
|
|
66
68
|
"MCP_BEARER_TOKEN": "your-bearer-token"
|
|
67
69
|
}
|
|
@@ -72,13 +74,13 @@ For better security, use environment variables:
|
|
|
72
74
|
|
|
73
75
|
## Options
|
|
74
76
|
|
|
75
|
-
| Option
|
|
76
|
-
|
|
77
|
-
| `--endpoint` | `-e`
|
|
78
|
-
| `--token`
|
|
79
|
-
| `--timeout`
|
|
80
|
-
| `--retries`
|
|
81
|
-
| `--verbose`
|
|
77
|
+
| Option | Alias | Default | Description |
|
|
78
|
+
| ------------ | ----- | ---------- | --------------------------------- |
|
|
79
|
+
| `--endpoint` | `-e` | _required_ | HTTP endpoint for the MCP service |
|
|
80
|
+
| `--token` | `-t` | _required_ | Bearer token for authentication |
|
|
81
|
+
| `--timeout` | | `30000` | Request timeout in milliseconds |
|
|
82
|
+
| `--retries` | | `3` | Number of retry attempts |
|
|
83
|
+
| `--verbose` | `-v` | `false` | Enable verbose logging |
|
|
82
84
|
|
|
83
85
|
## How It Works
|
|
84
86
|
|
|
@@ -118,6 +120,7 @@ Content-Type: application/json
|
|
|
118
120
|
## Examples
|
|
119
121
|
|
|
120
122
|
### Basic Usage
|
|
123
|
+
|
|
121
124
|
```bash
|
|
122
125
|
mcp-http-bridge \
|
|
123
126
|
--endpoint "https://mcp.example.com/api" \
|
|
@@ -125,6 +128,7 @@ mcp-http-bridge \
|
|
|
125
128
|
```
|
|
126
129
|
|
|
127
130
|
### With Custom Timeout
|
|
131
|
+
|
|
128
132
|
```bash
|
|
129
133
|
mcp-http-bridge \
|
|
130
134
|
--endpoint "https://slow-service.com/mcp" \
|
|
@@ -134,6 +138,7 @@ mcp-http-bridge \
|
|
|
134
138
|
```
|
|
135
139
|
|
|
136
140
|
### Testing Connectivity
|
|
141
|
+
|
|
137
142
|
```bash
|
|
138
143
|
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | \
|
|
139
144
|
mcp-http-bridge --endpoint "https://api.com/mcp" --token "token"
|
|
@@ -156,13 +161,59 @@ npm run build
|
|
|
156
161
|
npm run dev -- --endpoint "https://..." --token "..."
|
|
157
162
|
```
|
|
158
163
|
|
|
164
|
+
### Local Development with Claude Code
|
|
165
|
+
|
|
166
|
+
For testing during development, you can configure Claude Code to use either your local build or the published package:
|
|
167
|
+
|
|
168
|
+
**Using local build:**
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"mcpServers": {
|
|
173
|
+
"national-parks": {
|
|
174
|
+
"command": "node",
|
|
175
|
+
"args": [
|
|
176
|
+
"/path/to/your/mcp-http-bridge/dist/cli.js",
|
|
177
|
+
"--endpoint",
|
|
178
|
+
"https://mcp.nimbletools.dev/v1/workspaces/your-workspace-id/servers/nationalparks-mcp/mcp",
|
|
179
|
+
"--token",
|
|
180
|
+
"your-auth-token-here",
|
|
181
|
+
"--insecure"
|
|
182
|
+
],
|
|
183
|
+
"auth": null,
|
|
184
|
+
"oauth": false
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Using published package with npx:**
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"mcpServers": {
|
|
195
|
+
"national-parks": {
|
|
196
|
+
"command": "npx",
|
|
197
|
+
"args": [
|
|
198
|
+
"@nimbletools/mcp-http-bridge",
|
|
199
|
+
"--endpoint",
|
|
200
|
+
"https://mcp.nimbletools.dev/v1/workspaces/your-workspace-id/servers/nationalparks-mcp/mcp",
|
|
201
|
+
"--token",
|
|
202
|
+
"your-auth-token-here",
|
|
203
|
+
"--insecure"
|
|
204
|
+
],
|
|
205
|
+
"auth": null,
|
|
206
|
+
"oauth": false
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Replace the workspace ID and token with your actual credentials. The `--insecure` flag is useful for development against local or test endpoints.
|
|
213
|
+
|
|
159
214
|
## Contributing
|
|
160
215
|
|
|
161
|
-
|
|
162
|
-
2. Create a feature branch
|
|
163
|
-
3. Make your changes
|
|
164
|
-
4. Add tests if applicable
|
|
165
|
-
5. Submit a pull request
|
|
216
|
+
We welcome contributions! If you're interested in contributing, please read our [Contributing Guide](CONTRIBUTING.md) for details on our development process, how to propose bugfixes and improvements, and how to build and test your changes.
|
|
166
217
|
|
|
167
218
|
## License
|
|
168
219
|
|
|
@@ -172,4 +223,5 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
172
223
|
|
|
173
224
|
- 🐛 [Report Issues](https://github.com/nimbletools/mcp-http-bridge/issues)
|
|
174
225
|
- 📖 [Documentation](https://github.com/nimbletools/mcp-http-bridge)
|
|
175
|
-
- 💬 [Discussions](https://github.com/nimbletools/mcp-http-bridge/discussions)
|
|
226
|
+
- 💬 [Discussions](https://github.com/nimbletools/mcp-http-bridge/discussions)
|
|
227
|
+
- 💬 [Join our Slack Community](https://join.slack.com/t/nimblebrain-users/shared_invite/zt-2jpyzxgvl-7_kFJQHyJSmJzWXmYK8cMg)
|
package/dist/bridge.d.ts
CHANGED
package/dist/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":";AAuBA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":";AAuBA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,aAAa,CAAC;gBAEV,MAAM,EAAE,YAAY;IAqB1B,KAAK;YAkCG,gBAAgB;YA+BhB,iBAAiB;YAqDjB,eAAe;IA2B7B,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,QAAQ;CAIjB"}
|
package/dist/bridge.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import axios from 'axios';
|
|
3
|
+
import https from 'https';
|
|
3
4
|
export class MCPHttpBridge {
|
|
4
|
-
config;
|
|
5
|
-
axiosInstance;
|
|
6
5
|
constructor(config) {
|
|
7
6
|
this.config = config;
|
|
8
|
-
|
|
7
|
+
const axiosConfig = {
|
|
9
8
|
timeout: config.timeout,
|
|
10
9
|
headers: {
|
|
11
10
|
'Authorization': `Bearer ${config.bearerToken}`,
|
|
12
11
|
'Content-Type': 'application/json',
|
|
13
12
|
},
|
|
14
|
-
}
|
|
13
|
+
};
|
|
14
|
+
// Add HTTPS agent for SSL configuration
|
|
15
|
+
if (config.rejectUnauthorized === false) {
|
|
16
|
+
axiosConfig.httpsAgent = new https.Agent({
|
|
17
|
+
rejectUnauthorized: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
this.axiosInstance = axios.create(axiosConfig);
|
|
15
21
|
}
|
|
16
22
|
async start() {
|
|
17
23
|
process.stdin.setEncoding('utf8');
|
|
@@ -23,13 +29,17 @@ export class MCPHttpBridge {
|
|
|
23
29
|
buffer = lines.pop() || ''; // Keep incomplete line in buffer
|
|
24
30
|
for (const line of lines) {
|
|
25
31
|
if (line.trim()) {
|
|
26
|
-
this.handleMCPRequest(line.trim())
|
|
32
|
+
this.handleMCPRequest(line.trim()).catch(error => {
|
|
33
|
+
console.error(`[Bridge] Unhandled error in request processing: ${error.message}`);
|
|
34
|
+
});
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
});
|
|
30
38
|
process.stdin.on('end', () => {
|
|
31
39
|
if (buffer.trim()) {
|
|
32
|
-
this.handleMCPRequest(buffer.trim())
|
|
40
|
+
this.handleMCPRequest(buffer.trim()).catch(error => {
|
|
41
|
+
console.error(`[Bridge] Unhandled error in final request processing: ${error.message}`);
|
|
42
|
+
});
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
45
|
// Handle graceful shutdown
|
|
@@ -39,10 +49,20 @@ export class MCPHttpBridge {
|
|
|
39
49
|
async handleMCPRequest(requestLine) {
|
|
40
50
|
try {
|
|
41
51
|
const request = JSON.parse(requestLine);
|
|
52
|
+
// Add verbose logging
|
|
53
|
+
if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
54
|
+
console.error(`[Bridge] Processing request: ${request.method} (id: ${request.id})`);
|
|
55
|
+
}
|
|
42
56
|
const response = await this.processMCPRequest(request);
|
|
43
|
-
|
|
57
|
+
if (response !== null) {
|
|
58
|
+
this.sendResponse(response);
|
|
59
|
+
}
|
|
60
|
+
else if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
61
|
+
console.error(`[Bridge] No response sent for ${request.method}`);
|
|
62
|
+
}
|
|
44
63
|
}
|
|
45
64
|
catch (error) {
|
|
65
|
+
console.error(`[Bridge] Error processing request: ${error instanceof Error ? error.message : String(error)}`);
|
|
46
66
|
const errorResponse = {
|
|
47
67
|
jsonrpc: '2.0',
|
|
48
68
|
id: undefined,
|
|
@@ -59,12 +79,40 @@ export class MCPHttpBridge {
|
|
|
59
79
|
try {
|
|
60
80
|
// Forward the MCP request to the HTTP endpoint
|
|
61
81
|
const httpResponse = await this.makeHttpRequest(request);
|
|
62
|
-
//
|
|
63
|
-
|
|
82
|
+
// Check if the response is already a valid MCP response
|
|
83
|
+
const responseData = httpResponse.data;
|
|
84
|
+
if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
85
|
+
console.error(`[Bridge] Received from HTTP: ${JSON.stringify(responseData)}`);
|
|
86
|
+
console.error(`[Bridge] Request ID: ${request.id}, Response has result: ${'result' in responseData}, Response has error: ${'error' in responseData}`);
|
|
87
|
+
}
|
|
88
|
+
// Handle empty responses (like notifications that return 200 with no body)
|
|
89
|
+
if (!responseData || responseData === '' || Object.keys(responseData).length === 0) {
|
|
90
|
+
if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
91
|
+
console.error(`[Bridge] Empty response received, no response needed for ${request.method}`);
|
|
92
|
+
}
|
|
93
|
+
return null; // Don't send any response for notifications
|
|
94
|
+
}
|
|
95
|
+
if (responseData && responseData.jsonrpc === '2.0' && ('result' in responseData || 'error' in responseData)) {
|
|
96
|
+
// The HTTP service returned a complete MCP response, but ensure ID matches
|
|
97
|
+
const finalResponse = {
|
|
98
|
+
...responseData,
|
|
99
|
+
id: request.id // Ensure ID matches the request
|
|
100
|
+
};
|
|
101
|
+
if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
102
|
+
console.error(`[Bridge] Returning formatted response: ${JSON.stringify(finalResponse)}`);
|
|
103
|
+
}
|
|
104
|
+
return finalResponse;
|
|
105
|
+
}
|
|
106
|
+
// Otherwise, wrap the response data in an MCP result
|
|
107
|
+
const wrappedResponse = {
|
|
64
108
|
jsonrpc: '2.0',
|
|
65
109
|
id: request.id,
|
|
66
|
-
result:
|
|
110
|
+
result: responseData
|
|
67
111
|
};
|
|
112
|
+
if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
113
|
+
console.error(`[Bridge] Returning wrapped response: ${JSON.stringify(wrappedResponse)}`);
|
|
114
|
+
}
|
|
115
|
+
return wrappedResponse;
|
|
68
116
|
}
|
|
69
117
|
catch (error) {
|
|
70
118
|
return this.createErrorResponse(request.id, error);
|
|
@@ -81,7 +129,7 @@ export class MCPHttpBridge {
|
|
|
81
129
|
catch (error) {
|
|
82
130
|
lastError = error;
|
|
83
131
|
// If it's not a retryable error (4xx), fail immediately
|
|
84
|
-
if (error.response
|
|
132
|
+
if (error.response && error.response.status >= 400 && error.response.status < 500) {
|
|
85
133
|
throw error;
|
|
86
134
|
}
|
|
87
135
|
// Only retry on 5xx server errors or network issues
|
|
@@ -121,7 +169,25 @@ export class MCPHttpBridge {
|
|
|
121
169
|
};
|
|
122
170
|
}
|
|
123
171
|
sendResponse(response) {
|
|
124
|
-
|
|
172
|
+
try {
|
|
173
|
+
if (!process.stdout.destroyed) {
|
|
174
|
+
// Add debug logging to see what we're actually sending
|
|
175
|
+
if (process.env.MCP_BRIDGE_VERBOSE === 'true') {
|
|
176
|
+
console.error(`[Bridge] Sending response: ${JSON.stringify(response)}`);
|
|
177
|
+
}
|
|
178
|
+
process.stdout.write(JSON.stringify(response) + '\n');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
if (error.code === 'EPIPE' || error.message.includes('stream was destroyed')) {
|
|
183
|
+
// Client disconnected, ignore silently
|
|
184
|
+
console.error('[Bridge] Client disconnected, stopping bridge');
|
|
185
|
+
process.exit(0);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
console.error(`[Bridge] Error writing response: ${error.message}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
125
191
|
}
|
|
126
192
|
sleep(ms) {
|
|
127
193
|
return new Promise(resolve => setTimeout(resolve, ms));
|
package/dist/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":";AAEA,OAAO,KAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":";AAEA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,MAAM,OAAO,aAAa;IAIxB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,MAAM,WAAW,GAAQ;YACvB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,MAAM,CAAC,WAAW,EAAE;gBAC/C,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC;QAEF,wCAAwC;QACxC,IAAI,MAAM,CAAC,kBAAkB,KAAK,KAAK,EAAE,CAAC;YACxC,WAAW,CAAC,UAAU,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC;gBACvC,kBAAkB,EAAE,KAAK;aAC1B,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAElC,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,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vD,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,EAAE,CAAC;oBAC9C,OAAO,CAAC,KAAK,CAAC,8BAA8B,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBAC1E,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;gBAC7E,uCAAuC;gBACvC,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;gBAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,EAAU;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;IAEO,QAAQ;QACd,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF"}
|
package/dist/cli.js
CHANGED
|
@@ -30,6 +30,11 @@ const argv = yargs(hideBin(process.argv))
|
|
|
30
30
|
type: 'boolean',
|
|
31
31
|
default: false,
|
|
32
32
|
description: 'Enable verbose logging'
|
|
33
|
+
})
|
|
34
|
+
.option('insecure', {
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
default: false,
|
|
37
|
+
description: 'Disable SSL certificate verification (for development)'
|
|
33
38
|
})
|
|
34
39
|
.help()
|
|
35
40
|
.alias('help', 'h')
|
|
@@ -48,7 +53,8 @@ async function main() {
|
|
|
48
53
|
endpoint: argv.endpoint,
|
|
49
54
|
bearerToken: argv.token,
|
|
50
55
|
timeout: argv.timeout || 30000,
|
|
51
|
-
retries: argv.retries || 3
|
|
56
|
+
retries: argv.retries || 3,
|
|
57
|
+
rejectUnauthorized: !argv.insecure
|
|
52
58
|
});
|
|
53
59
|
await bridge.start();
|
|
54
60
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAW5C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACtC,MAAM,CAAC,UAAU,EAAE;IAClB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,mCAAmC;CACjD,CAAC;KACD,MAAM,CAAC,OAAO,EAAE;IACf,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,iCAAiC;CAC/C,CAAC;KACD,MAAM,CAAC,SAAS,EAAE;IACjB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,iCAAiC;CAC/C,CAAC;KAC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;SACnC,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAEvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbletools/mcp-http-bridge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Bridge MCP stdio protocol to HTTP-based MCP services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"prepublishOnly": "npm run build"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
|
-
"mcp",
|
|
18
|
-
"model-context-protocol",
|
|
19
|
-
"http",
|
|
20
|
-
"bridge",
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"http",
|
|
20
|
+
"bridge",
|
|
21
21
|
"claude-code",
|
|
22
22
|
"stdio",
|
|
23
23
|
"json-rpc"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"LICENSE"
|
|
41
41
|
],
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=20.0.0",
|
|
44
44
|
"npm": ">=10.0.0"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|