@luutuankiet/mcp-proxy-shim 1.0.8 → 1.1.1
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 +260 -24
- package/dist/core.js +165 -18
- package/dist/core.js.map +1 -1
- package/dist/daemon.d.ts +45 -0
- package/dist/daemon.js +608 -0
- package/dist/daemon.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +30 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -12
package/dist/index.js
CHANGED
|
@@ -5,14 +5,19 @@
|
|
|
5
5
|
* Subcommands:
|
|
6
6
|
* (default) stdio transport — for local MCP clients (Claude Code, Cursor, etc.)
|
|
7
7
|
* serve HTTP Streamable transport — for remote agents over HTTP
|
|
8
|
+
* daemon Multi-server MCP gateway — connects to N upstreams, exposes via HTTP
|
|
8
9
|
*
|
|
9
10
|
* Usage:
|
|
10
|
-
* # Stdio mode (default)
|
|
11
|
+
* # Stdio mode (default) — single upstream via mcpproxy-go
|
|
11
12
|
* MCP_URL="https://proxy.example.com/mcp/?apikey=KEY" npx @luutuankiet/mcp-proxy-shim
|
|
12
13
|
*
|
|
13
|
-
* # HTTP server mode
|
|
14
|
+
* # HTTP server mode — single upstream via mcpproxy-go
|
|
14
15
|
* MCP_URL="https://proxy.example.com/mcp/?apikey=KEY" npx @luutuankiet/mcp-proxy-shim serve
|
|
15
|
-
*
|
|
16
|
+
*
|
|
17
|
+
* # Daemon mode — multi-server gateway (stdio + HTTP upstreams)
|
|
18
|
+
* MCP_SERVERS='{"github":{"type":"stdio","command":"npx","args":["-y","@modelcontextprotocol/server-github"]}}' \
|
|
19
|
+
* npx @luutuankiet/mcp-proxy-shim daemon
|
|
20
|
+
* MCP_CONFIG=./mcp-servers.json npx @luutuankiet/mcp-proxy-shim daemon
|
|
16
21
|
*
|
|
17
22
|
* .mcp.json entry (stdio):
|
|
18
23
|
* { "mcpServers": { "proxy": { "type": "stdio", "command": "npx", "args": ["-y", "@luutuankiet/mcp-proxy-shim"], "env": { "MCP_URL": "..." } } } }
|
|
@@ -22,29 +27,46 @@ const subcommand = process.argv[2];
|
|
|
22
27
|
if (subcommand === "--help" || subcommand === "-h") {
|
|
23
28
|
console.log("mcp-proxy-shim — MCP proxy with schema transforms");
|
|
24
29
|
console.log("");
|
|
25
|
-
console.log("Usage: mcp-proxy-shim [serve]");
|
|
30
|
+
console.log("Usage: mcp-proxy-shim [serve|daemon]");
|
|
26
31
|
console.log("");
|
|
27
32
|
console.log("Subcommands:");
|
|
28
|
-
console.log(" (default) stdio transport for local MCP clients");
|
|
29
|
-
console.log(" serve HTTP Streamable server for remote agents");
|
|
33
|
+
console.log(" (default) stdio transport for local MCP clients (requires MCP_URL)");
|
|
34
|
+
console.log(" serve HTTP Streamable server for remote agents (requires MCP_URL)");
|
|
35
|
+
console.log(" daemon Multi-server MCP gateway — pure passthrough, no transforms");
|
|
30
36
|
console.log("");
|
|
31
|
-
console.log("Environment variables:");
|
|
37
|
+
console.log("Environment variables (default/serve modes):");
|
|
32
38
|
console.log(" MCP_URL (required) upstream mcpproxy-go endpoint");
|
|
33
39
|
console.log(" MCP_PORT (serve only) port to listen on (default: 3000)");
|
|
34
40
|
console.log(" MCP_HOST (serve only) host to bind to (default: 0.0.0.0)");
|
|
35
41
|
console.log(" MCP_APIKEY (serve only) require ?apikey=KEY on /mcp requests");
|
|
36
42
|
console.log(" https_proxy HTTPS proxy for upstream connection");
|
|
43
|
+
console.log("");
|
|
44
|
+
console.log("Environment variables (daemon mode):");
|
|
45
|
+
console.log(" MCP_SERVERS JSON string with server configs (inline)");
|
|
46
|
+
console.log(" MCP_CONFIG Path to JSON config file (alternative to MCP_SERVERS)");
|
|
47
|
+
console.log(" MCP_PORT Port to listen on (default: 3456)");
|
|
48
|
+
console.log(" MCP_HOST Host to bind to (default: 0.0.0.0)");
|
|
49
|
+
console.log(" MCP_APIKEY Require ?apikey=KEY on /mcp requests (optional)");
|
|
50
|
+
console.log("");
|
|
51
|
+
console.log("Daemon config format (JSON):");
|
|
52
|
+
console.log(' { "server-name": { "type": "stdio", "command": "cmd", "args": [...], "env": {...} } }');
|
|
53
|
+
console.log(' { "server-name": { "type": "streamableHttp", "url": "https://...", "headers": {...} } }');
|
|
37
54
|
process.exit(0);
|
|
38
55
|
}
|
|
39
56
|
if (subcommand === "serve") {
|
|
40
57
|
// Dynamic import — only loads http-server + core when needed
|
|
41
58
|
import("./http-server.js");
|
|
42
59
|
}
|
|
60
|
+
else if (subcommand === "daemon") {
|
|
61
|
+
// Dynamic import — loads daemon mode (no core.ts dependency)
|
|
62
|
+
import("./daemon.js");
|
|
63
|
+
}
|
|
43
64
|
else if (subcommand) {
|
|
44
65
|
console.error(`Unknown subcommand: "${subcommand}"`);
|
|
45
|
-
console.error("Usage: mcp-proxy-shim [serve]");
|
|
66
|
+
console.error("Usage: mcp-proxy-shim [serve|daemon]");
|
|
46
67
|
console.error(" (no args) stdio transport (default)");
|
|
47
68
|
console.error(" serve HTTP Streamable server");
|
|
69
|
+
console.error(" daemon Multi-server MCP gateway");
|
|
48
70
|
process.exit(1);
|
|
49
71
|
}
|
|
50
72
|
else {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEnC,0EAA0E;AAC1E,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC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AI,UAAU,KAAK,OAAO,EAAE,CAAC;IAC3B,6DAA6D;IAC7D,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC7B,CAAC;KAAM,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;IACnC,6DAA6D;IAC7D,MAAM,CAAC,aAAa,CAAC,CAAC;AACxB,CAAC;KAAM,IAAI,UAAU,EAAE,CAAC;IACtB,OAAO,CAAC,KAAK,CAAC,wBAAwB,UAAU,GAAG,CAAC,CAAC;IACrD,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACtD,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;IACxD,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACrD,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;KAAM,CAAC;IACN,sBAAsB;IACtB,MAAM,CAAC,YAAY,CAAC,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luutuankiet/mcp-proxy-shim",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "MCP proxy shim for mcpproxy-go — transforms call_tool_* args_json:string to native args:object. Supports stdio and HTTP Streamable transports.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,23 +25,16 @@
|
|
|
25
25
|
"proxy",
|
|
26
26
|
"shim",
|
|
27
27
|
"stdio",
|
|
28
|
-
"http"
|
|
29
|
-
"streamable-http",
|
|
30
|
-
"model-context-protocol",
|
|
31
|
-
"args-json",
|
|
32
|
-
"schema-transform",
|
|
33
|
-
"claude",
|
|
34
|
-
"llm"
|
|
28
|
+
"http"
|
|
35
29
|
],
|
|
36
30
|
"license": "MIT",
|
|
37
31
|
"repository": {
|
|
38
32
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/luutuankiet/
|
|
40
|
-
"directory": "plugins/mcp-shim"
|
|
33
|
+
"url": "git+https://github.com/luutuankiet/mcp-proxy-shim.git"
|
|
41
34
|
},
|
|
42
|
-
"homepage": "https://github.com/luutuankiet/
|
|
35
|
+
"homepage": "https://github.com/luutuankiet/mcp-proxy-shim#readme",
|
|
43
36
|
"bugs": {
|
|
44
|
-
"url": "https://github.com/luutuankiet/
|
|
37
|
+
"url": "https://github.com/luutuankiet/mcp-proxy-shim/issues"
|
|
45
38
|
},
|
|
46
39
|
"publishConfig": {
|
|
47
40
|
"access": "public"
|