waxmcp 0.1.2
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 +34 -0
- package/bin/waxmcp.js +73 -0
- package/dist/darwin-arm64/WaxCLI +0 -0
- package/dist/darwin-x64/WaxCLI +0 -0
- package/package.json +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# waxmcp
|
|
2
|
+
|
|
3
|
+
`waxmcp` is an npm launcher for the Wax MCP server.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx -y waxmcp@latest mcp serve
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
To publish a new version:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cd /path/to/Wax/npm/waxmcp
|
|
15
|
+
npm version patch # or minor/major/1.2.3
|
|
16
|
+
npm publish --access public
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
By default, the launcher uses this order:
|
|
20
|
+
|
|
21
|
+
1. `$WAX_CLI_BIN`
|
|
22
|
+
2. Bundled `dist/darwin-arm64/WaxCLI` or `dist/darwin-x64/WaxCLI`
|
|
23
|
+
3. `wax`
|
|
24
|
+
4. `WaxCLI`
|
|
25
|
+
5. `./.build/debug/WaxCLI` (current working directory)
|
|
26
|
+
|
|
27
|
+
## Local development
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
cd /path/to/Wax
|
|
31
|
+
swift build --product WaxCLI --traits MCPServer
|
|
32
|
+
export WAX_CLI_BIN=/path/to/Wax/.build/debug/WaxCLI
|
|
33
|
+
npx --yes ./npm/waxmcp mcp doctor
|
|
34
|
+
```
|
package/bin/waxmcp.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const os = require("node:os");
|
|
6
|
+
const fs = require("node:fs");
|
|
7
|
+
|
|
8
|
+
const forwardedArgs = process.argv.slice(2);
|
|
9
|
+
const args = forwardedArgs.length > 0 ? forwardedArgs : ["mcp", "serve"];
|
|
10
|
+
|
|
11
|
+
function isExecutable(filePath) {
|
|
12
|
+
try {
|
|
13
|
+
fs.accessSync(filePath, fs.constants.X_OK);
|
|
14
|
+
return true;
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function resolveBundledBinary() {
|
|
21
|
+
if (os.platform() !== "darwin") {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const arch = os.arch();
|
|
26
|
+
const mappedArch = arch === "x64" ? "x64" : arch === "arm64" ? "arm64" : null;
|
|
27
|
+
if (!mappedArch) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return path.join(__dirname, "..", "dist", `darwin-${mappedArch}`, "WaxCLI");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const candidates = [];
|
|
35
|
+
if (process.env.WAX_CLI_BIN) {
|
|
36
|
+
candidates.push(process.env.WAX_CLI_BIN);
|
|
37
|
+
}
|
|
38
|
+
const bundledBinary = resolveBundledBinary();
|
|
39
|
+
if (bundledBinary) {
|
|
40
|
+
candidates.push(bundledBinary);
|
|
41
|
+
}
|
|
42
|
+
candidates.push("wax");
|
|
43
|
+
candidates.push("WaxCLI");
|
|
44
|
+
candidates.push(path.join(process.cwd(), ".build", "debug", "WaxCLI"));
|
|
45
|
+
|
|
46
|
+
for (const command of candidates) {
|
|
47
|
+
if (path.isAbsolute(command) && !isExecutable(command)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const result = spawnSync(command, args, {
|
|
51
|
+
stdio: "inherit",
|
|
52
|
+
env: process.env,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (result.error && result.error.code === "ENOENT") {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (result.error) {
|
|
60
|
+
console.error(`waxmcp: failed to launch '${command}': ${result.error.message}`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.error("waxmcp: no Wax CLI found.");
|
|
68
|
+
console.error("Install and build WaxCLI, or set WAX_CLI_BIN to the WaxCLI executable path.");
|
|
69
|
+
console.error("Example:");
|
|
70
|
+
console.error(" export WAX_CLI_BIN=/path/to/Wax/.build/debug/WaxCLI");
|
|
71
|
+
console.error(" npx -y waxmcp@latest mcp serve");
|
|
72
|
+
console.error("If using the published waxmcp package, packaged binaries are at dist/darwin-arm64 and dist/darwin-x64.");
|
|
73
|
+
process.exit(1);
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "waxmcp",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "npx launcher for the Wax MCP server",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/christopherkarani/Wax.git"
|
|
8
|
+
},
|
|
9
|
+
"os": [
|
|
10
|
+
"darwin"
|
|
11
|
+
],
|
|
12
|
+
"cpu": [
|
|
13
|
+
"arm64",
|
|
14
|
+
"x64"
|
|
15
|
+
],
|
|
16
|
+
"bin": {
|
|
17
|
+
"waxmcp": "bin/waxmcp.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT"
|
|
28
|
+
}
|