Skip to content
Agentmart
Submit a tool

macbeth

How to drive macOS apps with Macbeth MCP tools — discovery, locators, actions, menus, screenshots/OCR, handles, and fallbacks

Skill by wende

IndexedMIT★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/wende-macbeth

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

How to drive macOS apps with Macbeth MCP tools — discovery, locators, actions, menus, screenshots/OCR, handles, and fallbacks

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/macbeth

What's inside

Skill name
macbeth
Description
How to drive macOS apps with Macbeth MCP tools — discovery, locators, actions, menus, screenshots/OCR, handles, and fallbacks
License
MIT
Instructions
206 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Macbeth — Computer Use for macOS

Use this skill whenever you automate a Mac app through Macbeth MCP tools. App-specific skills (Safari, Mail, Electron, …) add quirks on top of this baseline — load those after this one when the target app has one.

Call `load_skill` with **no arguments** (or `name: "macbeth"`) to reload these instructions.

## Mental model

1. **Discover** — `list_apps` / `list_windows` / `query_tree`
2. **Act** — `click` / `fill` / `select_menu_item` / `wait_for`
3. **Verify** — `get_element` / `query_tree` / `screenshot` / `extract_text`
4. **Fall back** — menus → keyboard → screenshot/OCR when Accessibility is thin

Prefer structured Accessibility actions over screenshots and keystrokes. Prefer menus over `press_key` (menus do not steal focus).

## Output format

Tool **results** are YAML; tool **arguments** remain JSON (MCP input schemas are JSON Schema). Read fields by key path, not by line position — paths and titles never get hard-wrapped.

## Permissions

- **Accessibility** — required for almost everything. If every app is not-connectable with AX `-25211`, tell the user to grant Accessibility to the host that launched Macbeth, then restart the agent.
- **Screen Recording** — only for `screenshot` and window-based `extract_text`. OCR of supplied PNG `data` does not need it.
- Diagnose with `npx macbeth doctor` in a terminal when tools fail mysteriously.

## First moves

```jsonc
// What is running and connectable?
{ "name": "list_apps" }

// Is app X open, and what windows does it show? (no AX connect required)
{ "name": "list_windows", "arguments": {} }
{ "name": "list_windows", "arguments": { "app": "Unity" } }

// Menu-bar / LSUIElement apps (Übersicht, Raycast, iTerm2) are omitted from
// list_apps. Discover them with list_windows, then pass ownerName or ownerPid.

// Inspect UI (connects automatically — no prior connect_app)
{ "name": "query_tree", "arguments": { "app": "Finder", "maxDepth": 5 } }
```

### Do you need `connect_app`?

**No.** Every app-taking tool connects on its own from `app` (fuzzy name, PID, or `h_N` app handle).

Call `connect_app` only to:

- preflight Accessibility reachability
- see how a fuzzy name resolved (`matchKind`, aliases, bundle id, `runtime`)
- warm an Electron tree with a longer `readyTimeoutMs`

Reuse the returned app handle:

```jsonc
{ "name": "connect_app", "arguments": { "name": "Slack", "readyTimeoutMs": 5000 } }
// → "Pass app: \"h_3\" to any other tool…"
{ "name": "query_tree", "arguments": { "app": "h_3" } }
```

## Locators (`query`)

Most action tools take either:

- `query` — a chain of steps, each matching descendants of the previous match (recursive; skip intermediate containers), or
- `handleId` — a raw `h_N` from `query_tree` / `get_element` / `read_form`

Each step may set `role`, `title`, `identifier`, `titlePattern` (regex), and `index` (0-based when several match).

```jsonc
{
  "app": "TextEdit",
  "query": [
    { "role": "window" },
    { "role": "text_area" }
  ]
}
```

```jsonc
{
  "app": "Safari",
  "query": [
    { "role": "window" },
    { "role": "web_area" },
    { "role": "link", "titlePattern": "Sign.?in", "index": 0 }
  ]
}
```

Common roles: `window`, `button`, `text_field`, `text_area`, `checkbox`, `radio`, `menu`, `menu_item`, `toolbar`, `scroll_area`, `table`, `row`, `cell`, `group`, `dialog`, `link`, `heading`, `web_area`, `static_text`, `slider`, `pop_up_button`.

Always `query_tree` before inventing locators. Keep `maxDepth` modest (4–6) on huge trees; raise it only for the subtree you care about. When a `query_tree` result shows a `[truncated: …] re-query with handleId h_X` marker, pass that `handleId` back with a higher `maxNodes` to drill into the named subtree (root resets to depth 0 under the handle, so the same `maxDepth` reaches deeper).

## Actions

| Goal | Tool | Notes |
|---|---|---|
| Click a control | `click` | Auto-waits. `strategy`: `auto` (default) \| `ax` \| `mouse` |
| Set a text field | `fill` | Auto-waits. `strategy`: `auto` \| `ax` \| `keyboard` |
| Wait for UI | `wait_for` | `exists` (default), `value_equals`, `value_changes`, `enabled` |
| Read one element | `get_element` | role, title, value, enabled, focused |
| Read form controls | `read_form` | Labels + values for a panel/subtree |
| Native menu | `select_menu_item` | `menuPath: ["File", "Save"]` — no focus steal |
| Compact menus only | `list_menu_bar` | Usually unnecessary — `query_tree` already includes menus |
| Keystroke | `press_key` / `press_keys` | **Last resort** — activates the target app |

### Click / fill strategies

- Leave `strategy` unset (`auto`) unless something fails.
- Electron / React fields: `auto` fill synthesizes keystrokes so the framework sees input. If a value “sticks” in AX but the app ignores it, use `"keyboard"`. Avoid forcing `"ax"` on Electron.
- Canvas / geometry-only UIs: `click` with `"mouse"`. Optional `waitForIdleMs` (≤5000) avoids mid-keystroke focus steals.

### Keyboard outcomes

`press_key` / `press_keys` report `outcome`:

- `dispatched` — events entered the system stream (app may still ignore them)
- `attempted` — could not confirm dispatch

From wende/macbeth, MIT.

More from wende/macbeth

Signals

Stars
4
Forks
0
Open issues
1
Last commit (this folder)
Aug 26, 2026 (2 months ago)
Last release
Aug 2, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wende

Cite this page

macbeth skill. Agent Mart. https://agentmart.dev/skills/wende-macbeth (last updated 2026-10-24)