
PyAutoGUI 的 MCP 服务器
概览
MCP-Pyautogui 实现了 的服务器。它提供鼠标、键盘和屏幕交互的控制,使 AI 系统能够自动化主机上的任务。 该服务器运行于stdio传输之上,提供点击、输入、截图等工具,注重简洁和可靠性。它面向开发者和AI爱好者,希望将桌面自动化融入工作流程。 - 控制鼠标移动、点击和拖拽。- 模拟键盘输入(单键、文本、快捷键)。- 截图并检索鼠标位置。- 获取当前操作系统以实现平台特定逻辑。- 一致的错误处理,配备布尔成功指示器(如适用)。 你还需要授予相关权限。 然后你可以运行以下操作来确定服务器安装的位置: 在你把mcp-pyautogui添加到claude_desktop_config.json文件时,使用那个位置。
概述(AI 翻译)
mcp-pyautogui 实现了一个 PyAutoGUI 的模型上下文协议(MCP)** 服务器。它提供鼠标、键盘和屏幕交互的控制,使 AI 系统能够自动化主机上的任务。
服务器运行于stdio传输系统,提供点击、输入、截图等工具,注重简便和可靠性。它面向开发者和AI爱好者,帮助他们将桌面自动化融入工作流程。
特色
- 控制鼠标移动、点击和拖拽。
- 模拟键盘输入(单键、文本、快捷键)。
- 截图并检索鼠标位置。
- 获取当前的操作系统以实现平台特定逻辑。
- 一致的错误处理,配合布尔成功指标(如适用)。
先修条件
- Python 3.11+
你还需要授予相关权限。
安装
使用 pip 安装服务器。
然后你可以运行以下操作来确定服务器安装的位置:
在你向 claude_desktop_config.json 文件添加 mcp-pyautogui 时,使用该位置。这里有一个示例配置:
用途
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Server for PyAutoGUI
mcp-pyautogui implements a Model Context Protocol (MCP) server for PyAutoGUI. It provides control of mouse, keyboard, and screen interactions, allowing AI systems to automate tasks on a host machine.
The server runs over stdio transport and provides tools for clicking, typing, taking screenshots, and more, with a focus on simplicity and reliability. It’s designed for developers and AI enthusiasts looking to integrate desktop automation into their workflows.
Features
- Control mouse movements, clicks, and drags.
- Simulate keyboard input (single keys, text, hotkeys).
- Capture screenshots and retrieve mouse position.
- Get the current operating system for platform-specific logic.
- Consistent error handling with boolean success indicators (where applicable).
Prerequisites
- Python 3.11+
You’ll also have to grant the relevant permissions.
Installation
Use pip to install the server.
pip install mcp-pyautogui
You can then run the following comand to determine the location at which the server was installed:
which mcp-pyautogui
# Sample output:
# /Users/bob/miniconda3/envs/desk/bin/mcp-pyautogui
Use that location when you’re adding mcp-pyautogui to your claude_desktop_config.json file. Here’s a sample configuration:
{
"mcpServers": {
"mcp-pyautogui": {
"command": "/Users/bob/miniconda3/envs/desk/bin/mcp-pyautogui",
"args": [
""
]
}
}
}
Usage
If you followed the above installation steps, you don’t need to do anything else. Just use Claude Desktop and you should see all the tools this MCP server offers automatically. You could test this server by saying something like “can you click at (200,200) ?”.
The server runs over stdio transport, meaning it communicates through standard input/output. To use it, connect an MCP-compatible client (e.g., an AI assistant or custom script) that can send JSON-RPC commands and receive responses.
Example Commands
- Click at (100, 200):
click(100, 200)→ Returns true if successful. - Type “hello”:
type_text("hello")→ Returns true. - Take a screenshot:
take_screenshot("screenshot.png")→ Saves to screenshot.png. - Get mouse position:
get_mouse_position()→ Returns (500, 300) (example). - Copy text:
hotkey("ctrl c")→ Returns true.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"mcp-pyautogui": {
"command": "/Users/bob/miniconda3/envs/desk/bin/mcp-pyautogui",
"args": [
""
]
}
}
}