Repository navigation
Development
Robot Studio is written in TypeScript: an Electron desktop shell, a Node server that owns the project, and a React interface. This page is a map for people who want to read or change the code.
Read AGENTS.md first. It is the entry point for human and AI contributors alike, and its links lead to the architecture, engineering standards and status of each part of the studio.
| Path | What it holds |
|---|---|
src/core/ |
The pure typed model: project types, commands (the only way the project changes), checks and engineering logic. No Electron, DOM or Node APIs; three.js only for maths. |
src/server/ |
Node only. Owns the live project: saving the package, undo and redo, the MCP server (src/server/mcp/, http.ts), background jobs and the engines (solid kernel, physics, KiCad, slicers, firmware, AI runtime). |
src/main/ |
The Electron shell: starts the server, opens the windows, native dialogs. |
src/renderer/ |
The React interface, a client of the server over WebSocket (src/renderer/src/state/api.ts). It holds no authority. |
eda/ |
The EDA core's own package folder: the pinned tscircuit set. |
runtimes/onnx/ |
ONNX Runtime, pinned, for running AI models. |
addons/ |
The official add-ons (Bambu Lab, OrcaSlicer, Isaac Lab). |
library/ |
The standard libraries: board components, bearings, fasteners. |
samples/ |
The sample robots as project packages, written by npm run samples. |
scripts/ |
Development, sandbox, sample, MCP check and library import scripts. |
native/pns/ |
Source and build scripts of the native KiCad router helper. |
third_party/ |
Notices and licences of third-party code and data. |
docs/ |
The project format standard, plans, verification records and the detailed agent guidance. |
spikes/ |
Experiments kept for reference. |
.tools/ is a local, uncommitted folder for tool caches and sandbox builds.
- One model. Every place (Robot, Schematic, PCB …) is a view of one typed project. Every edit is a command, and the window and MCP share the same validated commands, checks and undo history.
-
The server owns the project. The interface sends commands and re-renders when the server broadcasts the new
project. The same interface runs in the Electron window and in a browser at
http://localhost:5173. -
MCP is stateless Streamable HTTP on
127.0.0.1only, with Host and Origin checks./mcpis the full profile and/mcp/compactthe compact one, both built from the same tool registry. -
Conventions. Millimetres and degrees; Z up, right-handed; Euler XYZ rotations; part ids are reference
designators that never change; pins are
PART.PINand portsPART.PORT.
| Command | What it does |
|---|---|
npm run dev |
Start the app with live reload |
npm start |
Build and launch a production preview |
npm run build |
Production build into out/
|
npm run typecheck |
Type-check everything |
npm test |
Headless tests: core logic, engines and MCP end-to-end runs on private servers |
npm run sandbox |
A second, isolated app window with its own data folder and MCP on port 7811 |
npm run sandbox:web |
An isolated backend for the web UI, no window (keep npm run dev running); MCP on port 7831 by default |
npm run samples |
Write the sample packages in samples/ from the code that builds them (npm run samples -- tripod-t2 for one) |
npm run mcp:smoke |
Read-only end-to-end check of the MCP server; the app must be running |
node scripts/mcp-call.mjs <tool> [json] |
Call one MCP tool from the shell |
npm run addons |
Seal the addons/ folder after changing an add-on |
npm run library:footprints, npm run library:fasteners
|
Regenerate library data from their sources |
npm run mcp:smoke -- --demo also builds a demo robot in a new project, which switches the running app to it.
Run it only against a sandbox:
$env:ROBOT_STUDIO_MCP = "http://127.0.0.1:7811/mcp"; npm run mcp:smoke -- --demoROBOT_STUDIO_DATA_DIR and ROBOT_STUDIO_PORT choose the data folder and port of an instance; the sandboxes set
them for you.
npm test runs Vitest over src/**/*.test.ts(x). The tests run on temporary data folders and private servers and
never touch the running app or your projects. Tests that need a program such as KiCad skip themselves when it is not
installed. To run one file:
npm test -- src/server/mcp/compact.e2e.test.tsThe Hexapod H1 sample is rebuilt and checked whole on every run, so it is also what the software is debugged against.
Follow the existing path of its domain instead of inventing a new one:
- the typed model in
src/coreand backwards-compatible normalization; - a validated command;
- the MCP tool, in the matching file of
src/server/mcp/; - the window;
- diagnostics, so problems reach both the window and agents;
- persistence in the project package (
src/core/package/pack.tsis the single layout writer); - a test.
Keep expensive work in cancellable background jobs. Keep existing MCP tool names and saved project ids stable: saved projects and agents depend on them. When a feature can return large results, return a summary first and let the agent fetch detail by id, query or page.
- Report bugs and ideas in Issues. Pull requests are welcome.
- Before opening a pull request, run
npm run typecheckand the tests your change affects. New logic needs a test. - Check interface changes in the real app, in both the light and the dark theme. Use a sandbox so your own projects are not touched.
- After changing the sample robots' code, the catalog parts they use or the package layout, run
npm run samplesand commit what it wrote. - Catalog and manufacturing data must come from standards, datasheets or measurable geometry. Say what is assumed.
Robot Studio is free software under the
GNU Affero General Public License v3.0 or later. Its
third-party code, libraries and models keep their own licences, listed with their notices in
third_party/. The KiCad-derived router helper in
native/pns and third_party/kicad-pns is GPL-3.0-or-later. See
External Programs and Add-ons for the full list.
AGPL-3.0 · github.com/Niomatic/robot-studio · niomatic.com
Get started
Using the studio
Reference