macbot-mcp
Enables reading the browser's accessibility tree, locating UI elements with coordinates, getting the current URL, and performing clicks and typing within Firefox.
Allows reading the terminal's content and controlling it via the Accessibility API, enabling tasks such as reading output and typing commands.
Provides comprehensive control over macOS applications via the Accessibility API, including reading UI trees, finding elements, clicking, dragging, scrolling, typing, sending keystrokes, and executing AppleScript.
Enables reading the browser's accessibility tree, locating UI elements with coordinates, getting the current URL, and performing clicks and typing within Safari.
Allows reading the editor's UI elements and controlling it via the Accessibility API, enabling tasks like opening files and navigating text.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@macbot-mcpFind the Save button in Notes and click it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
macbot-mcp
An MCP server that gives AI agents hands on macOS — via the Accessibility API, AppleScript, and Quartz CGEvents.
The macOS counterpart to ahk-mcp. Same thesis: the accessibility tree already contains a machine-readable description of everything on screen. Screenshots throw that away and make the model re-derive it from pixels. Why?
Token cost per action: ~200-700 tokens (vs ~2000-3500 for screenshot-based).
Because the output is structured text, not images, any language model can drive it — including small open-source models with no vision capability. A 7B model can parse AXButton title="Save" @450,320 88x32 and call mac_click(x=490, y=336). It cannot interpret a screenshot. The accessibility approach makes computer use available to models that were previously locked out of it entirely.
How it works
macbot-mcp exposes 15 tools over MCP's stdio transport:
Observation tools read the macOS accessibility tree, window properties, and browser URLs — returning structured text with element roles, names, values, and screen coordinates
Action tools click, drag, scroll, type, and send keystrokes via Quartz CGEvents and AppleScript
mac_run_applescriptis the escape hatch — execute arbitrary AppleScript for anything the built-in tools don't cover
Every observation tool returns coordinates. Find a button with mac_ui_find, get its x,y position, and click it with mac_click — no screenshot needed.
Related MCP server: Automation MCP
Token cost comparison
Approach | Tokens per action | What you get |
Screenshot-based (full screen PNG) | ~2000-3500 | Pixels. Model must OCR, locate elements, interpret layout. |
macbot-mcp (structured text) | ~200-700 | Element roles, titles, values, and pixel coordinates. |
A 20-step workflow: ~50k tokens with screenshots, ~8k with macbot. The structured output is also more reliable — the model doesn't guess where the "Save" button is when the accessibility tree says AXButton title="Save" @1043,672 88x32.
Installation
Prerequisites
macOS 12+ (Monterey or later)
Python 3.10+
Setup
git clone https://github.com/anomalous3/macbot-mcp.git
cd macbot-mcp
# Create a virtual environment
python3 -m venv .venv
# or: uv venv .venv
# Activate
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txtmacOS Permissions
macbot needs two permissions, granted to your terminal app (Terminal, kitty, iTerm2, etc.):
Accessibility — System Settings > Privacy & Security > Accessibility
Screen Recording — System Settings > Privacy & Security > Screen Recording
Without Accessibility, observation and input tools won't work. Without Screen Recording, mac_screenshot will fail.
Three gotchas:
Granting is not enough — fully quit and reopen the terminal (Cmd-Q, not just a new tab/window). Running processes keep their old permission state.
macOS 15+ periodically re-asks for Screen Recording. If screenshots worked yesterday and now fail with
could not create image from display(andmac_get_windowsreturns[]), respond to the re-consent prompt in System Settings, then restart the terminal.If you run Claude Code inside an IDE's integrated terminal (VS Code etc.), grant the permissions to the IDE, not Terminal.app.
Claude Code MCP configuration
Add to your ~/.claude.json:
{
"mcpServers": {
"macbot": {
"command": "/path/to/macbot-mcp/.venv/bin/python3",
"args": ["/path/to/macbot-mcp/server.py"],
"env": {
"MACBOT_SCREENSHOT_DIR": "/tmp/macbot"
}
}
}
}After adding the config, restart Claude Code. The tools appear with the mcp__macbot__ prefix.
Tool reference
Observation
Tool | Description |
| Dump the accessibility tree of any app. Returns roles, titles, values, descriptions, and screen coordinates. Configurable depth and node limit. This is the primary observation tool — use it before reaching for screenshots. |
| Search for UI elements by name and/or role. Returns matches with coordinates. Find that "Submit" button without scanning the whole tree. |
| Get the current URL from the active browser's address bar (Firefox, Chrome, Safari). |
| List all visible windows with app name, title, position, and size. |
| Capture full screen, a specific window, or a region. Returns a PNG file path. The fallback when you genuinely need pixels. |
Action
Tool | Description |
| Press an element by name/role directly through the Accessibility API — no coordinates, no mouse, no focus change. Works on occluded windows and elements scrolled out of view. Prefer this over find+click for buttons, links, and tabs. |
| Click at screen coordinates. Uses Quartz CGEvents (falls back to cliclick if installed). Accepts |
| Click and drag between two points. Configurable duration for smooth drags. Works for rotating 3D plots, selecting text, moving windows. |
| Scroll at a screen position. Vertical and horizontal. Also accepts |
| Type text into an app. Pass |
| Send a key press with modifiers. Supports named keys (return, tab, escape, arrows, F-keys) and characters with command/option/control/shift. Also accepts |
| Bring an application to the front and verify it's frontmost. For typing, prefer |
| Read the system clipboard. |
| Set the system clipboard. |
The focus race (why app= exists)
An agent's tool calls are separated by seconds of thinking time. If you call
mac_focus_app in one tool call and mac_type_text in the next, the terminal
running the agent frequently reclaims focus in the gap — and the text lands in
the agent's own input box instead of the target app. Focus and action must
happen inside a single call. That's what the app= parameter on
mac_type_text and mac_key_press does: activate, wait until the app is
verified frontmost, then act.
Escape hatch
Tool | Description |
| Execute arbitrary AppleScript. Full access to System Events, app scripting dictionaries, and everything else AppleScript can do. |
Browser automation via the Accessibility API
Modern browsers expose their full UI through the macOS Accessibility API. macbot reads this directly — no browser extension, no WebDriver, no Playwright needed.
Read the tab bar with element coordinates:
> mac_ui_tree app="Firefox" max_depth=5 max_nodes=50
AXApplication title="Firefox"
AXWindow title="GitHub - anomalous3/macbot-mcp" @36,30 1752x957
AXGroup desc="GitHub - anomalous3/macbot-mcp" @36,30 1752x957
AXToolbar desc="Browser tabs" @36,30 1752x44
AXTabGroup (tab group) @190,30 1518x44
AXRadioButton title="GitHub - anomalous3/macbot-mcp" value="True" @193,30 210x44
AXRadioButton title="New Tab" @403,30 210x44Find a specific element and get its click coordinates:
> mac_ui_find app="Firefox" name="Submit" role="AXButton"
{
"match_count": 1,
"window_titles": ["GitHub - anomalous3/macbot-mcp"],
"matches": [
{"role": "AXButton", "title": "Submit", "x": 450, "y": 320, "width": 80, "height": 32}
]
}The window titles come back with every search, so an empty result tells you why it was empty — wrong page, still loading, or the window is gone.
Press it without coordinates — no mouse, no focus change:
> mac_ui_press app="Firefox" name="Submit" role="AXButton"
{"status": "ok", "pressed": {...}, "match_count": 1}Get the URL without screenshots or clipboard tricks:
> mac_ui_url app="Firefox"
{"url": "https://github.com/anomalous3/macbot-mcp", "field": "Search with Google or enter address"}Use Firefox. It exposes the richest accessibility tree of the major browsers — more element detail, better labeling, and more consistent structure than Chrome or Safari.
The coordinate system
All coordinates are absolute screen pixels in macOS logical coordinates (not Retina physical pixels). Origin (0,0) is the top-left of the primary display.
The @x,y WxH format in mac_ui_tree output gives position and size directly. To click the center of @450,320 80x32, click at (490, 336).
Works with everything
macbot works with any macOS application that implements the Accessibility API (which is most of them):
Browsers — Firefox, Chrome, Safari (Firefox recommended for richest tree)
Terminals — kitty, Terminal.app, iTerm2 (can read content, type commands)
Editors — VS Code, Sublime Text, TextEdit
System apps — Finder, System Settings, Activity Monitor
Any app — if it has windows and controls, macbot can probably read and drive it
Configuration
Variable | Default | Description |
|
| Directory for screenshot PNGs |
Platform
macOS only. For Windows, see ahk-mcp. The approach is the same — read the accessibility tree, act via synthetic input — just different platform APIs.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Control real Android and iOS devices with LLM agents — tap, swipe, type, automate flows.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Turn any webpage into a structured action manifest — clickable, fillable, submittable elements.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables high-speed native macOS automation for Claude by interacting directly with the Accessibility API, AppleScript, and UI trees instead of using screenshots. It allows users to read app states, click elements, and type text semantically across any macOS application.1310MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to automate macOS desktop tasks including mouse control, keyboard input, screenshots, window management, and UI interaction.14414MIT
- AlicenseNot gradedqualityDmaintenanceProvides native macOS desktop automation for AI agents, enabling screen capture, mouse/keyboard control, window management, and iOS/Android simulator control in both foreground and background modes without focus stealing.3MIT
- AlicenseAqualityDmaintenanceEnables AI agents to control macOS desktop apps via screenshots, mouse clicks, keyboard input, accessibility queries, and AppleScript.1115MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/anomalous3/macbot-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server