Affinity MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/sekharmalla/affinity-mcp-server.git
cd affinity-mcp-server
bun install
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add affinity-mcp-server -- bun run "<FULL_PATH_TO_AFFINITY_MCP_SERVER>/dist/index.js"

Replace <FULL_PATH_TO_AFFINITY_MCP_SERVER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Let AI control Affinity creative suite on macOS

Affinity MCP Server

Let AI control Affinity creative suite on macOS

The poster above was designed in Affinity and exported by Claude — through this very MCP server.


What is this?

An MCP (Model Context Protocol) server that gives AI assistants like Claude full control over the Affinity creative suite on macOS. It bridges the gap between AI and professional design software — launch apps, navigate menus, draw shapes, apply filters, export files, and more — all through natural language.

Features

  • 23 tools covering the complete Affinity workflow
  • Unified Affinity app support (Affinity by Canva)
  • Menu navigation — browse and click any menu item up to 4 levels deep
  • UI inspection — read buttons, dialogs, text fields, and interact with them
  • Mouse & keyboard — click, drag, type text, send shortcuts and key codes
  • Screenshots — capture the Affinity window for visual feedback
  • Document ops — create, open, save, export, flatten, rotate, flip
  • Layers & filters — add layers, list filters, import macros

Prerequisites

  • macOS (uses AppleScript and System Events)
  • Affinity by Canva (v2 — the unified app)
  • Bun runtime (v1.0.0+)
  • Accessibility permissions — System Settings > Privacy & Security > Accessibility — grant access to your terminal app and/or Claude Desktop

Quick Start

# Clone the repo
git clone https://github.com/sekharmalla/affinity-mcp-server.git
cd affinity-mcp-server

# Install dependencies
bun install

# Run the server
bun run start

Install as Claude Code Plugin

The easiest way to get started with Claude Code — one command, no manual config:

claude plugin add /path/to/affinity-mcp-server

This automatically:

  • Registers the MCP server (all 23 tools available immediately)
  • Installs the affinity-design skill — workflow guidance that teaches Claude how to orchestrate the tools for real design tasks (create posters, export files, navigate menus, etc.)

The skill is the key value-add: the MCP tools are low-level primitives (click here, type this), but the skill provides high-level workflow knowledge (how to create a poster, how to export for web, how to navigate Affinity's UI patterns).

Configuration

Add the server to your AI client's MCP configuration:

Claude Code

claude mcp add affinity-mcp-server bun run /path/to/affinity-mcp-server/index.ts

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "affinity-mcp-server": {
      "command": "bun",
      "args": ["run", "/path/to/affinity-mcp-server/index.ts"]
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "affinity-mcp-server": {
      "command": "bun",
      "args": ["run", "/path/to/affinity-mcp-server/index.ts"]
    }
  }
}

VS Code

Add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "affinity-mcp-server": {
      "command": "bun",
      "args": ["run", "/path/to/affinity-mcp-server/index.ts"]
    }
  }
}

Tool Reference

App Lifecycle

Tool Description
affinity_status Check if Affinity is running, list open windows
affinity_launch Launch Affinity if not already running

File Operations

Tool Description
affinity_open_file Open a file in Affinity (image, .af, .psd, .svg, etc.)
affinity_new_document Create a new document, optionally from last preset
affinity_save Save or Save As the current document
affinity_export Export via File > Export (PNG, JPG, SVG, PDF, etc.)
affinity_close_document Close the current document

Menu System

Tool Description
affinity_click_menu Click any menu item by path (up to 4 levels deep)
affinity_get_menus List all items in a top-level menu
affinity_get_submenu List items in a submenu

UI Inspection & Interaction

Tool Description
affinity_get_ui Inspect the front window — buttons, text fields, dialogs
affinity_click_ui Click a UI element by description or title

Input

Tool Description
affinity_keystroke Send a keystroke with optional modifiers
`affinity_key_co

Tools (13)

affinity_statusCheck if Affinity is running and list open windows
affinity_launchLaunch Affinity if not already running
affinity_open_fileOpen a file in Affinity
affinity_new_documentCreate a new document, optionally from last preset
affinity_saveSave or Save As the current document
affinity_exportExport via File > Export
affinity_close_documentClose the current document
affinity_click_menuClick any menu item by path
affinity_get_menusList all items in a top-level menu
affinity_get_submenuList items in a submenu
affinity_get_uiInspect the front window elements
affinity_click_uiClick a UI element by description or title
affinity_keystrokeSend a keystroke with optional modifiers

Configuration

claude_desktop_config.json
{"mcpServers": {"affinity-mcp-server": {"command": "bun", "args": ["run", "/path/to/affinity-mcp-server/index.ts"]}}}

Try it

Check if Affinity is running and list the currently open documents.
Create a new document and draw a shape using the menu navigation tools.
Export the current document as a PNG file to my desktop.
Inspect the UI of the current window to find the export button.
Apply a specific filter to the active layer using the menu system.

Frequently Asked Questions

What are the key features of Affinity MCP Server?

23 tools covering the complete Affinity workflow. Menu navigation up to 4 levels deep. UI inspection to read buttons, dialogs, and text fields. Mouse and keyboard simulation for interaction. Document operations including create, save, and export.

What can I use Affinity MCP Server for?

Automating repetitive design tasks like batch exporting assets.. Creating complex document layouts through natural language commands.. Navigating deep menu structures in Affinity without manual clicking.. Integrating AI-driven design workflows directly into the Affinity suite..

How do I install Affinity MCP Server?

Install Affinity MCP Server by running: git clone https://github.com/sekharmalla/affinity-mcp-server.git && cd affinity-mcp-server && bun install

What MCP clients work with Affinity MCP Server?

Affinity MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Affinity MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare