affinity-mcp
Drives the Affinity design app on macOS through GUI automation: takes screenshots and performs clicks, drags, typing, key presses, hotkeys, scrolling and menu selection. Lets an agent launch Affinity, create and edit documents, draw shapes, move objects, set panel fields (position, size, colour hex), and choose menu items, with batch execution of multiple steps returning a final screenshot.
Click on "Deploy 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., "@affinity-mcp open Affinity, create an A4 document and draw a red circle"
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.
affinity-mcp
An MCP server that lets Claude (Claude Code, Claude Desktop or any MCP client) use the Affinity design app on macOS the way a person would: it looks at screenshots, then clicks, drags, types and presses shortcuts.
Affinity has no scripting API, so this works with any version and any studio (Vector, Pixel, Layout). You don't need API keys or plugins.
Tools
Tool | What it does |
| Launch Affinity or bring it to the front |
| Screenshot of the screen (downscaled to 1280 px); all coordinates refer to the last one |
| Left/right/middle click at (x, y) |
| Double-click at (x, y) |
| Drag from (x1, y1) to (x2, y2): draw shapes, move objects, drag sliders |
| Type text (via clipboard, so Cyrillic and emoji work) |
| One key: |
| Key combo, e.g. |
| Scroll, optionally over a given point |
| Set a panel field (X/Y/W/H, colour hex...) and commit it |
| Choose any menu item by path, e.g. |
| List menu names, so the model can find the exact path |
| Run many steps in one call and return one screenshot at the end, which is the fast path |
click also accepts modifiers (e.g. ["command"] for multi-select).
Every action returns a fresh screenshot by default (screenshot_after=false turns it off).
Before every action the server brings Affinity back to the front, so the terminal can't take the clicks.
Related MCP server: Affinity MCP Server
Requirements
macOS, Python 3.13+, uv
Affinity installed (
/Applications/Affinity.app)Permissions for the app that runs your MCP client (Terminal, iTerm, Ghostty, VS Code, Claude): System Settings → Privacy & Security → Accessibility and Screen Recording. Without them, macOS silently ignores clicks and returns an empty screenshot. The server detects this and tells you what's missing.
Install
git clone https://github.com/resccrew/affinity-mcp.git
cd affinity-mcp
uv syncClaude Code
claude mcp add -s user affinity -- uv --directory /path/to/affinity-mcp run affinity-mcpClaude Desktop
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"affinity": {
"command": "uv",
"args": ["--directory", "/path/to/affinity-mcp", "run", "affinity-mcp"]
}
}
}Restart the client, then ask e.g. "open Affinity, create an A4 document and draw a red circle".
Tips
Keyboard shortcuts are more reliable than clicking small icons:
Cmd+Ncreates a document (tiles on the welcome screen ignore single synthetic clicks).Coordinates are always relative to the last screenshot. The server maps them to real screen points, including Retina scaling.
Safety
The server moves your real mouse and keyboard, so don't use the computer while it works. To abort, move the mouse into any screen corner (pyautogui failsafe).
Screenshots of the whole screen go to the model, so close windows with private data first.
Development
uv run pytestTests use a fake screen and need no display or permissions.
License
MIT
Available Tools
13 toolsbatchA
Run many GUI steps in one call, one screenshot at the end. Stops at the first failing step.
Each step: {"action": ..., ...}. Actions: click{x,y,button?,modifiers?}, double_click{x,y}, drag{x1,y1,x2,y2,duration?}, type{text,press_enter?}, key{key}, hotkey{keys}, scroll{amount,x?,y?}, field{x,y,value}, menu{path}, wait{seconds}. Coordinates refer to the last screenshot taken before this call.
Inputs: steps (required), screenshot_after.
clickB
Click at (x, y) in the last screenshot. button: left/right/middle; modifiers e.g. ["command"].
Inputs: x (required), y (required), button, modifiers, +1 more.
double_clickC
Double-click at (x, y) in the last screenshot.
Inputs: x (required), y (required), screenshot_after.
dragC
Drag with the left button from (x1, y1) to (x2, y2) in the last screenshot.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more.
hotkeyC
Press a key combination, e.g. ["command", "n"] for a new document.
Inputs: keys (required), screenshot_after.
open_affinityC
Launch or bring the Affinity app to the front.
Inputs: screenshot_after.
press_keyC
Press one key, e.g. enter, esc, tab, up, down, backspace.
Inputs: key (required), screenshot_after.
screenshotA
Take a screenshot of the whole screen. Coordinates for other tools refer to this image.
Inputs: no named parameters.
scrollB
Scroll: positive = up, negative = down. Pass x, y (last screenshot) to scroll over a specific area.
Inputs: amount (required), x, y, screenshot_after.
set_fieldB
Replace the value of a panel field at (x, y) (X/Y/W/H, colour hex, ...) and commit with Enter.
Inputs: x (required), y (required), value (required), screenshot_after.
type_textC
Type text into the focused field (via clipboard, so any language works). press_enter sends it.
Inputs: text (required), press_enter, screenshot_after.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools have clearly distinct purposes: click vs double_click, type_text vs press_key vs hotkey are all separable. The only mild overlaps are between menu and list_menu, and between direct click/drag actions and the batch wrapper, but descriptions make the intended use clear.
Nearly all names follow snake_case with a verb_noun or clear action pattern (type_text, press_key, list_menu, open_affinity). Minor deviations like the bare nouns 'menu' and 'batch' are still readable and consistent in casing.
13 tools is well-scoped for a GUI-automation server, covering input primitives, menu access, screenshotting, and batch execution without bloat. Each tool earns its place.
The surface covers the full input lifecycle (screenshot, click, double-click, drag, type, keys, hotkey, scroll, field, menu, batch, launch). Minor gaps like an explicit hover/move or context-menu helper are workable via click with right button.
Maintenance
Related MCP Connectors
Render and edit design images in Claude, then create interactive pages and PDF decks.
1Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
1Remote desktop MCP: let AI see, click, type and run terminal commands on your own Windows or Mac.
1
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to see and interact with any macOS application using natural language commands. Perfect for testing Mac applications, UI automation, and app development with AI assistance.34MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to control the Affinity creative suite on macOS through natural language, allowing for automated design tasks, UI interaction, and file operations. It leverages AppleScript and System Events to bridge AI commands with professional creative software.38MIT
- 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.12 npm13MIT
- AlicenseAqualityBmaintenanceMCP server that lets Claude use your Mac — native apps and the browser — by remembering what it has seen instead of screenshotting every step.122MIT