Skip to main content
Glama

Computer Control MCP

by AB498

计算机控制MCP

MCP 服务器使用 PyAutoGUI、RapidOCR 和 ONNXRuntime 提供计算机控制功能,例如鼠标、键盘、OCR 等。类似于 Anthropic 的“computer-use”。零外部依赖。

  • 仅在 Windows 上测试。其他平台也应该可以运行。


MCP 计算机控制演示

快速使用(使用uvx设置 MCP)

{ "mcpServers": { "computer-control-mcp": { "command": "uvx", "args": ["computer-control-mcp@latest"] } } }

或者使用pip全局安装:

pip install computer-control-mcp

然后使用以下命令运行服务器:

computer-control-mcp # instead of uvx computer-control-mcp, so you can use the latest version, also you can `uv cache clean` to clear the cache and `uvx` again to use latest version.

Related MCP server: PyAutoGUI MCP Server

特征

  • 控制鼠标移动和点击

  • 在当前光标位置输入文本

  • 截取整个屏幕或特定窗口的屏幕截图,并可选择保存到下载目录

  • 使用 OCR(光学字符识别)从屏幕截图中提取文本

  • 列出并激活窗口

  • 按键盘键

  • 拖放操作

可用工具

鼠标控制

  • click_screen(x: int, y: int) :点击指定的屏幕坐标

  • move_mouse(x: int, y: int) :将鼠标光标移动到指定坐标

  • drag_mouse(from_x: int, from_y: int, to_x: int, to_y: int, duration: float = 0.5) :将鼠标从一个位置拖动到另一个位置

键盘控制

  • type_text(text: str) :在当前光标位置输入指定的文本

  • press_key(key: str) :按下指定的键盘键

屏幕和窗口管理

  • take_screenshot(title_pattern: str = None, use_regex: bool = False, threshold: int = 60, with_ocr_text_and_coords: bool = False, scale_percent_for_ocr: int = 100, save_to_downloads: bool = False) :使用可选 OCR 捕获屏幕或窗口

  • get_screen_size() :获取当前屏幕分辨率

  • list_windows() :列出所有打开的窗口

  • activate_window(title_pattern: str, use_regex: bool = False, threshold: int = 60) :将指定窗口置于前台

发展

设置开发环境

# Clone the repository git clone https://github.com/AB498/computer-control-mcp.git cd computer-control-mcp # Install in development mode pip install -e . # Start server python -m computer_control_mcp.core

运行测试

python -m pytest

API 参考

有关可用函数和类的详细信息,请参阅API 参考

执照

麻省理工学院

如需更多信息或帮助

-
security - not tested
A
license - permissive license
-
quality - not tested

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/AB498/computer-control-mcp'

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