mcp-compose 0.0.8 → 0.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 +16 -14
- package/dist/bin/mcp-compose.js +8 -8
- package/dist/bin/mcp-compose.js.map +1 -1
- package/dist/bin/mcp-gateway.d.ts +3 -0
- package/dist/bin/mcp-gateway.d.ts.map +1 -0
- package/dist/bin/mcp-gateway.js +41 -0
- package/dist/bin/mcp-gateway.js.map +1 -0
- package/dist/package.json +4 -3
- package/dist/src/command.d.ts +4 -0
- package/dist/src/command.d.ts.map +1 -0
- package/dist/src/command.js +66 -0
- package/dist/src/command.js.map +1 -0
- package/dist/src/config.d.ts +2 -2
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +8 -18
- package/dist/src/config.js.map +1 -1
- package/dist/src/gateway.d.ts +22 -0
- package/dist/src/gateway.d.ts.map +1 -0
- package/dist/src/gateway.js +450 -0
- package/dist/src/gateway.js.map +1 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/oauth.d.ts +37 -0
- package/dist/src/oauth.d.ts.map +1 -0
- package/dist/src/oauth.js +317 -0
- package/dist/src/oauth.js.map +1 -0
- package/dist/src/pm2.d.ts +2 -2
- package/dist/src/pm2.d.ts.map +1 -1
- package/dist/src/pm2.js +17 -26
- package/dist/src/pm2.js.map +1 -1
- package/dist/src/sync.js +1 -1
- package/dist/src/sync.js.map +1 -1
- package/dist/src/types.d.ts +15 -2
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/src/supergateway.d.ts +0 -5
- package/dist/src/supergateway.d.ts.map +0 -1
- package/dist/src/supergateway.js +0 -61
- package/dist/src/supergateway.js.map +0 -1
package/dist/src/supergateway.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import { expandPath } from './config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Install an npm package (if needed) and return the resolved binary path.
|
|
5
|
-
* Uses npx to install, then resolves the real path so pm2 can launch
|
|
6
|
-
* the binary directly without the npx wrapper process.
|
|
7
|
-
*/
|
|
8
|
-
function resolveNpxBinary(packageName) {
|
|
9
|
-
const binName = packageName.replace(/@.*$/, '');
|
|
10
|
-
const bin = execSync(`npx -y -p ${packageName} -c "which ${binName}"`, {
|
|
11
|
-
encoding: 'utf-8',
|
|
12
|
-
timeout: 60_000,
|
|
13
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
14
|
-
}).trim();
|
|
15
|
-
if (!bin) {
|
|
16
|
-
throw new Error(`Failed to resolve ${binName} binary path`);
|
|
17
|
-
}
|
|
18
|
-
return bin;
|
|
19
|
-
}
|
|
20
|
-
export function resolveSupergatewayBin() {
|
|
21
|
-
return resolveNpxBinary('supergateway@latest');
|
|
22
|
-
}
|
|
23
|
-
export function resolveMcpRemoteBin() {
|
|
24
|
-
return resolveNpxBinary('mcp-remote@latest');
|
|
25
|
-
}
|
|
26
|
-
export function buildSupergatewayCmdForServer(server, supergatewayBin) {
|
|
27
|
-
const { command, args, internalPort, logLevel } = server;
|
|
28
|
-
const stdioCmd = buildStdioCommand(command, args);
|
|
29
|
-
return {
|
|
30
|
-
script: supergatewayBin,
|
|
31
|
-
args: [
|
|
32
|
-
'--stdio',
|
|
33
|
-
stdioCmd,
|
|
34
|
-
'--outputTransport',
|
|
35
|
-
'streamableHttp',
|
|
36
|
-
'--port',
|
|
37
|
-
String(internalPort),
|
|
38
|
-
'--logLevel',
|
|
39
|
-
logLevel,
|
|
40
|
-
'--stateful',
|
|
41
|
-
],
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function buildStdioCommand(command, args) {
|
|
45
|
-
const expandedArgs = args.map((arg) => {
|
|
46
|
-
if (arg.includes('~')) {
|
|
47
|
-
return expandPath(arg);
|
|
48
|
-
}
|
|
49
|
-
return arg;
|
|
50
|
-
});
|
|
51
|
-
const allParts = [command, ...expandedArgs];
|
|
52
|
-
return allParts
|
|
53
|
-
.map((part) => {
|
|
54
|
-
if (/[\s"'\\]/.test(part)) {
|
|
55
|
-
return `"${part.replace(/["\\]/g, '\\$&')}"`;
|
|
56
|
-
}
|
|
57
|
-
return part;
|
|
58
|
-
})
|
|
59
|
-
.join(' ');
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=supergateway.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supergateway.js","sourceRoot":"","sources":["../../src/supergateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,WAAmB;IAC3C,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,WAAW,cAAc,OAAO,GAAG,EAAE;QACrE,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;KACpC,CAAC,CAAC,IAAI,EAAE,CAAC;IAEV,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,qBAAqB,OAAO,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,MAAmB,EAAE,eAAuB;IACxF,MAAM,EAAE,OAAO,EAAE,IAAI,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