mcpbundles 1.5.22
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 +21 -0
- package/README.md +33 -0
- package/bin/mcpbundles.js +106 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tony Lewis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# MCPBundles CLI
|
|
2
|
+
|
|
3
|
+
Connect AI agents to MCP tools from the command line.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g mcpbundles
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or run without a global install:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx mcpbundles --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The npm package is a launcher for the official Python CLI published on PyPI. On first run, it creates a versioned virtual environment under `~/.mcpbundles/npm/` and installs the matching `mcpbundles` PyPI release.
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- Node.js 18+
|
|
22
|
+
- Python 3.10+
|
|
23
|
+
|
|
24
|
+
## Common Commands
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
mcpbundles login
|
|
28
|
+
mcpbundles tools
|
|
29
|
+
mcpbundles call <tool-name> -- key=value
|
|
30
|
+
mcpbundles proxy start
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Full docs: https://www.mcpbundles.com/docs/how-to/cli
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const fs = require("node:fs");
|
|
6
|
+
const os = require("node:os");
|
|
7
|
+
const path = require("node:path");
|
|
8
|
+
|
|
9
|
+
const packageJson = require("../package.json");
|
|
10
|
+
|
|
11
|
+
const PYPI_PACKAGE = "mcpbundles";
|
|
12
|
+
const CACHE_ROOT = process.env.MCPBUNDLES_NPM_CACHE
|
|
13
|
+
|| path.join(os.homedir(), ".mcpbundles", "npm");
|
|
14
|
+
const VENV_DIR = path.join(CACHE_ROOT, `mcpbundles-${packageJson.version}`);
|
|
15
|
+
|
|
16
|
+
function run(command, args, options = {}) {
|
|
17
|
+
return spawnSync(command, args, {
|
|
18
|
+
stdio: options.stdio || "inherit",
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
...options,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function pythonExecutable(venvDir) {
|
|
25
|
+
if (process.platform === "win32") {
|
|
26
|
+
return path.join(venvDir, "Scripts", "python.exe");
|
|
27
|
+
}
|
|
28
|
+
return path.join(venvDir, "bin", "python");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function findPython() {
|
|
32
|
+
const candidates = [
|
|
33
|
+
process.env.MCPBUNDLES_PYTHON,
|
|
34
|
+
"python3",
|
|
35
|
+
"python",
|
|
36
|
+
].filter(Boolean);
|
|
37
|
+
|
|
38
|
+
for (const candidate of candidates) {
|
|
39
|
+
const result = run(
|
|
40
|
+
candidate,
|
|
41
|
+
["-c", "import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)"],
|
|
42
|
+
{ stdio: "ignore" },
|
|
43
|
+
);
|
|
44
|
+
if (result.status === 0) {
|
|
45
|
+
return candidate;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function installedVersion(python) {
|
|
52
|
+
const result = run(
|
|
53
|
+
python,
|
|
54
|
+
[
|
|
55
|
+
"-c",
|
|
56
|
+
"from importlib.metadata import version; print(version('mcpbundles'))",
|
|
57
|
+
],
|
|
58
|
+
{ stdio: "pipe" },
|
|
59
|
+
);
|
|
60
|
+
if (result.status !== 0) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return String(result.stdout || "").trim();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function ensureCliInstalled() {
|
|
67
|
+
const venvPython = pythonExecutable(VENV_DIR);
|
|
68
|
+
if (fs.existsSync(venvPython) && installedVersion(venvPython) === packageJson.version) {
|
|
69
|
+
return venvPython;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const systemPython = findPython();
|
|
73
|
+
if (!systemPython) {
|
|
74
|
+
console.error("mcpbundles npm install requires Python 3.10+ on PATH.");
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
fs.mkdirSync(CACHE_ROOT, { recursive: true });
|
|
79
|
+
console.error(`Installing ${PYPI_PACKAGE} ${packageJson.version} for npm launcher...`);
|
|
80
|
+
|
|
81
|
+
let result = run(systemPython, ["-m", "venv", VENV_DIR]);
|
|
82
|
+
if (result.status !== 0) {
|
|
83
|
+
process.exit(result.status || 1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
result = run(venvPython, [
|
|
87
|
+
"-m",
|
|
88
|
+
"pip",
|
|
89
|
+
"--disable-pip-version-check",
|
|
90
|
+
"install",
|
|
91
|
+
`${PYPI_PACKAGE}==${packageJson.version}`,
|
|
92
|
+
]);
|
|
93
|
+
if (result.status !== 0) {
|
|
94
|
+
process.exit(result.status || 1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return venvPython;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const python = ensureCliInstalled();
|
|
101
|
+
const result = run(python, ["-m", "mcpbundles.cli", ...process.argv.slice(2)]);
|
|
102
|
+
|
|
103
|
+
if (result.signal) {
|
|
104
|
+
process.kill(process.pid, result.signal);
|
|
105
|
+
}
|
|
106
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcpbundles",
|
|
3
|
+
"version": "1.5.22",
|
|
4
|
+
"description": "MCPBundles CLI - connect AI to MCP tools from the command line",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://www.mcpbundles.com",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/thinkchainai/mcpbundles-proxy.git",
|
|
10
|
+
"directory": "npm"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/thinkchainai/mcpbundles/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mcp",
|
|
17
|
+
"mcpbundles",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"ai",
|
|
20
|
+
"cli",
|
|
21
|
+
"tools"
|
|
22
|
+
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"mcpbundles": "bin/mcpbundles.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin/",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"smoke": "node ./bin/mcpbundles.js --version",
|
|
40
|
+
"pack:dry": "npm pack --dry-run"
|
|
41
|
+
}
|
|
42
|
+
}
|