Straypixel
Designing an API that AI agents can read
I built the MCP server that lets AI agents read, edit and hand back work in Straypixel. The hardest design work wasn't the screens. It was the names.
Role: Designer and builder · API and product design · When: 2026
| At a glance | Details |
|---|---|
| My role | Designer and builder: product design, API design, naming, and the safety model |
| Product | Straypixel, a browser-based collaborative design tool I’m building, formerly called Frey |
| What I built | An MCP server, so AI agents like Claude and Cursor can read design files, edit designs and code, comment, and hand work back for review |
| Scale today | 57 tools, 3 permission scopes, and one set of design operations shared with the app’s built-in AI |
| Users | Two at once: the AI agent reading the tool descriptions, and the person who has to trust what it did |
01 — Who is the user of an API?
An API usually has one reader: a developer, once, with the docs open in another tab.
An MCP server has a stranger reader. An AI agent reads every tool name and description, every single time, and decides what to call from the words alone. It can’t ask a colleague. It doesn’t skim. If a name is ambiguous, it guesses, and then it acts on the guess inside someone’s design file.
And behind the agent there’s a person. A designer who connected Claude to their file and now has to trust that it didn’t wreck the component library.
So I treated the server as a product with two users:
- The agent needs names it can’t misread, descriptions that say exactly what happens, and errors it can act on.
- The person needs to see what changed, approve it, and undo it, without reading any JSON.
Decision: design the vocabulary before the interface. If the words are right, both users get it.
02 — A vocabulary before an interface
Before writing tools, I wrote rules for naming them. A tool name is the first, and sometimes only, thing an agent reads.
The verbs tell the agent what kind of thing will happen before it reads anything else.
| Rule | Example | Why |
|---|---|---|
Tools are verb_noun in snake_case |
get_layer, list_files, create_branch |
Easy for a model to read, and nothing to guess about capitals |
get_ returns one thing, list_ returns many |
get_file and list_files |
The plural is in the verb, not hidden in the noun |
find_ and search_ take a query |
find_layers, search_business_context |
Different from list_, which just lists |
plan_ is a dry run |
plan_export and run_export |
Same input, so an agent can check before it acts |
| Writes say exactly what they change | edit_code_file replaces text, write_code_file replaces the whole file |
Two tools, two clear outcomes, no mode flags |
| Use words people already trust | commit, create_branch, get_status (“like git status”), get_log |
Designers and agents already know what a branch and a commit mean |
| Merging gets its own verb and scope | merge_merge_request |
It’s the one action that touches the main file |
There are 18 get_ tools and 11 list_ tools. Most of what an agent needs is looking, and looking is safe.
One subtlety took a while to get right. Scope follows the effect, not the verb. run_build and run_tests start work but change nothing, so they’re read tools. run_export renders files on the server, so it needs write access.
Rule: a name should tell you what happens, how much, and whether it’s safe, before you read the description.
03 — Fewer tools, bigger verbs
The obvious way to let an agent edit a design is one tool per action: create frame, set colour, move layer and so on. That’s a hundred tools, and a hundred chances to pick the wrong one.
I went the other way. There’s one editing tool, edit_design. It takes a batch of operations, the same validated operations the app’s built-in AI already uses. One vocabulary, two clients.
Inside the batch the naming switches to camelCase verb plus noun, the language of the document model: createFrame, createText, updateStyle, updateLayout, groupNodes, applyDesignToken. About forty operation types in all.
{
"dry_run": true,
"operations": [
{ "op": "createFrame", "ref": "new:card", "parent": "page" },
{ "op": "createText", "ref": "new:title",
"parent": "new:card", "text": "Monthly report" },
{ "op": "applyDesignToken", "target": "new:card",
"property": "fill", "token": "{color.surface}" }
]
}
Three small naming decisions made batches work:
"page"means the page itself, so an agent never needs to look up its id."new:<name>"refers to a layer created earlier in the same batch, so one batch can build a card and then style it.{color.primary}is how tokens are written everywhere: in operations, in code export and in the docs.
Even the validation errors are written as examples. Get it wrong and the message says “New layer reference like new:hero-title” or “Design token reference like {color.primary}”. An agent learns the convention from the error and fixes itself on the next try.
Rule: when the user is a model, every error message is a lesson. Write it like one.
04 — Designing for trust
Letting an AI edit someone’s design file is a trust problem first and a technical problem second. So I designed the whole flow around one promise: an agent can never change your main file on its own.
Every edit takes the long way home, on purpose.
- Branch first. Edits to a main file go to the agent’s own branch, named
ai/<app name>. The branch is created on the first successful edit and reused until it’s merged. - All or nothing. Every batch is checked on a private copy first. If one operation fails, nothing is applied, and the error says which operation and why.
- Look before you leap.
dry_run: truestops after the check.screenshot: truereturns pictures of the frames that changed, so the agent sees its own work. - Live, but separate. Anyone with the branch open sees the agent’s edits as they happen, like a colleague working next to you.
- A person merges. The agent commits and opens a merge request. A person reviews and merges it.
- Errors you can act on. A missing layer or a rejected batch comes back as a normal result marked as an error, with a message the agent can fix. It’s never a crash.
Rule: make the safe path the only path, then make it fast.
05 — Scopes people understand
Permissions are product design too. The consent screen is where a person decides how much to trust an app, so the scopes had to read like plain choices.
| Scope | What it allows | Default |
|---|---|---|
mcp:read |
Everything you can see: files, layers, screenshots, tokens, code, comments | Always on |
mcp:write |
Edit designs and code on a branch, commit, open merge requests, comment, export | On request |
mcp:merge |
Merge approved requests into main files | Off unless you turn it on |
A few decisions behind it:
- Agents act as you. They see only your files, with your role. A viewer’s agent can’t edit.
- You can narrow it. The sign-in uses OAuth 2.1 with PKCE, and the consent screen lets you remove scopes before you allow access.
- MCP tokens open MCP only. They don’t work on the regular REST API, so a connected agent can’t wander off.
- Limits. 300 requests a minute per token, so a looping agent can’t hammer the server.
Rule: a scope name should finish the sentence “I’m letting this app…”.
06 — Renaming without breaking anything
Along the way, the product changed its name from Frey to Straypixel. Renaming a product is easy. Renaming an API that people and agents already depend on is not.
So I split the names into two kinds:
- Names people see changed: the product, the CLI (
straypixel, withfreystill working), the docs, and new webhook headers (X-Straypixel-*). - Names machines depend on stayed: the
frey_pat_,frey_svc_andfrey_hook_token prefixes, the session cookie, the@frey/*packages, and the oldX-Frey-*webhook headers, which are still sent alongside the new ones.
Existing installs, sign-ins, saved files, tokens and webhooks kept working through the rename.
The same idea shows up in the code export. A name is decided the first time a layer reaches code, and then it’s kept. Renaming a layer later doesn’t silently rename a CSS class or a component prop and break someone’s code.
Rule: a published name is a promise. Change what people read, keep what machines rely on.
07 — What I’d tell another designer about API naming
- Your API has readers, not just callers. Write names and descriptions for the one that reads everything literally.
- Put the effect in the verb.
get_,list_,create_,edit_,delete_. The verb should say how much changes. - Borrow words people already trust. Branch, commit and merge request carry their meaning for free.
- Prefer one big, well-described verb to many tiny ones.
edit_designwith a batch beats a hundred single-purpose tools. - Give people and models handles.
"page","new:card"and{color.primary}are small names that remove whole classes of mistakes. - Make errors teach. Include an example of the right shape in every validation message.
- Scope by effect, not by verb. Running a build that changes nothing is reading.
- Never rename what machines depend on. Add the new name next to the old one instead.
08 — What’s next
Planned, not built yet:
- More scopes, for managing files, sharing, driving the person’s open editor, writing to connected tools like Jira, and administration. Each is optional on the consent screen.
- Tool groups. Complete app control would mean roughly 150 tools, which would crowd an agent’s context. Grouping them, and loading a group on demand, keeps the vocabulary small at any one time.
- Hints on every tool, marking which are read-only, which are destructive and which are safe to repeat. Destructive actions will ask for confirmation first.
- A parity test. Every app feature will be mapped to a tool, or to a written reason why it’s excluded. The build fails if a new feature has neither, so the API can’t quietly fall behind the app.
The interface an AI agent sees is made of words. Designing those words is still design.