native-devtools-mcp 0.1.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.
Files changed (2) hide show
  1. package/bin/cli.js +71 -0
  2. package/package.json +33 -0
package/bin/cli.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require("child_process");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+
7
+ const PLATFORMS = {
8
+ "darwin-arm64": "@sh3ll3x3c/native-devtools-mcp-darwin-arm64",
9
+ "darwin-x64": "@sh3ll3x3c/native-devtools-mcp-darwin-x64",
10
+ };
11
+
12
+ function getPlatformPackage() {
13
+ const platform = process.platform;
14
+ const arch = process.arch;
15
+ const key = `${platform}-${arch}`;
16
+
17
+ const pkg = PLATFORMS[key];
18
+ if (!pkg) {
19
+ console.error(`Unsupported platform: ${platform}-${arch}`);
20
+ console.error("native-devtools-mcp supports: darwin-arm64, darwin-x64");
21
+ process.exit(1);
22
+ }
23
+
24
+ return pkg;
25
+ }
26
+
27
+ function findBinary() {
28
+ const platform = process.platform;
29
+ const arch = process.arch;
30
+ const platformDir = `${platform}-${arch}`;
31
+ const pkg = getPlatformPackage();
32
+
33
+ // Try to find the platform-specific package
34
+ const possiblePaths = [
35
+ // Local development (binary in sibling directory)
36
+ path.join(__dirname, "..", platformDir, "bin", "native-devtools-mcp"),
37
+ // When installed as a dependency
38
+ path.join(__dirname, "..", "node_modules", pkg, "bin", "native-devtools-mcp"),
39
+ // When installed globally or via npx
40
+ path.join(__dirname, "..", "..", pkg, "bin", "native-devtools-mcp"),
41
+ // Hoisted in node_modules
42
+ path.join(__dirname, "..", "..", "..", pkg, "bin", "native-devtools-mcp"),
43
+ ];
44
+
45
+ for (const binPath of possiblePaths) {
46
+ if (fs.existsSync(binPath)) {
47
+ return binPath;
48
+ }
49
+ }
50
+
51
+ console.error(`Could not find binary for ${pkg}`);
52
+ console.error("Searched paths:");
53
+ possiblePaths.forEach((p) => console.error(` - ${p}`));
54
+ console.error("\nTry reinstalling: npm install -g native-devtools-mcp");
55
+ process.exit(1);
56
+ }
57
+
58
+ const binaryPath = findBinary();
59
+
60
+ const child = spawn(binaryPath, process.argv.slice(2), {
61
+ stdio: "inherit",
62
+ });
63
+
64
+ child.on("error", (err) => {
65
+ console.error(`Failed to start native-devtools-mcp: ${err.message}`);
66
+ process.exit(1);
67
+ });
68
+
69
+ child.on("close", (code) => {
70
+ process.exit(code ?? 0);
71
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "native-devtools-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for testing native desktop applications",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/anthropics/native-devtools-mcp.git"
9
+ },
10
+ "homepage": "https://github.com/anthropics/native-devtools-mcp",
11
+ "keywords": [
12
+ "mcp",
13
+ "model-context-protocol",
14
+ "devtools",
15
+ "desktop",
16
+ "testing",
17
+ "automation",
18
+ "macos"
19
+ ],
20
+ "bin": {
21
+ "native-devtools-mcp": "bin/cli.js"
22
+ },
23
+ "files": [
24
+ "bin"
25
+ ],
26
+ "optionalDependencies": {
27
+ "@sh3ll3x3c/native-devtools-mcp-darwin-arm64": "0.1.0",
28
+ "@sh3ll3x3c/native-devtools-mcp-darwin-x64": "0.1.0"
29
+ },
30
+ "engines": {
31
+ "node": ">=18"
32
+ }
33
+ }