mcpField
G
Go Computer Use Mcp Server

Go Computer Use Mcp Server

本地服务
github.com生产力424 周前更新

关于 Go Computer Use Mcp Server

Go Computer Use Mcp Server 是基于 Go 和 robotgo 的桌面自动化 MCP 服务,提供鼠标、键盘、屏幕、窗口、进程和系统工具操作。它面向受信任的本地使用,默认未启用沙箱。

主要功能

  1. 01鼠标移动、点击和滚动
  2. 02键盘输入与剪贴板操作
  3. 03屏幕截图和显示信息
  4. 04窗口控制与检查
  5. 05进程管理和命令执行
  6. 06系统信息与对话框

适用场景

  1. 01自动化鼠标和键盘交互
  2. 02捕获屏幕并查看显示信息
  3. 03移动、调整大小或激活窗口
  4. 04检查或终止本地进程

MCP 相关

它向 MCP 客户端提供桌面自动化工具,支持 stdio 和 SSE 传输。该服务具有广泛的本地控制能力,默认未启用沙箱。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"hightemp-go-computer-use": {
"command": "npx",
"args": [
"-y",
"go-computer-use-mcp-server"
],
"env": {
"DISPLAY": "<DISPLAY>",
"XAUTHORITY": "<XAUTHORITY>"
}
}
}
}
启动命令npx -y go-computer-use-mcp-server
需要配置的环境变量
DISPLAYX11 display to automate on Linux.
XAUTHORITY密钥Path to the X11 authority file on Linux.

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmgo-computer-use-mcp-server1.1.4

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

go_computer_use_mcp_server

npm version npm downloads npm downloads/month GitHub Downloads GitHub release Go version Go Report Card

警告

此服务旨在作为受信任的本地 MCP 工具运行。
它目前提供广泛的本地桌面控制,且默认未进行沙箱隔离。
除非采取额外的安全控制措施,否则请勿将其暴露给不受信任的网络、用户或 Agent。

Go 编写的计算机自动化 MCP(模型上下文协议)服务。使用 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

官方 MCP Registry

此服务已准备好以以下名称发布到 Official MCP Registry:

io.github.hightemp/go-computer-use-mcp-server

Registry 元数据定义在 server.json 中。npm 包在 package.json 中包含匹配的 mcpName 字段,Registry 会使用此字段验证包的所有权。

对于维护者,发布工作流会先发布 npm 包,等待该版本在 npm Registry 中可见,然后使用 GitHub OIDC 身份验证发布 server.json。

与 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

使用命令行命令:

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)

使用命令行命令:

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传输方式:sse 或 stdiosse
-hSSE 服务的主机0.0.0.0
-pSSE 服务的端口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

README 配图

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。