@github/computer-use-mcp 0.1.8 → 0.1.9
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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/prebuilds/darwin-arm64/computer.node +0 -0
- package/dist/prebuilds/darwin-x64/computer.node +0 -0
- package/dist/prebuilds/linux-x64/computer.node +0 -0
- package/dist/prebuilds/win32-arm64/computer.node +0 -0
- package/dist/prebuilds/win32-x64/computer.node +0 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
6
6
|
* The server exposes a single "computer" tool with mouse, keyboard, and
|
|
7
7
|
* screenshot actions mirroring the Anthropic computer-use API.
|
|
8
8
|
*
|
|
9
|
-
* Uses prebuilt native addons (macOS / Windows). Throws
|
|
10
|
-
*
|
|
9
|
+
* Uses prebuilt native addons (macOS / Windows / Linux). Throws when the
|
|
10
|
+
* current platform or desktop session is unsupported.
|
|
11
11
|
*/
|
|
12
12
|
export declare function createServer(): McpServer;
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{McpServer as N}from"@modelcontextprotocol/sdk/server/mcp.js";import{createRequire as k}from"module";import{dirname as w,join as P}from"path";import{fileURLToPath as $}from"url";var C=k(import.meta.url),R=w($(import.meta.url));function q(){let c=P(R,"prebuilds",`${process.platform}-${process.arch}`,"computer.node");try{return C(c)}catch{return null}}var b=class c{constructor(e){this.native=e}native;static create(){let e=q();if(!e)throw new Error(`Native computer bindings not available for ${process.platform}-${process.arch}`);return new c(e)}async click(e,o,s,t){this.native.click(e,o,s,t)}async move(e,o){this.native.move(e,o)}async drag(e,o,s,t){this.native.drag(e,o,s,t)}async mouseDown(e,o){this.native.mouseDown(e,o)}async mouseUp(e,o){this.native.mouseUp(e,o)}async type(e){this.native.type(e)}async key(e){this.native.key(e)}async scroll(e,o,s,t){this.native.scroll(e,o,s,t)}async cursorPosition(){return this.native.cursorPosition()}async display(){let{width:e,height:o}=this.native.display();return{width:e,height:o}}async screenshot(){return this.native.screenshot()}};import{z as a}from"zod";function i(c,e){let o=[{type:"text",text:c}];return e?{content:o,isError:!0}:{content:o}}function T(c,e){return{content:[{type:"text",text:c},{type:"image",data:e,mimeType:"image/png"}]}}var S=a.enum(["screenshot","left_click","right_click","middle_click","double_click","triple_click","left_click_drag","mouse_move","type","key","scroll","left_mouse_down","left_mouse_up","hold_key","wait","cursor_position"]),x=a.object({x:a.number(),y:a.number()});function h(c,e){c.tool("computer",`Use a mouse and keyboard to interact with a computer, and take screenshots.
|
|
1
|
+
import{McpServer as N}from"@modelcontextprotocol/sdk/server/mcp.js";import{createRequire as k}from"module";import{dirname as w,join as P}from"path";import{fileURLToPath as $}from"url";var C=k(import.meta.url),R=w($(import.meta.url));function q(){let c=P(R,"prebuilds",`${process.platform}-${process.arch}`,"computer.node");try{return C(c)}catch{return null}}var b=class c{constructor(e){this.native=e}native;static create(){let e=q();if(!e)throw new Error(`Native computer bindings not available for ${process.platform}-${process.arch}`);return e.display(),new c(e)}async click(e,o,s,t){this.native.click(e,o,s,t)}async move(e,o){this.native.move(e,o)}async drag(e,o,s,t){this.native.drag(e,o,s,t)}async mouseDown(e,o){this.native.mouseDown(e,o)}async mouseUp(e,o){this.native.mouseUp(e,o)}async type(e){this.native.type(e)}async key(e){this.native.key(e)}async scroll(e,o,s,t){this.native.scroll(e,o,s,t)}async cursorPosition(){return this.native.cursorPosition()}async display(){let{width:e,height:o}=this.native.display();return{width:e,height:o}}async screenshot(){return this.native.screenshot()}};import{z as a}from"zod";function i(c,e){let o=[{type:"text",text:c}];return e?{content:o,isError:!0}:{content:o}}function T(c,e){return{content:[{type:"text",text:c},{type:"image",data:e,mimeType:"image/png"}]}}var S=a.enum(["screenshot","left_click","right_click","middle_click","double_click","triple_click","left_click_drag","mouse_move","type","key","scroll","left_mouse_down","left_mouse_up","hold_key","wait","cursor_position"]),x=a.object({x:a.number(),y:a.number()});function h(c,e){c.tool("computer",`Use a mouse and keyboard to interact with a computer, and take screenshots.
|
|
2
2
|
|
|
3
3
|
Take a screenshot before clicking to determine coordinates. After each action, take a screenshot to verify the result.`,{action:S.describe(`The action to perform:
|
|
4
4
|
- screenshot: Capture the current screen. No other parameters.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github/computer-use-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Computer Use MCP Server",
|
|
5
5
|
"author": "GitHub",
|
|
6
6
|
"repository": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"start": "npm run build && node dist/main.js",
|
|
28
28
|
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
29
29
|
"build": "esbuild src/index.ts --bundle --minify --sourcemap=linked --format=esm --platform=node --packages=external --outdir=dist && esbuild src/main.ts --minify --sourcemap=linked --format=esm --platform=node --outdir=dist && dts-bundle-generator src/index.ts -o dist/index.d.ts --no-banner",
|
|
30
|
+
"build:linux": "cd computer/linux && bash build.sh",
|
|
30
31
|
"build:mac": "cd computer/mac && bash build.sh",
|
|
31
32
|
"build:win": "cd computer/win && powershell -ExecutionPolicy Bypass -File build.ps1",
|
|
32
33
|
"lint": "eslint src/",
|