KP

kitfactory/pymcpautogui

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

23 stars 4 forks 质量 62 趋势 10MIT

GUI 操作 MCP 服务器

概览

✨ PyMCPAutoGUI为你的AI代理(如光标或其他兼容MCP环境中的代理)与计算机的图形用户界面(GUI)提供了桥梁。它让你的代理能够像人类用户一样,看到屏幕👁️、控制鼠标🖱️和键盘⌨️,并与Windows 🪟互动! 停止繁琐的手动图形界面任务,让你的AI来完成繁重的工作💪。非常适合自动化重复操作、测试图形界面或构建强大的AI助手🤖。 * 赋予你的AI代理直接与桌面应用交互的能力。* 与支持MCP的客户端如光标编辑器无缝兼容。即插即用!* 用一个简单的服务器命令开始。真的,就是这么简单。* 提供经过实战考验的PyAutoGUI和PyGetWindow的多种图形界面自动化功能。* 包含截图和屏幕图像定位工具——让你的代理看到!* 控制窗口位置、大小、状态(最小化、最大化)等。

概述(AI 翻译)

增强你的AI代理能力! ✨ PyMCPAutoGUI为你的AI代理(如光标或其他兼容MCP环境的代理)与计算机图形用户界面(GUI)之间提供了桥梁。它让你的代理能够像人类用户一样看到屏幕👁️、控制鼠标🖱️和键盘⌨️,并与Windows 🪟互动!

停止繁琐的手动图形界面任务,让你的AI来完成繁重的工作💪。非常适合自动化重复操作、测试图形界面或构建强大的AI助手🤖。

🤔 为什么选择PyMCPAutoGUI?

  • ** 🤖 赋能您的代理:** 赋予您的AI代理直接与桌面应用交互的能力。
  • ** ✅ 简单集成:** 与支持MCP的客户端如光标编辑器无缝兼容。即插即用!
  • ** 🚀 易用:** 用一个简单的服务器命令开始。说真的,它就是这么简单。
  • ** 🖱️⌨️ 全面控制:** 提供经过实战考验的 PyAutoGUI 和 PyGetWindow 的多种图形界面自动化功能。
  • ** 🖼️ 屏幕感知:** 包含截图和屏幕定位图像的工具——让你的客服看到!

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

PyMCPAutoGUI 🖱️⌨️🖼️ - GUI Automation via MCP

Supercharge your AI Agent’s capabilities! ✨ PyMCPAutoGUI provides a bridge between your AI agents (like those in Cursor or other MCP-compatible environments) and your computer’s graphical user interface (GUI). It allows your agent to see the screen 👁️, control the mouse 🖱️ and keyboard ⌨️, and interact with windows 🪟, just like a human user!

Stop tedious manual GUI tasks and let your AI do the heavy lifting 💪. Perfect for automating repetitive actions, testing GUIs, or building powerful AI assistants 🤖.

🤔 Why Choose PyMCPAutoGUI?

  • 🤖 Empower Your Agents: Give your AI agents the power to interact directly with desktop applications.
  • ✅ Simple Integration: Works seamlessly with MCP-compatible clients like the Cursor editor. It’s plug and play!
  • 🚀 Easy to Use: Get started with a simple server command. Seriously, it’s that easy.
  • 🖱️⌨️ Comprehensive Control: Offers a wide range of GUI automation functions from the battle-tested PyAutoGUI and PyGetWindow.
  • 🖼️ Screen Perception: Includes tools for taking screenshots and locating images on the screen – let your agent see!
  • 🪟 Window Management: Control window position, size, state (minimize, maximize), and more. Tidy up that desktop!
  • 💬 User Interaction: Display alert, confirmation, and prompt boxes to communicate with the user.

🛠️ Supported Environments

  • Operating Systems: Windows, macOS, Linux (Requires appropriate dependencies for pyautogui on each OS)
  • Python: 3.11+ 🐍
  • MCP Clients: Cursor Editor, any client supporting the Model Context Protocol (MCP)

🚀 Getting Started - It’s Super Easy!

Using a virtual environment keeps your project dependencies tidy.

# Create and activate a virtual environment (example using venv)
python -m venv .venv
# Windows PowerShell
.venv\Scripts\Activate.ps1
# macOS / Linux bash
source .venv/bin/activate

# Install using pip (from PyPI or local source)
# Make sure your virtual environment is active!
pip install pymcpautogui # Or pip install . if installing from local source

(Note: pyautogui might have system dependencies like scrot on Linux for screenshots. Please check the pyautogui documentation for OS-specific installation requirements.)

2. Running the MCP Server

Once installed, simply run the server from your terminal:

# Make sure your virtual environment is activated!
python -m pymcpautogui.server

The server will start and listen for connections (defaulting to port 6789). Look for this output:

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { // ... other MCP server configs if any ... "PyMCPAutoGUI": { // Sets the working directory. ${workspaceFolder} is usually correct. "cwd": "${workspaceFolder}", // Command to run Python. 'python' works if the venv is active in the terminal // where Cursor was launched, or specify the full path. "command": "python", // Or ".venv/Scripts/python.exe" (Win) or ".venv/bin/python" (Mac/Linux) // Arguments to start the server module. "args": ["-m", "pymcpautogui.server"] } // ... other MCP server configs if any ... } }