AI authoring is afirst-classpart of SMFlow
Not a plugin, not a code-generation side channel. The same authoring API the editor uses is exposed over MCP, so an agent works on the real graph with the real validator — and every change it makes is a proposal you review, apply, or throw away.
smflow mcp proposes. The human in the editor disposes.
Your AI assistant can author the flow.
You still approve every change.
SMFlow ships a Model Context Protocol server — smflow mcp — that connects Claude, Cursor, VS Code Copilot, Cline, or Windsurf straight to the editor you have open. The agent reads the real node catalog, the real pin map of your real board, and the real validation diagnostics, then proposes a transaction. Nothing touches the graph until you click Apply.
The authoring loop
- 1Discover, never guess.
The agent asks for the node catalog, the supported targets, and the board's pins, buses, and device drivers. It authors only from what your build actually has.
- 2Propose a transaction.
Add nodes, set properties, wire ports — submitted as one atomic proposal against a specific document revision, with a one-line summary a human can approve at a glance.
- 3Review on the canvas.
The editor ghosts the proposed additions, edits, and deletions over your graph. Apply or Reject. Applied proposals land as a single labelled undo step —
Ctrl+Ztakes the whole thing back. - 4Validate, then build.
The agent reads the same compiler diagnostics you see and fixes its own errors before asking for a build. An invalid graph still refuses to generate code.
{
"mcpServers": {
"smflow": {
"command": "smflow",
"args": ["mcp"]
}
}
}One entry, and the agent attaches to whichever editor session is running. For CI and headless workflows, smflow mcp --project ./project.smflowedits the file on disk instead.
13 tools
11 read · 1 mutate · 1 buildThere is deliberately no deploy tool. Flashing a physical board stays a human action from the editor or the CLI.
The editor listens on no port until you turn on Allow local automation in Settings.
Binds to 127.0.0.1 on an ephemeral port, with a per-session bearer secret and no CORS. Nothing reaches your machine from the network.
Every proposal targets a revision. Edit the graph while the agent is thinking and its stale proposal is rejected, not merged.
Two Modes
At the bench, or in CI.
Live editor mode
With no arguments the server discovers running editor instances. One session and it binds automatically; several and the agent picks one by ID. Proposals raise a review dialog with a ghosted preview on the canvas. A status indicator in the editor's bottom bar readsAI: Listening (<port>) while the channel is open, and Stop kills it instantly.
For rapid prototyping there is a Trust AI edits for this sessiontoggle that skips the dialog. It lives in memory only, never on disk, resets on restart, and never extends to firmware deployment.
Headless mode
No GUI required. The server opens the .smflow file directly, applies proposals immediately, and saves. Revision checks still guard against an external process editing the file underneath the agent, so a concurrent write is a conflict, never a silent overwrite.
The same CLI also exposes plain authoring verbs —new, add-node,connect, apply,validate, build— for scripts that do not want an agent at all.
Clients
Works with the assistant you already use.
Claude Desktop / Claude Code
Add smflow under mcpServers and restart. The editor Settings pane shows the exact snippet for your install path.
VS Code — Cline, Roo Code, Copilot
Register smflow as a stdio server with the single argument mcp.
Cursor & Windsurf
Same stdio command; both discover the running editor session automatically.
Any MCP client that speaks JSON-RPC 2.0 over stdio works. The editor's Settings pane carries copy-paste configuration next to the automation toggle that gates it.
Under the hood
A loopback control channel.
Nothing more.
The MCP server talks to a running editor over a small REST surface bound to127.0.0.1 on an OS-assigned port. Non-loopbackHost headers are rejected outright and CORS is forbidden, so a web page cannot reach it.
Each editor instance mints a random 32-byte secret at startup, stored in an owner-only session file under your profile directory. Session files from terminated processes are swept automatically. Because SMFlow graphs compile into firmware that drives relays, motors, and real machinery, this is deliberately narrow.
Worked samples on GitHubGET /sessionSession ID, project name, path, current revisionGET /catalog/node-typesNode types and their port signaturesGET /catalog/targetsSupported compiler targetsGET /catalog/targets/{id}Pin maps, buses, peripheral capabilitiesGET /catalog/devicesSupported device driver pluginsGET /project/graphNodes, ports, properties, tasks, connectionsGET /project/diagnosticsCompiler and IR validation diagnosticsGET /project/variablesShared cross-task variablesPOST /proposalsSubmit an atomic transaction for reviewGET /proposals/{id}Poll the status of a pending proposal
Describe the machine. Review the flow.
The agent still cannot flash your board, and an invalid graph still refuses to compile. That is the point: AI moves the tedious part, and the deterministic compiler keeps the guarantees.