Skip to main content
Glama
hightemp

go_computer_use_mcp_server

by hightemp

go_computer_use_mcp_server

WARNING

此服务器旨在作为受信任的本地 MCP 工具运行。 它目前提供广泛的本地桌面控制权限,且默认未进行沙箱隔离。 在没有额外安全控制的情况下,请勿将其暴露给不受信任的网络、用户或代理。

用于计算机自动化的 Go 语言 MCP (Model Context Protocol) 服务器。使用 robotgo 库进行桌面自动化。

功能

  • 鼠标控制:移动、点击、拖拽、滚动

  • 键盘控制:按键、文本输入、快捷键

  • 屏幕操作:截图、像素颜色、显示信息

  • 窗口管理:移动、调整大小、最小化/最大化

  • 进程管理:列出进程、搜索、终止

  • 系统工具:系统信息、对话框、延迟

使用 npx 快速启动

运行该服务器最简单的方法是通过 npx(需要 Node.js 18+):

# Run with stdio transport (for MCP clients)
npx go-computer-use-mcp-server -t stdio

# Run with SSE transport
npx go-computer-use-mcp-server -t sse -h 0.0.0.0 -p 8080

与 AI 工具集成

Claude Desktop

添加到您的 Claude Desktop 配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "computer-use": {
      "command": "npx",
      "args": ["-y", "go-computer-use-mcp-server", "-t", "stdio"]
    }
  }
}

Claude Code

使用 CLI 命令:

claude mcp add computer-use -- npx -y go-computer-use-mcp-server -t stdio
claude mcp add --transport stdio \
  --env DISPLAY="$DISPLAY" \
  --env XAUTHORITY="${XAUTHORITY:-$HOME/.Xauthority}" \
  computer-use -- \
  npx -y go-computer-use-mcp-server -t stdio

或者手动添加到项目的 .mcp.json 文件中:

{
  "mcpServers": {
    "computer-use": {
      "command": "npx",
      "args": ["-y", "go-computer-use-mcp-server", "-t", "stdio"]
    }
  }
}

OpenCode

添加到您的 opencode.jsonc 配置文件中:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "computer-use": {
      "type": "local",
      "command": ["npx", "-y", "go-computer-use-mcp-server", "-t", "stdio"],
      "enabled": true
    }
  }
}

Codex (OpenAI)

使用 CLI 命令:

codex mcp add computer-use -- npx -y go-computer-use-mcp-server -t stdio

或者添加到 ~/.codex/config.toml

[mcp_servers.computer-use]
command = "npx"
args = ["-y", "go-computer-use-mcp-server", "-t", "stdio"]
env_vars = ["DISPLAY", "XAUTHORITY"]

Cursor

添加到您的 Cursor MCP 配置中。前往 Cursor Settings > Features > MCP Servers 并添加:

{
  "mcpServers": {
    "computer-use": {
      "command": "npx",
      "args": ["-y", "go-computer-use-mcp-server", "-t", "stdio"]
    }
  }
}

Windsurf

添加到 ~/.codeium/mcp_config.json 或通过 Settings > Cascade > MCP Servers > Add Server

{
  "mcpServers": {
    "computer-use": {
      "command": "npx",
      "args": ["-y", "go-computer-use-mcp-server", "-t", "stdio"]
    }
  }
}

Cline (VS Code 扩展)

点击 Cline 面板中的 MCP Servers 图标,选择“Configure”选项卡,然后点击“Configure MCP Servers”以编辑 cline_mcp_settings.json

{
  "mcpServers": {
    "computer-use": {
      "command": "npx",
      "args": ["-y", "go-computer-use-mcp-server", "-t", "stdio"],
      "disabled": false
    }
  }
}

通用 MCP 客户端

对于任何兼容 MCP 的客户端,请使用:

npx -y go-computer-use-mcp-server -t stdio

从源码安装

要求

  • Go 1.21+

  • GCC 编译器

  • X11 库 (Linux)

Ubuntu/Debian

# Go (if not installed)
sudo snap install go --classic

# GCC
sudo apt install gcc libc6-dev

# X11
sudo apt install libx11-dev xorg-dev libxtst-dev

# Clipboard support
sudo apt install xsel xclip

# Bitmap support (for image operations)
sudo apt install libpng++-dev

# Event hook support
sudo apt install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev

一行命令:

