nexus
v0.3.0MCP server that lets any AI agent drive the Nexus design tool over a local WebSocket bridge.
@synkitnet/nexus > Your Nexus effects, everywhere your AI agent works. @synkitnet/nexus is a Model Context Protocol server. It gives your agent (Claude Code, Claude Desktop, Cursor, any MCP client) Nexus itself: your effects, their settings, and the hands to use them. The agent reaches the Nexus editor in your browser and the Nexus panels inside Photoshop, After Effects, Illustrator and Affinity, so it can read the canvas, create and tune filters, and put a live Nexus effect on a layer there: the things you'd otherwise do by hand.
Summary extracted from the README.
@synkitnet/nexus
Your Nexus effects, everywhere your AI agent works.
@synkitnet/nexus is a Model Context Protocol server. It gives your agent (Claude Code, Claude Desktop, Cursor, any MCP client) Nexus itself: your effects, their settings, and the hands to use them. The agent reaches the Nexus editor in your browser and the Nexus panels inside Photoshop, After Effects, Illustrator and Affinity, so it can read the canvas, create and tune filters, and put a live Nexus effect on a layer there: the things you'd otherwise do by hand. Everywhere else it brings the Nexus window: a picture goes in as a file, the look is set there, and the result comes back as a file.
Nexus is the same in each of those places: the same effects, the same controls, the same library on your account. So a look is not stuck where you made it. Ask for "the style I used on that layer" while you are making something else, and the agent reads the effect and its settings where you used it, sets the same on the new pictures, and puts the results wherever it is working.
┌──────────────┐ stdio ┌────────────────┐ ws://127.0.0.1 ┌──────────────────┐
│ Your agent │ <──────> │ MCP server │ <────────────────> │ Nexus editor │
│ (MCP host) │ │ (this pkg) │ │ (browser tab) │
└──────────────┘ └────────────────┘ └──────────────────┘
The server is a thin router: it tells the agent what tools are available, forwards each call to the editor over a local WebSocket, and returns the result. The actual logic — every layer mutation, every snapshot, every store read — lives in the editor.
Install
You don't install anything ahead of time. Your MCP client runs @synkitnet/nexus through npx. Every snippet below names an exact version, so your agent runs the version you chose and never a newer one you have not seen. To move to a newer version, change the number.
Claude Code
claude mcp add nexus -- npx -y @synkitnet/nexus@0.3.0
Then restart Claude Code.
Cursor
Add to ~/.cursor/mcp.json (create if missing):
{
"mcpServers": {
"nexus": {
"command": "npx",
"args": ["-y", "@synkitnet/nexus@0.3.0"]
}
}
}
Restart Cursor.
Codex
Add to ~/.codex/config.toml (create if missing):
[mcp_servers.nexus]
command = "npx"
args = ["-y", "@synkitnet/nexus@0.3.0"]
Fully quit and reopen the Codex app — new threads inside the same session won't pick up the config change.
Claude Desktop
Add to your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nexus": {
"command": "npx",
"args": ["-y", "@synkitnet/nexus@0.3.0"]
}
}
}
Restart Claude Desktop.
Other MCP clients
Any client that speaks the stdio MCP transport works. Use npx -y @synkitnet/nexus@0.3.0 as the server command.
Nothing to open
Ask your agent for a filter and it makes one: create_filter is one call, and the answer is a card in the conversation with the picture and the filter's controls. No editor tab, panel or window has to be open. With nothing connected, the server runs the Nexus window's own page in your browser's headless mode (Chrome or Edge), in a browser profile of its own at ~/.nexus-mcp/engine, with no window on your screen. That page is the site's: this package still holds no render code.
The first time, that profile has no Nexus account, so a window with the Nexus sign-in page opens once. Sign in there (your email, then the code Nexus emails you); the window closes by itself, and nothing opens after that.
A browser asks before a site may reach a program on your computer, and a hidden browser cannot ask. So before it starts that profile, the server writes the answer into it: Allow, for the Nexus site's own origin and no other, in that profile only. Your everyday browser profile is never touched. The hidden page closes itself three minutes after the last agent session ends, or after 45 minutes with nothing asked of it. NEXUS_ENGINE=0 turns the background run off; the Nexus window is then opened on screen instead.
A filter made this way is not saved until you press Save to my filters in its card.
Open the editor
For work on a canvas (layers, text, vectors), the agent needs a Nexus tab to connect to.
- Go to nexus.synkit.net. A local dev build needs its exact origin in
NEXUS_MCP_ALLOWED_ORIGINS, for examplehttp://localhost:3000. - Open Plugins, then Agents, and connect. You'll see your agent there once the bridge is running.
Agent access is in a closed beta for now: the Agents entry appears for accounts that have been let in. Each plan includes a weekly number of agent calls.
The first time an HTTPS page (nexus.synkit.net) reaches the local bridge, Chrome will show a Private Network Access prompt asking you to allow the connection. Approve it once; subsequent sessions auto-allow.
What the agent can do
The editor announces its own tools when it connects (bridge protocol 3), with JSON Schemas generated from the handlers, so the list your agent sees always matches the editor build it talks to. Before an editor connects, the server lists a built-in fallback. The full agent guide is the get_guide tool, docs/AGENT_API.md in the main repo, and the /docs/agent page.
Agent API (read the document, write in typed batches, look at the result):
| Tool | What it does |
|---|---|
get_document |
The canvas as an outline (one line per layer) or as Nexus Scene v1 JSON. Call it first. |
get_selection |
What the user selected ("this"), the active tool, what is being edited. |
describe_layer |
One layer in full: props, param schema, keyframes, effective values, path anchors, what a filter reads. |
list_layer_types / list_fonts |
What can be created; font families, weights, italic. |
render_snapshot |
A PNG of the composition, selection, some layers or a box, returned as an image. |
get_svg |
The vector projection as SVG markup. |
show_controls |
A card next to the conversation: a picture of the result and one filter's own controls, for the person to tune by hand (see below). |
get_guide |
The agent guide (overview, scene-format, ops, text, vectors, filters, create, images, panels, window, recipes). |
apply_ops |
The batched write: create, update, delete, duplicate, move, group, ungroup, boolean, convert_to_path, flatten, set_selection, with $ref temp ids. Validated as a whole, applied as one undo step. |
set_text, add_image, write_svg |
Shortcuts: edit text, add a picture, turn SVG markup into editable paths. |
undo |
Undo the agent's own last step (refused if the user edited since). |
finish_working |
Done; clears the "agent is working here" marks. |
Older tools, for development only (NEXUS_MCP_DEV=1; Nexus pages no longer answer them): get_canvas_state, list_generator_types, add_layer, update_layer_param, update_layer_params, bulk_update_layers, duplicate_layer, set_layer_bounds, remove_layer, save_canvas_snapshot, restore_canvas_snapshot, list_canvas_snapshots, delete_canvas_snapshot, get_editor_handoff_state, apply_handoff_to_editor, render_with_generator_stack.
Every editor write is one undo step labelled Agent: … and keeps the user's selection. Results that carry pictures come back as MCP image content.
The server lists the current tools only (about 20 before an editor connects). The older ones are neither listed nor sent anywhere unless NEXUS_MCP_DEV=1 is set.
Inside Photoshop, After Effects, Illustrator and Affinity
The Nexus panel in each of those apps connects to the same server by itself when it is open and signed in. The agent then holds the panel the way a hand does, so what lands in the document is what the panel always makes: a live Smart Filter in Photoshop, the Nexus effect in After Effects, an editable layer in Illustrator.
Everywhere else, Nexus comes along as its own window (see The Nexus window).
| Tool | What it does |
|---|---|
get_panel |
The app, the layer the panel holds, the open filter with every control and value, the Show source and Keep alpha switches, and the buttons it is showing right now. Call it first. |
set_panel |
Pick a filter, set controls by key, flip the two switches. Checked against the filter; answers once the app has the change. |
panel_action |
Press one of the buttons get_panel lists (add_effect, edit_current_layer, store_current_layer, stop_editing, …). |
panel_snapshot |
The picture the panel is drawing, as an image. |
show_controls |
The same card as in the editor, for the panel's open filter. |
Pass host (photoshop, aftereffects, illustrator, affinity, window) only when more than one panel is open.
Nexus does not select layers, open documents or export in those apps. That is the app's own work: its own MCP connector where it has one, or the person's hand. The two sit side by side in one agent: the app's tools pick the layer, Nexus puts the effect on it.
A panel offers exactly these tools, the card's own two (controls_read, controls_write), get_guide and ping. The older plugin tools (capture_layers, write_layer, get_plugin_state, apply_handoff_to_plugin) are for development only (NEXUS_MCP_DEV=1).
The Nexus window
Everywhere else, the server opens Nexus as a small window beside whatever you are working in: one picture, the real Nexus panel with every filter and control, and a Send button. The agent moves the picture files. You set the look, or the agent sets it for you.
| Tool | What it does |
|---|---|
open_window |
Opens the window and puts a picture file from this computer in it. ref is the agent's own note for where the picture belongs. The same ref with no path reopens the original with the settings it was last sent with. |
offer_filters |
Shows up to 12 filters as tiles under the picture, for the person to open by hand. |
wait_for_window |
Waits for what the person does next: they pressed Send (the result comes back as a PNG file on this computer), or they opened an offered filter. |
save_window_picture |
Saves the picture the window is showing as a PNG file, without waiting for a Send. |
set_window_status |
One line in the window, so the person knows what the agent is doing. |
The panel in the window is driven with the same get_panel, set_panel, panel_snapshot and show_controls as every other panel (host: "window").
The loop: the agent gets a picture out of wherever you are working, with the tools it has there, and calls open_window with the file's path. You tune the look and press Send. wait_for_window returns the result as a file, and the agent puts that file back.
A look from somewhere else: the agent reads an effect and its settings where you used it (get_panel in a panel, describe_layer in the editor), sets the same in the window with set_panel, and takes each result with save_window_picture. What travels this way is one effect with its settings. A stack of several effects, an Array's own shapes and a picture used inside an effect are set by hand in the window.
The window is a page of the site (https://nexus.synkit.net/window), opened in Chrome, Edge, Brave or Chromium as a window of its own. The person has to be signed in to Nexus in that browser. It is part of the same closed beta and the same weekly number of agent calls as the rest. On Windows it is kept above the other windows. Elsewhere it is an ordinary window.
If the window does not connect (the person is not signed in yet, or closed it), the server does not keep opening more: at most two in a row, at least five minutes apart. After that open_window gives the address for the person to open.
Pictures never travel through the agent. The server reads the file, hands it to the window through its own picture store, and writes the result file itself, so the model sees paths and sizes only. The panel's settings for a sent picture stay in the server's own book. They are never shown to the model and never taken from it. A picture the person sent stays in the window until its file is written, so a hiccup between the two does not lose it.
What it keeps on your computer, all under ~/.nexus-mcp/ (on Windows, %USERPROFILE%\.nexus-mcp\):
out/: the result pictures (PNG). The server never deletes them, because another app may be showing one from its path. Clear the folder yourself whenever you like. Past 10,000 result pictures or 8 GB a new one is refused until you make room.originals/: a copy of each picture opened with aref, so it can be reopened later. At most 200 files and 512 MB. The least recently used go first.window-book.json: whichrefbelongs to which picture, and the settings it was last sent with. At most 300 entries.
The controls card
show_controls returns an MCP App: in an app that shows them, a card appears in the conversation with a picture of the result and the filter's sliders, switches, menus and colors. The person tunes by hand and the document follows live. In the editor each hand edit is the person's own undo step, not the agent's. In a client that shows no cards the same call returns the controls as text.
The agent can pick what the card shows: show is the few control keys the card opens on (the rest stay one press away, under All controls) and highlight marks the ones to try first. It picks from the controls there are; no text of its own goes into the card.
The card is one self-contained HTML file served as the resource ui://nexus/controls.html. It runs in the client's sandbox and loads nothing but its font. In an app that shows cards, controls_read and controls_write are marked for the card only and every other tool for the model only, so the card can call nothing but those two. Clients that show no cards are not offered them. What the card tells the model is the values the person set, as data, never a title or label someone else wrote.
Several agent sessions. The first server process owns the bridge port. A second one (another Claude session) finds the port taken and runs in proxy mode: it lists and calls tools through the first one's bridge, so both sessions have the tools. It does so only after the owner proves it holds the bridge token (see Security).
Configuration
| Env var | Default | Notes |
|---|---|---|
NEXUS_MCP_PORT |
7811 |
Port the bridge listens on. It is always bound to 127.0.0.1. |
NEXUS_MCP_ALLOWED_ORIGINS |
(unset) | Comma-separated origins to allow in addition to https://nexus.synkit.net, compared exactly. Each entry must be a plain origin such as http://localhost:3000 or https://my-nexus.example.com: no paths, no wildcards, no null. The bridge's own address is never accepted. |
NEXUS_MCP_DEV |
(unset) | 1 turns on development mode. See Security. |
NEXUS_MCP_ALL_TOOLS |
(unset) | Has an effect only together with NEXUS_MCP_DEV=1, which already lists the older tools. |
NEXUS_WINDOW_LAUNCH |
(unset) | 0 means the server never starts a browser. open_window then gives the window's address for the person to open. |
NEXUS_ENGINE |
(unset) | 0 means the server runs nothing hidden. With nothing connected, a call that needs Nexus opens the Nexus window on screen instead. |
NEXUS_WINDOW_BROWSER |
(found by itself) | Full path of the Chromium-family browser to open the window in. |
NEXUS_WINDOW_URL |
https://nexus.synkit.net/window |
The window's address. Used only when it is /window on an origin the bridge accepts (see NEXUS_MCP_ALLOWED_ORIGINS). |
NEXUS_MCP_OUT_DIR |
~/.nexus-mcp/out |
Where result pictures are written. A full local path. |
NEXUS_MCP_BOOK_DIR |
~/.nexus-mcp |
Where the window's book and kept originals live. A full local path. |
Security
The bridge is how pages in your browser and panels in your design apps reach your agent, so it decides carefully who may talk to it.
- Your computer only. The bridge listens on
127.0.0.1. Nothing on your network can reach it. - The Host rule. Every request and every socket must name the bridge itself:
127.0.0.1:<port>orlocalhost:<port>. Anything else is refused. This stops a web page that points its own domain name at your computer (DNS rebinding). - The exact origin rule. A request from a web page carries its origin, and browsers do not let a page fake it. The bridge accepts exactly
https://nexus.synkit.net, plus the exact origins you add withNEXUS_MCP_ALLOWED_ORIGINS. Every other origin is refused on every route and on the socket, with no CORS headers, so the page cannot even read the refusal. That includes othersynkit.netsites, everylocalhostport, the bridge's own address, and sandboxed frames (originnull). - What an allowed page can do. Open the socket and run the tool calls your agent sends it, store and read pictures (
/asset) and small JSON notes (/nexus-meta), and read/health. It cannot call tools over HTTP or read the tool list:POST /callandGET /catalogare refused for every page. - The token file, for local programs. A caller with no origin is a program on your computer, not a page. When the bridge starts it writes a random token to
~/.nexus-mcp/bridge-<port>.json(on Windows,%USERPROFILE%\.nexus-mcp\), readable only by you, and removes it when it stops. Apart from the Nexus window's own files (see The Nexus window), that file is the only thing this package writes. A local program must send the token in thex-nexus-bridge-tokenheader to open the socket or to use/call,/catalog,/assetor/nexus-meta. Without it, it may only read/health, which says nothing but the name, version and protocol. - Proxy mode checks the owner. A second server reads the token file and asks the port's owner to prove it holds the token (an HMAC of a fresh random value) before it sends anything there. If another program holds the port, the second server sends it nothing, and the agent is told to close that program or pick another port.
- Pictures stay pictures. Stored files are kept only as PNG, JPEG, WebP or plain bytes, and are always served as a download, with
nosniffand a sandbox policy, so a stored file can never act as a page. Ids are random, entries expire after 10 minutes, and size, count and uploads at once are capped. - Files the agent names.
open_windowreads one kind of file: a regular file that starts the way a picture does (PNG, JPEG, WebP, GIF, AVIF or BMP), up to 32 MB. For anything else the agent gets one and the same answer, whether there is no file at that path, a folder, a file your system will not let Nexus read, or a file that is not a picture. So the tool cannot be used to find out what is on your disk, and a file that is not a picture is given up on after its first 64 bytes. What it does read goes to the window, never back to the model. A read that takes longer than 15 seconds is given up on. A path that names another computer (\\server\share) is refused before anything is opened. A share that Windows shows as a drive letter, or one mounted as a folder, looks like a local disk and is read like one. Result files get a name the server makes, in its own folder, as new files only: nothing that exists is ever written over, and a name from the model, the page or a filter never decides where a file goes. - The hidden profile.
~/.nexus-mcp/engineis a browser profile this package owns. The server writes one setting into it (the Nexus site may reach127.0.0.1) and starts the browser on it with fixed arguments. It reads nothing out of it: to know whether someone signed in, it only looks for the name the site keeps a sign-in under. - Starting the browser. The server starts the browser it found with a fixed set of arguments and the window's address, never through a shell. The address is the site's own, or
NEXUS_WINDOW_URLonly when it is/windowon an allowed origin. On Windows it also runs two things from your own system folder, by their full paths:reg.exe, to read which browser is your default, and Windows PowerShell, to run one script that ships in this package (dist/scripts/pin-window.ps1). The script finds the new window by a random mark in its title and keeps it on top. It takes that mark and two sizes, nothing else. It is started with-ExecutionPolicy Bypassso that it also runs where unsigned scripts are blocked by default; that applies to this one script file.NEXUS_WINDOW_LAUNCH=0turns all of this off. - Answers come from the right place. Each tool call goes to one surface, and only that surface's socket can answer it. If the socket closes, the call fails at once.
- One connection per role. Each surface (the editor, the Photoshop panel, the After Effects panel, the Nexus window, and so on) has its own slot, and several can be connected at once. Within a role, a new connection replaces the old one.
- You control sessions. The Nexus editor has a Stop button in the agent's menu in the top bar. It closes the socket and stays closed until you click Resume.
- Development switches.
NEXUS_MCP_DEV=1lets local programs connect without the token and turns the older tools back on. It adds no origins and says so on stderr when it starts. Use it only while working on Nexus itself.NEXUS_MCP_ALLOWED_ORIGINSadds exact origins. Nothing else loosens these rules. - The limit. A program already running as you on the same computer can read the token file, like any of your other files. Protecting against that is outside what this bridge can do: such a program can already act as you.
Development
If you're hacking on the server itself (rather than just using it):
git clone https://github.com/SynkitNET/nexus.git
cd nexus/mcp
npm install
npm run dev # tsx watch + stdio
npm run bridge # bridge only, no MCP stdio — for curl/wscat
npm run typecheck # tsc --noEmit
npm run build # tsup → ./dist
npm run selftest # MCP round trip against a simulated editor and panels (no browser); NEXUS_SELFTEST_PORT, default 7940
node --import tsx --test src/security.test.ts # the bridge's security rules; NEXUS_TEST_PORT, default 7950
node --import tsx --test src/window.test.ts # the Nexus window's files: what is read, written and kept
npm run card # the controls card in a browser, as a client would show it (http://127.0.0.1:7821, ?demo=1 for a made-up filter)
npm run test-tools # bridge only; waits for a real editor, then read → apply_ops → render_snapshot → undo
The Nexus-side tools live in src/lib/agentic/tools/ (in the main repo): each is a zod input schema plus a handler, and the catalog the editor announces is generated from them. mcp/src/static-catalog.ts only matters before an editor connects.
License
MIT