PH

prithviseran/hunch-mcp

开发工具

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

23 stars 2 forks 质量 72 趋势 31Apache-2.0

通过MCP无焦点驱动你的Mac:操作系统API、AppleScript、CDP和无障碍

概览

Hunch 是一个 MCP 服务器,让大型语言模型代理(LLM)能够亲自管理你的 Mac:你的已安装应用、已登录的会话、文件,而不会占据你的屏幕。当你继续在前台工作时,代理可以读取后台应用的界面、点击按钮、通过 AppleScript 驱动邮件或音乐、填写网页表单或移动文件。它能运行在真正的原生应用上,而不仅仅是浏览器。 Hunch 附带详细的操作手册作为 MCP 服务器说明;能够使用工具的模型(Claude Sonnet/Opus 级及以上)也能很好地遵循该指令。较小的模型可能会选择更笨拙的路径(比如截图和按键代替树状读取和点击)。 Hunch 总是更喜欢最直接的图层。这样更快、更可靠,而且(除了最后一个)从不碰到你的屏幕: 对于那些无障碍树真正空无一物的应用,存在一个有门槛的最后手段(截图+坐标点击/按键)。它抢走了注意力,所以先问你。 在 Safari 中进行无焦点视觉工作,请打开一个专门由扩展拥有的窗口,使用web_open(...

概述(AI 翻译)

用任何大型语言模型驱动你的Mac:无焦点,在后台,通过MCP运行。

Hunch 是一个 MCP 服务器,让 LLM 代理直接访问你的Mac:你安装的应用,你的 登录会话,你的文件,但不会占据你的屏幕。当你继续在 在前景,代理可以读取后台应用的界面、点击按钮、驱动邮件或音乐 AppleScript、填写网页表单或移动文件。它能运行在真正的原生应用上,而不仅仅是浏览器。

与现代大型语言模型合作效果最佳。 Hunch 附带详细的操作手册作为 MCP 服务器说明; 具备工具操作能力的模型(Claude Sonnet/Opus级及以上)很好地遵循了这一标准。较小的型号可能 选择更笨拙的路径(用截图和按键代替树状读取和点击)。

四层

Hunch总是更喜欢最直接的那一层。这样更快、更可靠,而且(除了最后一层) 永远不要碰屏幕:

图层 工具 用途
OS-API trash``file_op``open_file``clipboard_*``launch_app … 文件、剪贴板、应用生命周期,通过直接API调用
AppleScript applescript 可脚本化应用:邮件、消息、笔记、日历、音乐、Finder、Safari…

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

README

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

Hunch

Drive your Mac with any LLM: focus-free, in the background, over MCP.

Hunch is an MCP server that gives an LLM agent hands on your Mac: your installed apps, your logged-in sessions, your files, without taking over your screen. While you keep working in the foreground, an agent can read a background app’s UI, click its buttons, drive Mail or Music by AppleScript, fill a web form, or move files. It works on real native apps, not just a browser.

Works best with modern LLMs. Hunch ships a detailed playbook as MCP server instructions; capable tool-using models (Claude Sonnet/Opus-class and up) follow it well. Smaller models may pick clumsier paths (screenshots and keystrokes instead of tree reads and clicks).

The four layers

Hunch always prefers the most direct layer. It’s faster, more reliable, and (except the last) never touches your screen:

Layer Tools What it’s for
OS-API trash file_op open_file clipboard_* launch_app … files, clipboard, app lifecycle, via direct API calls
AppleScript applescript scriptable apps: Mail, Messages, Notes, Calendar, Music, Finder, Safari …
Web web_open web_snapshot web_act web_login … Safari through the bundled extension, or Chromium/Electron through CDP, driven in the background
Accessibility snapshot act any native app’s UI: read the tree, click/select/type by reference

A gated last resort (screenshot + coordinate clicks/keystrokes) exists for apps whose accessibility tree is truly empty. It steals focus, so it asks you first.

For focus-free visual work in Safari, open a dedicated extension-owned window with web_open(..., app="Safari", new_window=True). web_screenshot captures that background window, and web_act can use the returned pixel coordinates without moving the shared mouse, keyboard, or foreground window. The extension remains necessary: it owns the isolated Safari window and dispatches renderer-local actions that a physical screen capture cannot.

How it works (no server, no cloud)

“MCP server” undersells how local this is. hunch serve is a plain Python process that your MCP host (Claude Desktop, Cursor, …) spawns as a child process and talks to over JSON-RPC on stdin/stdout (MCP’s stdio transport). There is no HTTP endpoint, no port Hunch listens on, no daemon, and no telemetry. When your host quits, Hunch is gone.

The tools are direct macOS API calls in-process: the Accessibility framework via pyobjc, osascript for AppleScript, OS APIs for files/clipboard, a local WebSocket to Chromium’s DevTools port, and the signed local Safari extension bridge. The optional Safari companion

在 GitHub 查看完整 README

安装

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

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