Skip to content
falang.ioRU

Coding agents (MCP)

A coding agent such as

Claude Code

, or any other client of the Model Context Protocol (MCP), can work with Falang projects directly: read schemes, create and change them, and — in the workflow builder — build, run, debug and publish. It is an alternative to the built-in AI agent that runs on your own subscription and in your own terminal. Every change the agent writes is validated the same way as in the editor; an invalid scheme is rejected with a path to the problem and nothing is saved.

When you create or open a project, the desktop app puts two files into the project folder, if they are not there yet: .mcp.json, which registers the project’s own falang MCP server, and CLAUDE.md, a short description of the project for the agent. Existing files are never overwritten.

  1. Open a terminal in the project folder (or any folder inside it) and start the agent, e.g. claude.

  2. Allow the project’s MCP server when the agent asks for it the first time.
  3. Describe what to build or change.

The server is a small Node.js program shipped with the app, so Node.js must be installed and available as node. Each project folder gets its own server; the app does not have to be running.

The agent gets these tools:

  • get_project, list_documents, get_document — read the project, its tree and a scheme;

  • get_node_kinds — the icons a scheme may contain, their fields and which icons may go where;

  • set_document — replace a scheme with a new, validated version (the layout of icons that stayed is kept);

  • create_document, rename_document, move_document, delete_document , create_folder — manage documents and folders;

  • lock_document, unlock_document — the edit lock described below.

Function names follow the same rule as in the editor: English camelCase, e.g. myFunctionName. In an Arduino project the agent can edit setup, loop and other schemes, including pin and driver icons, but cannot rename, move or delete the fixed documents, can read and replace the Devices tables ( get_devices/set_devices), and cannot compile or upload the sketch — use Build & Upload in the app for that. The agent can also write, validate and save new device drivers (see Custom device drivers).

  • A scheme the agent is changing is locked: if it is open in the app, its tab is covered with “Locked by an agent until …” and your edits to it are not saved until the lock is gone. A lock lasts five minutes after the agent’s last call, or ends as soon as the agent releases it.

  • The open app picks up the agent’s changes on its own: a scheme without unsaved edits reloads in place, and the project tree follows new, renamed and deleted documents.

  • If a scheme changes on disk while you have unsaved edits in it, the app asks: Reload (discard my changes) or Keep mine (your next save then overwrites the file).

The workflow backend serves MCP over HTTP at /mcp on the backend’s host — for example https://api.workflow.falang.ru/mcp, or http://localhost:4100/mcp for the local stack. It is authenticated with a personal access token.

  1. In the workflow web app, click Access tokens in the project list header, then + New token. Give it a name (e.g. “Claude Code on my laptop”); optionally limit it to one project and set an expiry in days. Copy the token right away — it starts with flg_pat_ and is shown only once. A token can be revoked in the same window at any time; anything using it stops working immediately.

  2. Register the server with your agent, for Claude Code:

    claude mcp add --transport http falang-workflow https://api.workflow.falang.ru/mcp \
    --header "Authorization: Bearer flg_pat_…"

The agent gets the same document tools as on the desktop (each with a project id), plus tools to:

  • list, create, import and export projects (exports never include credential secrets);
  • find integrations by keyword and list the project’s credentials (names only, never secrets);
  • preview the compiled code, build and start a dev run, follow where it is and read its history;
  • debug on the dev stand: breakpoints, pause, continue, step over;
  • publish a version, list versions, activate an earlier one or stop one.

A token limited to one project cannot see or create other projects. Locks work as on the desktop: a document the agent is changing is covered with “Locked by an agent until …” in the browser, and an edit you made to it in the meantime is reported as not saved.

The plugins/falang folder of the

Falang repository

is a Claude Code plugin with three skills that teach the agent the scheme model, the Arduino icons and drivers, and the workflow build-run-publish cycle, plus a ready MCP entry for the workflow builder. It is optional — desktop projects work without it — but makes the agent’s work noticeably more accurate. From a checkout of the repository:

claude plugin marketplace add ./plugins
claude plugin install falang@falang

With the plugin installed, the workflow server is configured from two environment variables instead of claude mcp add:

export FALANG_MCP_URL="https://api.workflow.falang.ru/mcp"
export FALANG_TOKEN="flg_pat_…"