@sanjeever/computer-mcp 0.0.0-stage → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sanjeever
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 CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # Computer MCP
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [简体中文](https://github.com/Sanjeever/computer-mcp/blob/main/README.zh-CN.md)
4
+
5
+ Computer MCP gives AI agents native desktop access over stdio MCP. Agents can observe windows through accessibility trees and screenshots, then click, type, scroll, or drag.
6
+
7
+ ## Drawing a postcard in Freeform
8
+
9
+ ![A lighthouse and orange moon over the sea on a postcard captioned “May you have light along the way”](https://raw.githubusercontent.com/Sanjeever/computer-mcp/main/docs/images/freeform-postcard.png)
10
+
11
+ Codex drew this postcard in macOS Freeform using Computer MCP. [Prompt and example](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.md#drawing-a-postcard-in-freeform)
12
+
13
+ ## Connect
14
+
15
+ Requires **Node.js 22+** and a logged-in graphical session on **macOS 14+ (Apple Silicon)** or **Windows 10/11 (x64)**.
16
+
17
+ ### Codex
18
+
19
+ Add this block to `~/.codex/config.toml`.
20
+
21
+ ```toml
22
+ [mcp_servers.computer]
23
+ command = "npx"
24
+ args = ["-y", "@sanjeever/computer-mcp"]
25
+ ```
26
+
27
+ The connection guide covers Windows launch with `cmd.exe`, language settings, and direct native launch. [Client configuration](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.md#connect)
28
+
29
+ ### Other MCP clients
30
+
31
+ Add this configuration to a client that accepts `mcpServers`.
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "computer": {
37
+ "command": "npx",
38
+ "args": ["-y", "@sanjeever/computer-mcp"]
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Permissions
45
+
46
+ On macOS, grant the host or executable shown by System Settings **Accessibility** and **Screen Recording** access, then restart the MCP process. On Windows, use the target user's interactive session. Windows may block input to elevated apps. [Permission details](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.md#permissions)
47
+
48
+ ## Tools
49
+
50
+ Call `computer_status` to check access. Use `computer_window` to list windows and activate an exact `window_id`, then call `computer_observe`. Use the newest snapshot and its own image coordinates for pointer input. [Tool reference](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.md#tools)
51
+
52
+ [User guide](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.md) · [Development and release](https://github.com/Sanjeever/computer-mcp/blob/main/docs/development.md) · [Releases](https://github.com/Sanjeever/computer-mcp/releases) · [MIT license](https://github.com/Sanjeever/computer-mcp/blob/main/LICENSE)
@@ -0,0 +1,56 @@
1
+ # Computer MCP
2
+
3
+ [English](https://github.com/Sanjeever/computer-mcp/blob/main/README.md)
4
+
5
+ Computer MCP 通过 stdio MCP 为 AI Agent 提供原生桌面操作。Agent 可用无障碍树和截图观察窗口,再点击、输入、滚动或拖拽。
6
+
7
+ ## 用无边记画一张明信片
8
+
9
+ ![明信片「愿你一路有光」,画着海边的灯塔和橙色月亮](https://raw.githubusercontent.com/Sanjeever/computer-mcp/main/docs/images/freeform-postcard.png)
10
+
11
+ Codex 通过 Computer MCP 操作 macOS「无边记」,画出这张明信片。[原始提示词和示例](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.zh-CN.md#用无边记画一张明信片)
12
+
13
+ ## 接入
14
+
15
+ 需要 **Node.js 22+**,支持 **macOS 14+(Apple Silicon)** 和 **Windows 10/11(x64)**。桌面交互需要用户已登录图形会话。
16
+
17
+ ### Codex
18
+
19
+ 在 `~/.codex/config.toml` 中添加以下配置。
20
+
21
+ ```toml
22
+ [mcp_servers.computer]
23
+ command = "npx"
24
+ args = ["-y", "@sanjeever/computer-mcp"]
25
+
26
+ [mcp_servers.computer.env]
27
+ COMPUTER_MCP_LANG = "zh-CN"
28
+ ```
29
+
30
+ 使用指南提供 Windows 的 `cmd.exe` 启动方式、语言设置及直接启动原生程序的配置。[客户端配置](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.zh-CN.md#接入)
31
+
32
+ ### 其他 MCP 客户端
33
+
34
+ 在支持 `mcpServers` 的客户端添加以下配置。
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "computer": {
40
+ "command": "npx",
41
+ "args": ["-y", "@sanjeever/computer-mcp"],
42
+ "env": { "COMPUTER_MCP_LANG": "zh-CN" }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## 权限
49
+
50
+ macOS 在系统设置中为显示的宿主或可执行程序授予**辅助功能**和**屏幕录制**权限,再重启 MCP。Windows 应使用目标用户的交互式会话。系统可能阻止向以管理员权限运行的应用发送输入。[权限说明](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.zh-CN.md#权限)
51
+
52
+ ## 工具
53
+
54
+ 调用 `computer_status` 检查权限与能力。通过 `computer_window` 列出窗口并激活指定 `window_id`,再调用 `computer_observe`。鼠标操作使用最新快照及其对应的图片坐标。[工具说明](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.zh-CN.md#工具)
55
+
56
+ [使用指南](https://github.com/Sanjeever/computer-mcp/blob/main/docs/usage.zh-CN.md) · [开发与发布](https://github.com/Sanjeever/computer-mcp/blob/main/docs/development.zh-CN.md) · [版本发布](https://github.com/Sanjeever/computer-mcp/releases) · [MIT 许可证](https://github.com/Sanjeever/computer-mcp/blob/main/LICENSE)
package/dist/cli.js ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/launcher.ts
4
+ import { spawn } from "node:child_process";
5
+ import { createRequire } from "node:module";
6
+ import { dirname, join } from "node:path";
7
+ import { existsSync } from "node:fs";
8
+ function platformPackage(platform, arch) {
9
+ if (!(platform === "darwin" && arch === "arm64" || platform === "win32" && arch === "x64")) {
10
+ throw new Error(
11
+ `Unsupported platform: ${platform}/${arch}. Supported: macOS arm64, Windows x64. / \u4E0D\u652F\u6301\u6B64\u5E73\u53F0\u3002`
12
+ );
13
+ }
14
+ return `@sanjeever/computer-mcp-${platform}-${arch}`;
15
+ }
16
+ function binaryPath(platform, arch, resolve) {
17
+ const name = platformPackage(platform, arch);
18
+ let manifest;
19
+ try {
20
+ manifest = resolve(`${name}/package.json`);
21
+ } catch (cause) {
22
+ throw new Error(
23
+ `Missing ${name}. Reinstall with optional dependencies enabled. / \u7F3A\u5C11\u5E73\u53F0\u5305\uFF0C\u8BF7\u542F\u7528\u53EF\u9009\u4F9D\u8D56\u540E\u91CD\u65B0\u5B89\u88C5\u3002`,
24
+ { cause }
25
+ );
26
+ }
27
+ return join(dirname(manifest), "bin", platform === "win32" ? "computer-mcp.exe" : "computer-mcp");
28
+ }
29
+ function launch() {
30
+ const require2 = createRequire(import.meta.url);
31
+ const binary = binaryPath(process.platform, process.arch, require2.resolve);
32
+ if (!existsSync(binary)) throw new Error(`Native executable missing / \u539F\u751F\u7A0B\u5E8F\u4E0D\u5B58\u5728: ${binary}`);
33
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit", windowsHide: true });
34
+ const forward = (signal) => {
35
+ child.kill(signal);
36
+ };
37
+ const onInt = () => forward("SIGINT");
38
+ const onTerm = () => forward("SIGTERM");
39
+ const onExit = () => {
40
+ child.kill();
41
+ };
42
+ process.on("SIGINT", onInt);
43
+ process.on("SIGTERM", onTerm);
44
+ process.on("exit", onExit);
45
+ child.once("error", (error) => {
46
+ console.error(error.message);
47
+ process.exitCode = 1;
48
+ });
49
+ child.once("close", (code, signal) => {
50
+ process.off("SIGINT", onInt);
51
+ process.off("SIGTERM", onTerm);
52
+ process.off("exit", onExit);
53
+ process.exitCode = code ?? (signal === "SIGINT" ? 130 : 143);
54
+ });
55
+ }
56
+
57
+ // src/cli.ts
58
+ try {
59
+ launch();
60
+ } catch (error) {
61
+ console.error(error instanceof Error ? error.message : String(error));
62
+ process.exitCode = 1;
63
+ }
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@sanjeever/computer-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Native macOS and Windows computer use over stdio MCP",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Sanjeever/computer-mcp.git"
9
+ },
10
+ "bin": {
11
+ "computer-mcp": "dist/cli.js"
12
+ },
13
+ "files": [
14
+ "dist/",
15
+ "README.md",
16
+ "README.zh-CN.md",
17
+ "LICENSE"
18
+ ],
19
+ "type": "module",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "build": "tsx scripts/build.ts",
25
+ "build:native": "tsx scripts/native.ts",
26
+ "typecheck": "tsc --noEmit",
27
+ "lint": "oxlint --deny-warnings src scripts",
28
+ "fmt": "oxfmt .",
29
+ "fmt:check": "oxfmt --check .",
30
+ "test": "vitest run",
31
+ "pack:platform": "tsx scripts/platform.ts",
32
+ "pack:check": "tsx scripts/pack-check.ts",
33
+ "smoke": "tsx scripts/smoke.ts"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "26.6.6",
37
+ "esbuild": "0.28.2",
38
+ "oxfmt": "0.78.0",
39
+ "oxlint": "1.93.0",
40
+ "tsx": "4.23.15",
41
+ "typescript": "7.0.2",
42
+ "vitest": "5.1.0"
43
+ },
44
+ "optionalDependencies": {
45
+ "@sanjeever/computer-mcp-darwin-arm64": "1.0.0",
46
+ "@sanjeever/computer-mcp-win32-x64": "1.0.0"
47
+ },
48
+ "engines": {
49
+ "node": ">=22"
50
+ },
51
+ "packageManager": "pnpm@11.20.0"
52
+ }