mcp-tap 0.3.0
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/bin/mcp-tap.js +69 -0
- package/package.json +34 -0
package/bin/mcp-tap.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* mcp-tap npm wrapper — thin shim that delegates to the Python package via uvx.
|
|
5
|
+
*
|
|
6
|
+
* This allows `npx mcp-tap` to work for users who expect npm-style MCP servers.
|
|
7
|
+
* The actual implementation lives in the Python package (PyPI: mcp-tap).
|
|
8
|
+
*
|
|
9
|
+
* Resolution order:
|
|
10
|
+
* 1. uvx (preferred — uv's tool runner, fast and isolated)
|
|
11
|
+
* 2. pipx run (fallback — common Python tool runner)
|
|
12
|
+
* 3. python -m mcp_tap (last resort — requires prior pip install)
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
"use strict";
|
|
16
|
+
|
|
17
|
+
const { spawn, execFileSync } = require("child_process");
|
|
18
|
+
|
|
19
|
+
function commandExists(cmd) {
|
|
20
|
+
try {
|
|
21
|
+
execFileSync(process.platform === "win32" ? "where" : "which", [cmd], {
|
|
22
|
+
stdio: "ignore",
|
|
23
|
+
});
|
|
24
|
+
return true;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function run(command, args) {
|
|
31
|
+
const child = spawn(command, args, {
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
shell: false,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
child.on("error", (err) => {
|
|
37
|
+
process.stderr.write(
|
|
38
|
+
`mcp-tap: failed to start '${command}': ${err.message}\n`
|
|
39
|
+
);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
child.on("close", (code) => {
|
|
44
|
+
process.exit(code ?? 1);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Forward all CLI args after the script name
|
|
49
|
+
const userArgs = process.argv.slice(2);
|
|
50
|
+
|
|
51
|
+
if (commandExists("uvx")) {
|
|
52
|
+
run("uvx", ["mcp-tap", ...userArgs]);
|
|
53
|
+
} else if (commandExists("pipx")) {
|
|
54
|
+
run("pipx", ["run", "mcp-tap", ...userArgs]);
|
|
55
|
+
} else if (commandExists("python3")) {
|
|
56
|
+
run("python3", ["-m", "mcp_tap", ...userArgs]);
|
|
57
|
+
} else if (commandExists("python")) {
|
|
58
|
+
run("python", ["-m", "mcp_tap", ...userArgs]);
|
|
59
|
+
} else {
|
|
60
|
+
process.stderr.write(
|
|
61
|
+
"mcp-tap: Python runtime not found.\n" +
|
|
62
|
+
"\n" +
|
|
63
|
+
"mcp-tap requires Python 3.11+ to run. Install one of:\n" +
|
|
64
|
+
" - uv (recommended): https://docs.astral.sh/uv/getting-started/installation/\n" +
|
|
65
|
+
" - pipx: https://pipx.pypa.io/stable/installation/\n" +
|
|
66
|
+
" - Python: https://www.python.org/downloads/\n"
|
|
67
|
+
);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-tap",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "The last MCP server you install by hand. Discover, install, and configure MCP servers from inside your AI assistant.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"ai",
|
|
9
|
+
"tools",
|
|
10
|
+
"discovery",
|
|
11
|
+
"mcp-server"
|
|
12
|
+
],
|
|
13
|
+
"author": "Felipe Stenzel",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/felipestenzel/mcp-tap.git"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/felipestenzel/mcp-tap",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/felipestenzel/mcp-tap/issues"
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"mcp-tap": "./bin/mcp-tap.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin/",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
}
|
|
34
|
+
}
|