sudo apt install gcc libc6-dev libx11-dev xorg-dev libxtst-dev xsel xclip libpng++-dev xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev

Fedora

# GCC (if not installed)
sudo dnf install gcc

# X11
sudo dnf install libX11-devel libXtst-devel

# Clipboard support
sudo dnf install xsel xclip

# Bitmap support
sudo dnf install libpng-devel

# Event hook support
sudo dnf install libxkbcommon-devel libxkbcommon-x11-devel xorg-x11-xkb-utils-devel

一行命令:

sudo dnf install gcc libX11-devel libXtst-devel xsel xclip libpng-devel libxkbcommon-devel libxkbcommon-x11-devel xorg-x11-xkb-utils-devel

构建

# Download dependencies
make deps

# Build for current platform
make build

# Build for all platforms
make build-all

运行(从源码)

SSE 传输(默认)

./go_computer_use_mcp_server -t sse -h 0.0.0.0 -p 8080

Stdio 传输

./go_computer_use_mcp_server -t stdio

命令行参数

参数

描述

默认值

-t

传输方式:ssestdio

sse

-h

SSE 服务器主机

0.0.0.0

-p

SSE 服务器端口

8080

可用工具

鼠标控制 (12 个工具)

工具

描述

mouse_move

将光标移动到绝对坐标

mouse_move_smooth

平滑移动光标(类人行为)

mouse_move_relative

相对移动光标

mouse_get_position

获取当前光标位置

mouse_click

鼠标点击

mouse_click_at

移动并点击

mouse_toggle

按下/释放鼠标按钮

mouse_drag

拖拽操作

mouse_drag_smooth

平滑拖拽操作

mouse_scroll

滚动

mouse_scroll_direction

向指定方向滚动

mouse_scroll_smooth

平滑滚动

键盘控制 (7 个工具)

工具

描述

key_tap

按键(带修饰键)

key_toggle

按下/释放按键

type_text

输入文本 (UTF-8)

type_text_delayed

延迟输入文本

clipboard_read

读取剪贴板

clipboard_write

写入剪贴板

clipboard_paste

通过剪贴板粘贴

屏幕操作 (7 个工具)

工具

描述

screen_get_size

获取屏幕尺寸

screen_get_displays_num

显示器数量

screen_get_display_bounds

显示器边界

screen_capture

屏幕截图(返回 MCP ImageContent)

screen_capture_save

截图并保存到文件

screen_get_pixel_color

获取坐标处的像素颜色

screen_get_mouse_color

获取光标下的像素颜色

窗口管理 (9 个工具)

工具

描述

window_get_active

活动窗口信息

window_get_title

窗口标题

window_get_bounds

窗口边界

window_set_active

激活窗口

window_move

移动窗口

window_resize

调整窗口大小

window_minimize

最小化窗口

window_maximize

最大化窗口

window_close

关闭窗口

进程管理 (6 个工具)

工具

描述

process_list

列出所有进程

process_find_by_name

按名称查找进程

process_get_name

通过 PID 获取进程名称

process_exists

检查进程是否存在

process_kill

终止进程

process_run

运行命令

系统工具 (3 个工具)

工具

描述

system_get_info

系统信息

util_sleep

休眠/延迟

alert_show

显示对话框

使用示例

移动鼠标并点击

{
  "tool": "mouse_click_at",
  "arguments": {
    "x": 100,
    "y": 200,
    "button": "left",
    "double": false
  }
}

输入文本

{
  "tool": "type_text",
  "arguments": {
    "text": "Hello, World!",
    "delay": 50
  }
}

快捷键

{
  "tool": "key_tap",
  "arguments": {
    "key": "c",
    "modifiers": ["ctrl"]
  }
}

屏幕截图

{
  "tool": "screen_capture",
  "arguments": {
    "x": 0,
    "y": 0,
    "width": 800,
    "height": 600
  }
}

支持的按键

字母和数字

a-z, A-Z, 0-9

功能键

f1-f24

导航键

up, down, left, right, home, end, pageup, pagedown

特殊键

backspace, delete, enter, tab, escape, space, insert, capslock

修饰键

alt, ctrl, shift, cmd (或 command)

多媒体键

audio_mute, audio_vol_down, audio_vol_up, audio_play, audio_stop, audio_pause

许可证

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hightemp/go_computer_use_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server