Smooth Operator自动化工具
Windows自动化MCP产品提供以下功能: - AI视觉(例如,通过描述点击) - Windows UI自动化树工具 - 通过Playwright实现的Chrome自动化 - 鼠标控制 - 键盘控制 - 更多功能(40多种工具) 还附带Python/TypeScript/C#客户端库以及一个Windows桌面工具,可用来尝试所有工具。
服务介绍
如果你在寻找 MCP 服务器: 在这里找到它。
如果你在寻找 Python 库,请继续阅读吧.. ;)
Smooth Operator Agent Tools - Python 库
这是 Smooth Operator Agent Tools 的官方 Python 库实现,它是一个为在 Windows 系统上开发计算机使用代理的程序员提供的最先进的工具包。
概述
Smooth Operator Agent Tools 是一个强大的工具包,可以处理与 Windows 自动化树和 Playwright 浏览器控制进行交互的复杂任务,同时提供高级 AI 功能,如通过屏幕截图和文本描述识别 UI 元素。
这个 Python 库为 Smooth Operator Tools 服务器 API 提供了一个方便的封装,使你可以轻松地将这些功能集成到你的 Python 应用程序中。
所有功能都可以在代码实现之前通过一个方便的 Windows 用户界面进行测试和探索。请在 Smooth Operator Tools UI 上尝试它们。
安装
pip install smooth-operator-agent-tools
前提条件
Google Chrome
Smooth Operator Agent Tools 库需要系统上安装 Google Chrome(或兼容的基于 Chromium 的浏览器)以使浏览器自动化功能正常工作。
服务器安装
Smooth Operator 客户端库包含一个需要安装在应用程序数据目录中的服务器组件。服务器文件已打包在库中,并将在首次使用时自动解压。
首次执行
当你第一次使用该库时,它将自动:
- 创建目录
%APPDATA%\SmoothOperator\AgentToolsServer(或您操作系统上的等效目录) - 从包中解压服务器文件
- 启动服务器进程
请注意,为了让 Chrome 自动化功能正常工作,你需要确保按照“前提条件”部分所述安装了 Node.js 和 Playwright。
对于应用程序安装程序
如果你正在构建包括此库的应用程序安装程序,你应该在应用程序的安装过程中包括安装 Node.js 和 Playwright 的步骤,以便获得更好的用户体验。请参阅“前提条件”部分了解所需的安装步骤。
使用方法
from smooth_operator_agent_tools import SmoothOperatorClient
# Initialize the client with your API key, get it for free at https://screengrasp.com/api.html
client = SmoothOperatorClient(api_key="YOUR_API_KEY")
# Start the Server - this takes a moment
client.start_server()
# Take a screenshot
screenshot = client.screenshot.take()
# Get system overview
overview = client.system.get_overview()
# Perform a mouse click
client.mouse.click(500, 300)
# Find and click a UI element by description
client.mouse.click_by_description("Submit button")
# Type text
client.keyboard.type("Hello, world!")
# Control Chrome browser
client.chrome.open_chrome("https://www.example.com")
client.chrome.get_dom()
# You can also use the to_json_string() method on many objects
# to get a JSON string that can easily be used in a prompt to a LLM
# to utilize AI even more for automated decision making
特性
- 截图与分析:捕获屏幕截图并分析 UI 元素
- 鼠标控制:使用坐标或 AI 支持的元素检测进行精确的鼠标操作
- 键盘输入:键入文本并发送组合键
- Chrome 浏览器控制:导航、与元素交互以及执行 JavaScript
- Windows 自动化:与 Windows 应用程序和 UI 元素交互
- 系统操作:打开应用程序并管理系统状态
文档
有关详细的 API 文档,请访问:
许可证
本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。