munim-computer-use 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.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # munim-computer-use
2
+
3
+ npm launcher for [Computer Use](https://github.com/munimtechnologies/computer-use), the open-source Computer Use MCP server by Munim Technologies. On first run it downloads the signed native binary for your platform from GitHub Releases and starts it over stdio.
4
+
5
+ ```sh
6
+ claude mcp add computer-use -- npx -y munim-computer-use
7
+ ```
8
+
9
+ macOS (universal) and Windows x64 are prebuilt. On Linux build from source and set `COMPUTER_USE_BINARY` to the result. Full documentation: https://github.com/munimtechnologies/computer-use
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ // Launcher for the Computer Use MCP server.
3
+ //
4
+ // The server itself is a native binary (Swift on macOS, Rust on Windows and
5
+ // Linux). npm is the distribution channel MCP clients already know how to run,
6
+ // so this script fetches the signed release binary that matches this package's
7
+ // version into a per-user cache on first run, then execs it with stdio passed
8
+ // straight through — the MCP conversation never touches Node.
9
+ "use strict";
10
+
11
+ const fs = require("node:fs");
12
+ const os = require("node:os");
13
+ const path = require("node:path");
14
+ const { spawn, spawnSync } = require("node:child_process");
15
+
16
+ const pkg = require("../package.json");
17
+ const REPO = "munimtechnologies/computer-use";
18
+ const VERSION = pkg.version;
19
+
20
+ function assetFor(platform, arch) {
21
+ if (platform === "darwin") return { asset: "computer-use-macos-universal.zip", binary: "computer-use" };
22
+ if (platform === "win32" && arch === "x64") return { asset: "computer-use-windows-x64.zip", binary: "computer-use.exe" };
23
+ return null;
24
+ }
25
+
26
+ function cacheDir() {
27
+ const base =
28
+ process.env.COMPUTER_USE_CACHE_DIR ||
29
+ (process.platform === "win32"
30
+ ? path.join(process.env.LOCALAPPDATA || os.homedir(), "munim-computer-use")
31
+ : path.join(process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache"), "munim-computer-use"));
32
+ return path.join(base, VERSION);
33
+ }
34
+
35
+ async function download(url, dest) {
36
+ const res = await fetch(url, { redirect: "follow" });
37
+ if (!res.ok) throw new Error(`download failed: ${res.status} ${res.statusText} for ${url}`);
38
+ const bytes = Buffer.from(await res.arrayBuffer());
39
+ fs.writeFileSync(dest, bytes);
40
+ }
41
+
42
+ function extractZip(zipPath, dir) {
43
+ // bsdtar on macOS and tar.exe on Windows 10+ both open zip archives, so no
44
+ // dependency is needed for the two platforms that get prebuilt binaries.
45
+ const result = spawnSync("tar", ["-xf", zipPath, "-C", dir], { stdio: "inherit" });
46
+ if (result.status !== 0) throw new Error("could not extract the release archive with tar");
47
+ }
48
+
49
+ async function ensureBinary() {
50
+ const target = assetFor(process.platform, process.arch);
51
+ if (!target) {
52
+ console.error(
53
+ `munim-computer-use: no prebuilt binary for ${process.platform}/${process.arch}.\n` +
54
+ `Build from source: https://github.com/${REPO}#build-from-source\n` +
55
+ `then point COMPUTER_USE_BINARY at the result.`,
56
+ );
57
+ process.exit(1);
58
+ }
59
+ const override = process.env.COMPUTER_USE_BINARY;
60
+ if (override) return override;
61
+
62
+ const dir = cacheDir();
63
+ const binary = path.join(dir, target.binary);
64
+ if (fs.existsSync(binary)) return binary;
65
+
66
+ fs.mkdirSync(dir, { recursive: true });
67
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${target.asset}`;
68
+ const zipPath = path.join(dir, target.asset);
69
+ console.error(`munim-computer-use: downloading ${target.asset} (v${VERSION})…`);
70
+ await download(url, zipPath);
71
+ extractZip(zipPath, dir);
72
+ fs.rmSync(zipPath, { force: true });
73
+ if (!fs.existsSync(binary)) throw new Error(`archive did not contain ${target.binary}`);
74
+ if (process.platform !== "win32") fs.chmodSync(binary, 0o755);
75
+ return binary;
76
+ }
77
+
78
+ async function main() {
79
+ const binary = await ensureBinary();
80
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
81
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
82
+ process.on(signal, () => child.kill(signal));
83
+ }
84
+ child.on("exit", (code, signal) => {
85
+ if (signal) process.kill(process.pid, signal);
86
+ process.exit(code ?? 0);
87
+ });
88
+ child.on("error", (error) => {
89
+ console.error(`munim-computer-use: could not start ${binary}: ${error.message}`);
90
+ process.exit(1);
91
+ });
92
+ }
93
+
94
+ main().catch((error) => {
95
+ console.error(`munim-computer-use: ${error.message}`);
96
+ process.exit(1);
97
+ });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "munim-computer-use",
3
+ "version": "0.1.0",
4
+ "description": "Computer Use MCP server for any coding agent — accessibility-first desktop control on macOS, Windows and Linux, background input, agent pointer, zoom, your signed-in Chrome. Downloads the signed native binary from GitHub Releases on first run.",
5
+ "mcpName": "io.github.munimtechnologies/computer-use",
6
+ "license": "Apache-2.0",
7
+ "author": "Munim Technologies, Inc.",
8
+ "homepage": "https://munimtech.com/computer-use",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/munimtechnologies/computer-use.git"
12
+ },
13
+ "bugs": "https://github.com/munimtechnologies/computer-use/issues",
14
+ "keywords": [
15
+ "mcp",
16
+ "mcp-server",
17
+ "model-context-protocol",
18
+ "computer-use",
19
+ "desktop-automation",
20
+ "accessibility",
21
+ "claude-code",
22
+ "codex",
23
+ "cursor",
24
+ "agents"
25
+ ],
26
+ "bin": {
27
+ "computer-use": "bin/computer-use.js"
28
+ },
29
+ "files": [
30
+ "bin"
31
+ ],
32
+ "engines": {
33
+ "node": ">=18"
34
+ }
35
+ }