← All guides

Design handoff · 6 min

Sketch to a coding agent: an MCP server inside the app

Sketch ships an MCP server in the Mac app that lets an agent read the layer tree, pull assets and run code against the open document. That last capability is unusual, and it changes what you can ask for.

Updated


Most design tools bolted an MCP server on as a separate service. Sketch put one inside the Mac app, where it runs against the document you have open — from version 2025.2.4 onwards, with nothing extra to install.

That placement produces a capability the other routes do not have, and it is worth understanding before deciding this is just Figma with a smaller market share.

What the agent can do

Connected, an agent can:

  • Read the layer tree of the open document — the structure, names, and properties.
  • Pull assets out of it directly.
  • Take screenshots of the document, so it can see the rendering as well as the description.
  • Run SketchAPI code against the open file.

It works with Claude Code, Claude Desktop, Cursor, VS Code and Codex, along with other MCP-compatible clients. There is also an implement-design skill for one-to-one design-to-code work, and sharing a Sketch link that contains a frame URL makes the agent select and focus that frame as the implementation target — the equivalent of scoping a Figma selection, and just as necessary for the same reason: handing an agent a whole document floods its context with geometry it cannot use.

Registering it with each client

The server runs inside the app, so there is no endpoint to provision and no token to rotate — but each client still registers it in its own place, and the differences decide who on your team actually gets it.

Claude Code

Register the server with claude mcp add and confirm it with /mcp in a session. Because the server is local to the machine running Sketch, this is per-developer configuration rather than something committed for the team. If Sketch is open on a designer's Mac and Claude Code is running on a developer's, they are not talking to the same document — a point worth settling before anyone plans a workflow around it.

Cursor

Cursor reads .cursor/mcp.json at the repository root. Committing it is the usual advice and is misleading here: the entry will exist for everyone on the repository, and it will only resolve for the people running Sketch locally. Expect to explain that once.

Codex

Codex takes an [mcp_servers.*] block in ~/.codex/config.toml. User-level rather than repository-level, which suits this route better than the others — the configuration follows the person who has Sketch installed, which is exactly the population that can use it.

VS Code and Claude Desktop

Both are supported clients. Claude Desktop is the better environment for the audit work described below, because the answers are things you read rather than code you ship. VS Code is the better one if the output is going straight into a file.

The unusual part: executing code against the document

Reading a layer tree is table stakes. Running SketchAPI code against the open file is not, and it changes the kind of request that makes sense.

Every other route in this series is one-directional and descriptive: the agent receives a description of a design and writes code somewhere else. Here the agent can query the document as a database and act on it.

That makes a different class of question answerable:

  • Find every text layer not using one of our two typefaces.
  • List every distinct fill colour in this document and how many times each is used.
  • Export every icon in this page as SVG, named after its layer.
  • Find symbols that are near-duplicates of each other.

These are audits, and they are the tedious work that never gets done because nobody has three hours to click through a document counting greys. An agent with programmatic access does them in one pass — and unlike generation, an audit is a task where being fast and literal is exactly the right quality.

If you take one thing from this route, it is that the interesting use is not "build this screen". It is "tell me what is actually in this file".

The macOS constraint, stated plainly

The server is part of the Sketch Mac app. There is no Windows or Linux path, and no hosted endpoint that reaches the document from elsewhere.

For a solo designer-developer on a Mac, this is invisible. For a team, it is a real limit and worth deciding about early: the handoff only exists on machines running the Sketch app, which usually means it is available to designers and not to the developers who would otherwise be driving it from their own agent. The document also has to be open. This is a live-document integration, not a file API — nobody is fetching last week's design at 2am from CI.

Compare that with the Figma route, where the recommended path is a remote hosted endpoint that needs no desktop app at all. Neither model is wrong; they answer different questions about where the design should be reachable from.

Where it lands in the same place as everything else

Scope the selection to a frame, keep the document tidy with real symbols and shared styles, and the generated code is good. The failure mode arrives on the screen that is not in the document.

The server can tell an agent that this heading is 24px in Newsreader with tracking of −0.03em. It cannot tell it that Newsreader is the display face and is banned below 24px, which is the rule that decides what happens on the settings page nobody drew. It can report that a fill is #E8511E. It cannot report that the accent means "act here" and is never body text.

The audit capability makes this sharper rather than softer. An agent can now tell you that your document contains eleven distinct greys — genuinely useful, and it still cannot tell you which four are the system and which seven are drift. That answer was never in the file. It is a decision somebody made, or should have.

Written down with the reason attached, those rules are what let an agent build something new that belongs to the same product. As building a colour palette you can defend argues, the rule is the part that generalises. A few properties are worth insisting on in anything that holds them, and which moodspec's endpoint enforces: it is read-only, so a leaked token exposes taste rather than write access; the token is scoped to one canvas rather than an account; and an agent can only ever propose an edit through propose_change, which a person approves. The docs are one block of config, and there are setup guides for Claude Code, Cursor and the rest.

The test

Connect the server and ask for the audit rather than the screen: list every distinct fill colour in this document, with a count of how many layers use each.

Read the result. If the list is four or five colours with obvious counts, your document is a system and the handoff will behave. If it is twenty-three, with six that differ by one hex digit, you have just found out why generated screens keep coming back subtly wrong — and no MCP server is going to resolve that for you, because the document does not know which of the twenty-three you meant.

Further reading

Common questions

Does Sketch have an official MCP server?
Yes. It is built into the Mac app from version 2025.2.4 onwards, so there is nothing separate to install — it runs against the document you have open.
Which coding agents can connect to it?
Claude Code, Claude Desktop, Cursor, VS Code, Codex and other MCP-compatible clients.
What can an agent actually do with it?
Read the layer tree, pull assets, take screenshots of the document, and run SketchAPI code against the open file. The last one is the unusual capability — the agent can query and manipulate the document programmatically rather than only reading a description of it.
How do I point the agent at one specific frame?
Share a Sketch link containing the frame URL. The agent selects and focuses that frame as the implementation target rather than working across the whole document.
Does it work on Windows?
No. The server is part of the Sketch Mac app, so the whole route is macOS-only — a real constraint for any team whose developers are not all on Macs.

Keep reading