Skip to main content
Glama
affinity-mcp

affinity-mcp

by resccrew

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

open_affinity

Launch Affinity or bring it to the front

screenshot

Screenshot of the screen (downscaled to 1280 px); all coordinates refer to the last one

click

Left/right/middle click at (x, y)

double_click

Double-click at (x, y)

drag

Drag from (x1, y1) to (x2, y2): draw shapes, move objects, drag sliders

type_text

Type text (via clipboard, so Cyrillic and emoji work)

press_key

One key: enter, esc, tab, v (Move tool), m (Rectangle)...

hotkey

Key combo, e.g. ["command", "n"] new document, ["command", "z"] undo

scroll

Scroll, optionally over a given point

set_field

Set a panel field (X/Y/W/H, colour hex...) and commit it

menu

Choose any menu item by path, e.g. ["Vector","Geometry","Add"], with no clicks

list_menu

List menu names, so the model can find the exact path

batch

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 sync

Claude Code

claude mcp add -s user affinity -- uv --directory /path/to/affinity-mcp run affinity-mcp

Claude 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+N creates 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 pytest

Tests use a fake screen and need no display or permissions.

License

MIT

Available Tools

13 tools
batchA

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.

list_menuB

List menu names: [] = menu bar, ["Vector"] = its items, ["Vector", "Geometry"] = submenu.

Inputs: path.

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

    B3.3/5.0

    Scored across 13 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      38
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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 npm
      13
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server that lets Claude use your Mac — native apps and the browser — by remembering what it has seen instead of screenshotting every step.
      12
      2
      MIT