--- title: Get started with LessCode project: LessCode app version: Latest section: guides language: en license: url: https://totaljs.es/docs/lesscode-app/latest/guides/getting-started/ updated: 2026-12-02T15:40:00.797Z --- # Get started with LessCode > LessCode is the visual designer of Total.js flows as a desktop app. You drop components on a canvas, connect them, and the flow runs on your computer. ![The designer of LessCode with the flow of the first time](https://totaljs.es/_totaldesktop/shots/lesscode-1.webp) ## Install it Download LessCode for macOS, Windows or Linux from [its page](https://totaljs.es/en/totaldesktop/lesscode/#download). [Install the apps](/totaldesktop/latest/guides/install/) explains each system step by step. Node.js and Total.js come inside the app. There is nothing else to install. ## Run the first flow 1. Open LessCode. It says **Starting LessCode…** for a moment, and then shows the designer. 2. The flow has three nodes: **Trigger**, **Print** and **Console debug**. Trigger is connected to Print. 3. Press **Run** on the Trigger node. It sends a random text. 4. Look at Print: it shows what it has received. 5. Press **Clear** on Print to empty it. Now [design your own flow](/lesscode-app/latest/guides/design-a-flow/). ## The parts of the window | Part | What it is for | | --- | --- | | The toolbar | **APPLY** runs your changes. The other buttons add components, and show the variables, the console and the rest | | The list on the left | The components that you have, to drag them to the canvas | | The canvas | The nodes of your flow and their connections | | The line at the bottom | How many messages have gone through, the errors and the memory | The menus are the same on every system: | Menu | What it has | | --- | --- | | **Flows** | [The folder of your flows](/lesscode-app/latest/guides/your-flows/), and **Restart LessCode** | | **AI** | [Connect an AI](/lesscode-app/latest/guides/connect-an-ai/) to your flow | | **View** | **Reload** and **Developer tools** | | **Help** | The documentation of Total.js | ## While it is open > Your flow runs while LessCode is open. When you close its window, the flow stops, with its timers and its endpoints. LessCode saves the flow before it closes, and runs it again the next time. For a flow that must always run, use [Total.js LessCode on a server](/lesscode/1-0/guides/introduction/). --- title: Design a flow project: LessCode app version: Latest section: guides language: en license: url: https://totaljs.es/docs/lesscode-app/latest/guides/design-a-flow/ updated: 2026-12-02T15:40:00.797Z --- # Design a flow > Add components to the canvas, connect them and run the result. The designer is the one of Total.js LessCode, so its documentation is also the one of the app. ## The steps 1. Press **Add**, the plus of the toolbar, and choose **Download components**. Choose the ones you need. 2. Drag a component from the list on the left to the canvas. 3. Drag from the output of a node to the input of another to connect them. 4. Double-click a node to change its settings. 5. Press **APPLY** and confirm with **Continue**. Your changes run now. Downloading components needs the internet. After that, the components stay in your flow. ## Learn the designer These pages explain each part: | To | Read | | --- | --- | | Know every button | [The designer](/lesscode/1-0/guides/designer-overview/) | | Get more components | [Download components](/lesscode/1-0/guides/download-components/) | | Add, connect and set nodes | [Build a flow](/lesscode/1-0/guides/build-a-flow/) | | Send test data | [Test with Trigger and Print](/lesscode/1-0/guides/test-with-trigger/) | | See messages and errors | [The Console](/lesscode/1-0/guides/console/) and [Errors](/lesscode/1-0/guides/errors/) | | Keep values in one place | [Variables](/lesscode/1-0/guides/variables/) | | Add notes and groups | [Organize the canvas](/lesscode/1-0/guides/organize-canvas/) | | Find a node | [Search in nodes](/lesscode/1-0/guides/search-nodes/) | | Stop the flow for a while | [Pause the flow](/lesscode/1-0/guides/pause-flow/) | | Write a component | [Components and development](/lesscode/1-0/development/components/) | They are written for LessCode on a server. Where they give an address with the port 8000, use [the one of the app](/lesscode-app/latest/guides/endpoints/). ## Keys of the designer | Action | Mac | Windows and Linux | | --- | --- | --- | | Apply the changes, or save the component whose code is open | ⌘S or ⌘↩ | Ctrl+S or Ctrl+Enter | | Select every node, or those that follow the selected one | ⌘A | Ctrl+A | | Load the designer again | ⌘R | Ctrl+R | | Open the developer tools | F12 | F12 | Press **APPLY** before you load the designer again: what is not applied is lost. --- title: Call your flow from other apps project: LessCode app version: Latest section: guides language: en license: url: https://totaljs.es/docs/lesscode-app/latest/guides/endpoints/ updated: 2026-12-02T15:40:00.797Z --- # Call your flow from other apps > A flow can answer HTTP requests, so the apps of your computer can use it. This page says at which address the app listens. ## The address LessCode listens at `http://127.0.0.1:7230`. If that port is taken when it starts, it uses the next one that is free, up to 7239. To see the one in use, open **AI → Connect an AI…**. It is in **MCP endpoint**: the number after `127.0.0.1:`. If all those ports are taken, LessCode uses any other, which changes each time it starts. The same window says so. ## Make an endpoint The components **Route** and **Response** receive a request and answer it. [Create a GET endpoint](/lesscode/1-0/recipes/get-endpoint/) has an example step by step. In its last part, use the address of the app: ```bash curl 'http://127.0.0.1:7230/api/hello/?name=Jane' ``` You can open the address in your browser too. ## On your computer only The address works on your computer, and not from others of your network: LessCode does not listen there. To offer an endpoint to other people, put the flow on [a server with LessCode](/lesscode/1-0/guides/introduction/). [Keep and copy your flows](/lesscode-app/latest/guides/your-flows/) says where its file is. The endpoints of your flow do not ask for a password. Any program on your computer that knows the address can use them, also a web page open in your browser. If an endpoint does something that matters, check in the flow who calls it. The designer opens only in the window of LessCode, and the [MCP endpoint](/lesscode-app/latest/guides/connect-an-ai/) asks for a token. ## When it does not answer - **404**: press **APPLY** first. Then check the method and the address in the settings of **Route**. - **503**: the flow is paused. - Nothing answers: LessCode is closed, or it has another port. --- title: Keep and copy your flows project: LessCode app version: Latest section: guides language: en license: url: https://totaljs.es/docs/lesscode-app/latest/guides/your-flows/ updated: 2026-12-02T15:40:00.797Z --- # Keep and copy your flows > Everything you build is in one file on your computer: the nodes, the connections, the components and the variables. Here you see where it is, and how to make a copy and put it back. ## When it is saved LessCode saves the flow some seconds after each change that you apply, and once more before it closes or restarts. Updating the app does not touch it. What you have on the canvas without pressing **APPLY** is not saved. ## Where it is Choose **Flows → Show the folder of the flows**. The file is `lesscode.flow`. The folder is inside the one of the app: | System | Folder | | --- | --- | | macOS | `~/Library/Application Support/es.totaljs.apps.lesscode/lesscode/flowstreams` | | Windows | `%APPDATA%\es.totaljs.apps.lesscode\lesscode\flowstreams` | | Linux | `~/.local/share/es.totaljs.apps.lesscode/lesscode/flowstreams` | ## Make a copy In the designer, press **Add**, the plus, and choose **Download design**. The file goes to your Downloads folder, and **Show in folder** takes you to it. It has the same as the file of the flow. Make a copy before you change much, and before [an AI works on the flow](/lesscode-app/latest/guides/connect-an-ai/). ## Put a copy back > This replaces the flow that you have now. Make a copy of it first if you may need it. 1. Choose **Flows → Show the folder of the flows**. 2. Close LessCode. If it is open, it writes its own flow over your copy. 3. Put your copy in the folder with the name `lesscode.flow`, in place of the other. 4. Open LessCode. Leave only one file that ends in `.flow` in the folder: the designer shows only one. ## Take it to a server The file works in Total.js LessCode on a server too. [Back up your flow](/lesscode/1-0/guides/backups/) says where to put it there. The variables are in the file as they are, with their values. Take out the passwords and the keys before you give it to someone. --- title: Add extensions project: LessCode app version: Latest section: guides language: en license: url: https://totaljs.es/docs/lesscode-app/latest/guides/extensions/ updated: 2026-12-02T15:40:00.797Z --- # Add extensions > An extension is an HTML file that adds something of yours to LessCode: styles or buttons for the designer, or code that runs with the flow. ## Add one 1. Choose **Flows → Show the folder of the flows**. 2. Go to the folder above it. It has `index.js` and `extensions.js`. 3. Make a folder called `extensions` there. 4. Put your file in it. Its name must end in `.html`. 5. Choose **Flows → Restart LessCode**. LessCode reads the folder when it starts. After you change, add or remove an extension, restart it again. ## What goes in the file The part inside ` ``` Save it as `status.html`, restart LessCode and open `http://127.0.0.1:7230/api/status/` in your browser. [Call your flow from other apps](/lesscode-app/latest/guides/endpoints/) says how to see the port, if yours is another. [Extensions](/lesscode/1-0/guides/extensions/) has a longer example and what the code can use. ## With the updates Updating the app leaves your `extensions` folder as it is. Do not change the other files of LessCode in that folder: an update puts its own in their place. > An extension can do on your computer all that you can do. Use only those that you have written, or that you have read. --- title: Connect an AI to your flow project: LessCode app version: Latest section: guides language: en license: url: https://totaljs.es/docs/lesscode-app/latest/guides/connect-an-ai/ updated: 2026-12-02T15:40:00.797Z --- # Connect an AI to your flow > LessCode speaks [MCP](https://modelcontextprotocol.io), the protocol that AI clients use to work with apps. Claude, Cursor or any MCP client can read your flow, change it, run its nodes and write components for you. ## The address and the token Choose **AI → Connect an AI…** A window shows the address, the token and the configuration of each client, ready to copy. | What | Value | | --- | --- | | MCP endpoint | `http://127.0.0.1:7230/$mcp/` | | Code mode | `http://127.0.0.1:7230/$mcp/client.js` | | Authentication | `Authorization: Bearer ` | The port is 7230, or the next one that is free up to 7239. The token is made the first time, and is kept in the keychain of your system. Without it, the MCP endpoint answers `401`. **Show** lets you see it, and **Copy** copies it whole. LessCode must be open for the AI to reach it. ## Claude Code Press **Copy the command** and run it in your terminal: ```bash claude mcp add --scope user --transport http lesscode 'http://127.0.0.1:7230/$mcp/' --header 'Authorization: Bearer ' ``` Keep the single quotes: without them, the terminal takes `$mcp` for a variable and drops it. `--scope user` makes it available in all your projects. ## Cursor and other clients For the clients that connect by an address, in their `mcp.json`: ```json { "mcpServers": { "lesscode": { "url": "http://127.0.0.1:7230/$mcp/", "headers": { "Authorization": "Bearer " } } } } ``` ## Claude Desktop Claude Desktop starts its servers with a command, so it reaches LessCode through `mcp-remote`, which needs Node.js on your computer. In `claude_desktop_config.json`: ```json { "mcpServers": { "lesscode": { "command": "npx", "args": ["-y", "mcp-remote@0.16.5", "http://127.0.0.1:7230/$mcp/", "--allow-http", "--header", "Authorization:${LESSCODE_TOKEN}"], "env": { "LESSCODE_TOKEN": "Bearer " } } } } ``` ## What the AI can do | Tool | What it does | | --- | --- | | `Flow_read` | Gives the whole design: the nodes with their settings, connections and positions, the variables, the ids of the components, and whether the flow is paused | | `Flow_save` | Replaces the design and runs it, as **APPLY** does. The nodes that are left out are removed | | `Flow_components` | Describes the components: id, name, inputs, outputs and settings | | `Component_read` | Gives the code of a component | | `Component_save` | Adds a component, or replaces its code | | `Component_remove` | Removes a component. The nodes that use it stop working | | `Flow_trigger` | Runs a node, as its **Run** button does | | `Flow_status` | Gives the counters of the flow, its last errors and how each node is doing | | `Flow_pause` | Pauses the flow, or lets it go on | > LessCode does not ask you before any of them runs. The components that the AI writes are code that runs on your computer, with your permissions. Connect only clients that you trust, let them ask you before they use a tool, and [make a copy of your flow](/lesscode-app/latest/guides/your-flows/) first. ## Code mode In place of calling the tools one by one, an agent can download a JavaScript client with a function for each tool, write a script with them, and give the model only the result. It takes fewer tokens. ```bash curl -H 'Authorization: Bearer ' 'http://127.0.0.1:7230/$mcp/client.js' -o lesscode.js ``` This script, for Node.js 18 or later, moves all the nodes to the right: ```js const api = require('./lesscode.js')(''); (async function() { const flow = await api.Flow_read({}); for (const key in flow.design) { if (flow.design[key].component) flow.design[key].x += 40; } await api.Flow_save({ input: { design: flow.design } }); })(); ``` ## Change the token If the token reaches someone who should not have it, press **Make a new token…** in the same window. LessCode saves the flow and starts again, and you give the new token to each of your clients. The old one no longer works. --- title: Problems and answers project: LessCode app version: Latest section: faq language: en license: url: https://totaljs.es/docs/lesscode-app/latest/faq/problems/ updated: 2026-12-02T15:40:00.797Z --- # Problems and answers > What to do when LessCode does not start, or when the flow or the AI does not do what you expected. ## "LessCode stopped" The part of the app that runs your flow has ended. The window shows its last messages, which usually name the cause, such as an error in the code of a component. 1. Press **Restart LessCode**. 2. If it stops again, press **Show the folder of the flows** and [put back a copy](/lesscode-app/latest/guides/your-flows/) that worked. If it says **LessCode is missing from the app. Install the app again.**, install it again. Your flow stays where it is. ## My changes are gone Only what you apply is saved. Press **APPLY** and **Continue** after you add, connect or remove nodes. ## The flow stopped when I closed the window The flow runs while LessCode is open. For one that must always run, use [LessCode on a server](/lesscode/1-0/guides/introduction/). ## There are only three components Press **Add**, the plus, and **Download components**. You need the internet for it. [Design a flow](/lesscode-app/latest/guides/design-a-flow/) has the steps. ## The AI does not connect - LessCode must be open. - Compare the address of the client with the one in **AI → Connect an AI…**. The port may have changed. - `401` means that the token is not the one of now. Copy it again. - In Claude Code, check that the address has `$mcp`. Without the single quotes, the terminal takes it out. ## The window of the AI does not show the token LessCode could not read the keychain of your system, so this time it runs without the AI. If your system asks whether LessCode may use the keychain, allow it, and then choose **Flows → Restart LessCode**. On Linux, the Secret Service of your desktop must be installed and unlocked. ## "The ports 7230–7239 are busy" Other programs use them all, so LessCode took another port, which changes the next time. Close what uses them and choose **Flows → Restart LessCode**. ## The designer does not open in my browser It opens only in the window of LessCode: it can change your flow and write code, so no web page may reach it. The [endpoints of your flow](/lesscode-app/latest/guides/endpoints/) do open in the browser. ## A page of the designer opens in my browser The links to other sites always open in your browser. Those of your own flow open in a window of LessCode. ## What LessCode knows about you It collects nothing. Your flow is on your computer, and the token is in the keychain of your system. LessCode connects to `cdn.totaljs.com` to show the components that you can download, and your flow connects where you tell it to. [Privacy](/totaldesktop/latest/guides/privacy/) has the details. ## Something else [Report the problem](https://github.com/totaljs-es/totaljs-desktop/issues/new?template=problem.yml) with the version of LessCode and your system.