noddock Tutorial
Introduction
Welcome to the tutorial. Here you will learn how to build your own AI-driven projects with noddock. This tutorial covers:
- Basics / key concepts (~20 min)
- Example 1: build a simple chatbot
- Example 2: create your own tool and connect to MCP using the
LLM--OpenAI--Chatnode - Example 3: create custom JS and Python nodes
- Example 4: use Custom HTML to create your own UI and project entry for a node
- Example 5: advanced loop techniques
Part 1: Basics / Key Concepts (~20 min)
What is noddock
noddock is a locally run, node-based workflow editor. You can use it to build your own workflows and compose them into projects, or run projects shared by others. You can use the Chat node to couple large language models into your designs and inject intelligence into your software. noddock is not a black-box agent tool, but a transparent, visual workflow editor: every node, every edge, and every data transfer is something a human can inspect and modify. It runs entirely locally β projects are stored as folders, packaged into .ndk files for sharing, and the recipient decides after importing whether to trust and run them based on the permission level. At the same time, information such as API keys and passwords can be encrypted and stored locally in the Vault instead of being exposed in plaintext within workflows.
Today's mainstream client agents, such as Codex and DeepSeek Harness, can almost complete any task β so why use noddock at all? In reality, the two do not conflict. Mainstream clients can indeed build a project for you from scratch through conversation alone, and can gain more capabilities through extensions like MCP and skills. But in that process, on the one hand, the flow of information is hard to judge β for example, Codex is not transparent; DSH has the full context, but extracting a piece of it for extra processing is relatively difficult. On the other hand, the entire project is specialized to your own computer, involves a lot of your private information, and does not distinguish between the building and using phases β for example, a simple AI-driven photo-organizing program might need a powerful model to help build it from scratch, but once built, using it only requires a small local model. The value of noddock is that it compresses all data transfer into 7 kinds of variables that humans can understand β you can inspect and edit a node's data at any time, or pull an edge to apply whatever extra processing you want to the data. And because it manages projects with folders and relative paths, you can quickly share them with others through one-click export, without separating the development and packaging processes. You can either use noddock's custom nodes and Custom HTML features to build a client agent you are more satisfied with, or let mainstream clients use noddock to develop applications, making them easier to understand and share.
Projects and Workspace
In noddock, we develop in units of projects. Every project has its own dedicated project workspace, a directory used to store custom nodes, workflows, assets, and so on. So to guarantee that a project still runs correctly after export, it is necessary to store the required assets or runtime environment inside the project workspace and reference them via relative paths. noddock's file path handling generally follows these rules:
- Most nodes and path settings do not accept absolute paths.
- When using relative paths, the starting point is the current project folder.
- The exception is files starting with
/assets/*β these are some of noddock's built-in assets, HTML templates, or JS scripts. For the specific files, see the official repository.
All projects and custom nodes are stored in your Workspace, which you can view or change in Settings. When you open noddock, you land on the Library page by default: the list on the left shows all projects under the Workspace, with the ability to import third-party projects (.ndk files) and filter by tags above the list. Clicking a project in the list shows its detailed page on the right, including run, edit, about, size statistics, version, and so on. When you import the same project, it decides whether to update based on the version in the project property.
Move your mouse to the top of the window or press the Esc key, and a menu bar will appear at the top. Selecting and clicking the Editor icon pops up a window to name a new project β type a <project name> and a new project is created and you enter the editor page. You can find the corresponding project workspace under <workspace>/projects/<project name> in a file browser. Inside there is a project.json file that stores everything the project needs β it is the most critical and indispensable file of a project. There is also a set of Project Property fields, shown as the gear icon in the top-right corner of the editor, where you can edit project-related information such as permission, version, guide, tutorial, and tags. These are displayed on the project's homepage in the Library.
The most critical parameter of a project is its permission. noddock's security model is scoped per project: each project is controlled by one of three permission levels:
| Permission | Custom HTML runs JS | Custom JS nodes | Exec / Terminal / custom Python nodes |
|---|---|---|---|
safe |
β blocked | β blocked | β blocked |
risk |
β allowed | β allowed | β blocked |
dangerous |
β allowed | β allowed | β allowed |
- Projects you create yourself default to
dangerous(full capability); third-party projects imported from .ndk files default tosafeβ in asafeproject, dangerous nodes such as custom JS nodes and exec nodes are blocked from running, to prevent unknown workflows from harming your system. Make sure the source is trustworthy before you change the permission. - Once you are confident it is safe, you can manually set it to
riskordangerousvia Library page β the permission dropdown above the project's About (or in the Project Property inside the editor). - We do not recommend importing projects through other means, because that bypasses our permission mechanism. Opening or running an unknown project can carry significant risk β please make sure you understand it before use.
The built-in example_project in noddock uses the Custom HTML feature. If you open the project and cannot interact with it, raise its permission from
safetorisk. To run other sample workflows inside it, such as the custom Python node, you need to raise it todangerous.
Vault
noddock has a built-in Vault (API Vault) for securely storing API keys. It solves a common pain point: nodes such as LLMs require an API key, but if you share your project with someone else, a key written directly in the node gets taken along with it.
The Vault works like this: give each key a reference name (ref) and save it, then fill only that ref in the node's api field. At runtime, noddock automatically resolves the ref to the actual key. This way the project only stores the ref, the actual key is encrypted in your local Vault, and it never enters the node's data flow. Currently only some nodes support the Vault, for example the API of Chat and Speech nodes, and the password of ExecSSH.
How to access it: click the lock icon on the left side of the menu bar to open the Vault panel. You can:
- Add a key: fill in a ref (e.g.
my-deepseek) and the corresponding API key, then click Add. - Copy a ref: click Copy on the right side of a saved key to copy the ref to your clipboard, then paste it into the node's
apifield. - Delete: click Delete to remove a key.
The Vault file (vault.json) is never uploaded to any server β it uses your local operating system's keyring (macOS Keychain / Windows Credential Manager), so you may need to set it up again when you switch computers.
Note: if the value in a node's api field does not match any ref in the Vault, noddock simply uses it as a raw value.
Workflows and Nodes
Select a project in the Library and click Open in Editor to enter the editor and start building whatever product you want. For example, clicking Open Editor on example_project shows you that example_project contains many useful workflow examples. Conversation is a good one to look at.
After opening a project, you will see different windows and squares connected by edges. Each window is a workflow, and each square is a node. Every node has its own parameters and functionality. When you select a workflow and click Run in the top-right corner, the workflow coordinates the execution of its nodes according to its internal mechanism and passes results to the next node through the edges. When you run a workflow in the editor, you will see the borders of the corresponding nodes and edges turn green, indicating a successful execution.
Node Variables
In noddock, a node has a very simple definition: it consists only of node variables and a run method. There are currently 7 kinds of node variables: int, float, string, bool, json, stream, and logic. You only need to declare a variable's ID, type, and default value to manage it inside a node β so you can also easily create your own nodes. The run method is the concrete implementation that runs when the node is started within a workflow: it transforms the node's variables and assigns new values back to them. You can think of it as an arbitrary function f(node variables). In a custom node, that function can be your own JS or Python script.
When you select a node and click the gear icon in the top-right corner, you can inspect the node's detailed parameters. In the Connection section, you will find that every variable can be used as an input, an output, or be manually editable. So you can freely adjust the connection attributes of existing nodes according to your workflow design. Note, however, that when a project is saved, not every variable's value is stored in project.json β only variables set to edit are saved; intermediate data passed as input/output is not. Checking this is simple: just look at whether the variable has an editable input box in the editor.
Node IDs: Copy and Copy Type
Another important concept about nodes is the ID. Open a node's Property and you will see the ID field uses the naming format <group>--<sub group>--<node name>_I<x>_E<y>. The first half is the node's full name β this is what appears in the right-click context menu when you create a node on a blank canvas. The second half involves an important node feature: copying.
At the very bottom of noddock there are hints for available shortcuts. When you select a node, its border color changes and the shortcut hints at the bottom change too β you will find two options: Copy and Copy Type. For example, if you select a Json_I1_E1 node, Copy and paste gives you Json_I1_E2, while Copy Type and paste gives you Json_I2_E1. The difference is:
Json_I1_E1andJson_I1_E2share the same data β their node parameters are identical. Whenever the parameters of any one of them change, the parameters of all nodes of the same type with the same I number stay in sync;Json_I1_E1andJson_I2_E1are merely nodes of the same type; running them does not affect each other β it is equivalent to right-clicking and creating a new node of the same type.
Besides clicking the gear to view the ID, all nodes of the same type with the same I number also share the same color, and you can enable Always Show Node ID in Settings to identify node IDs directly in the editor.
So what is this Copy feature useful for?
- Across different workflows, you can copy the same node to pass data across workflows.
- Within the same workflow, you can copy a node to update a node variable.
For example, Json_I1_E1 stores the current conversation history; connect that JSON data through an edge to Chat_I1_E1, which uses the AI to generate the corresponding reply and insert it into the conversation history. When you need to write the new data back to Json_I1_E1, simply connect the output of Chat_I1_E1 to a copied Json_I1_E2 β that is, the workflow Json_I1_E1 -> Chat_I1_E1 -> Json_I1_E2. But if you try to connect the Chat output directly back to Json_I1_E1, you will find the workflow forms a closed loop and is refused to run β this is a characteristic of noddock: closed loops are not allowed. If you want to implement a loop, you need the RunWorkflow node.
Workflow Scheduling Logic
When you run a workflow, noddock first looks for nodes with no input edges as the first batch of nodes to start (note: an isolated node with no edges at all will never run β it needs at least one output edge to participate in scheduling). When a normal node runs, it usually assigns a value to some variable during execution to update it; that assignment activates all edges connected to that variable, and if an edge is connected to the next node, it may trigger the next node to start running. In short, a node starts running once all of its input variables have been assigned values through edges; if it has no inputs, it runs at the very beginning. Because only values of the same type can be passed, you can only connect variables of the same type with an edge. The logic variable is an exception: it can connect to any variable but does not pass a value β so you can use it to control the execution order of nodes. Another exception is the Logic--Or node: no matter how many edges are connected to it, as soon as any one of them is activated, the node runs, while other nodes must wait until all of their upstream edges have been activated.
Loops and Advanced Techniques
Next are some advanced techniques you may never need. In noddock, every node runs concurrently, so when one node's output is connected to several other nodes at the same time, those nodes all start running simultaneously. But when it comes to copied nodes, because they share the same data, they run in order under concurrency.
Loops are slightly more complicated. In noddock, the usual way to design a loop is to connect a RunWorkflow node at the end of the workflow and set its target to the current workflow itself, so that when execution reaches the end it automatically enters the next iteration. Note: when self-recursive (target = current workflow), the RunWorkflow node's own Async property must be true. Because all nodes are concurrent, you should guarantee that when the RunWorkflow node is triggered, all other nodes have already finished running, so that the next iteration works with updated, correct values. The simplest way is to route all other leaf nodes (nodes without outputs) through After nodes, connected in front of the RunWorkflow node.
Of course, you can also choose not to do this and deliberately leave some nodes outside the loop (see example5_cycle_async in the tutorial project). This lets those outer nodes enjoy efficient concurrency without guaranteed ordering; and if you want the output to be stably propagated to the next node, enable Async in the Node Property β the variable's color then turns light blue, and within the same iteration light-blue variables correctly carry the values of that iteration. Unless you are interested in concurrency, do not try this feature lightly.
Example 1: Build a Simple Chatbot
You have now learned the relevant basic concepts, so let's build a simple chatbot. Here we will develop using the OpenAI-protocol-compatible data structure. If you are not familiar with LLMs (large language models) or the OpenAI protocol, in short:
An LLM is a machine that takes text as input and produces text as output. No matter how powerful its capabilities β chatting like a human, controlling a computer, reading or generating images β at the bottom it is always this pattern: you input text, and it returns a string of output text based on the input. So developing with LLMs basically focuses on two areas: one is the input side, i.e. prompt engineering β improving our input so it can drive the LLM to generate what we want; the other is the output side β parsing the text into a format a program can handle, turning the LLM into a component of a complex program.
Another important concept about LLMs is context, which you can simply understand as "our input text" mentioned above. But why is it called context? Just like in reading comprehension, you need to use the context to understand the meaning of a passage and derive the correct answer β an LLM also needs the context to judge what its answer should be. When you input "Hey, do you know my name?" to an LLM, its output might be "Sorry, I don't know." So if you want the LLM to "remember" the previous conversation, you need to send the whole context β "My name is Xiaoming, remember it well! Hey, do you know my name?" β and only then might the LLM reply "Haha, your name is Xiaoming, right?"
But in most cases, our conversation with an LLM is not the naive one-question-one-answer above, but a longer continuous dialogue. So in the first round you might input "Hey, do you know my name?", and the LLM replies "Sorry, I don't know." Then you can stack that conversation and put the new question at the end, for example "Me: Hey, do you know my name? LLM: Sorry, I don't know. Me: Haha, my name is Xiaoming, do you know my name now?", and feed this complete conversation β the context β to the LLM again. Now it can infer based on the context of this conversation and output "Oh, your name is Xiaoming." After that, just repeat the same recipe to achieve a conversational effect. So when you send a reply in a chat tool like ChatGPT, you are actually sending all the information to the LLM every time β that is how it can "remember" what you said. In practice, however, we do not simply stack the conversation together as above, but use the following JSON list format:
[
{ "role": "user", "content": "Hey, do you know my name?" },
{ "role": "assistant", "content": "Sorry, I don't know" },
{ "role": "user", "content": "Haha, my name is Xiaoming, do you know my name now" },
{ "role": "assistant", "content": "Oh, your name is Xiaoming" }
]
A role of user represents your input, and assistant represents the AI's output. There is also a system role, and in some cases a tool role. But do not forget: although what we input is this JSON data, the LLM's output is always the final piece of text β the roles and contents are things we add for our own convenience.
Most LLM APIs on the market today accept conversations in this format as input to generate replies. If you do not know what an API is, in short, LLM providers or resellers sell you this "input text, get a reply" service: you send the above JSON-format conversation to their server, and they use their own LLM to generate a reply and return it to you. The API is like your account ID β when you send a conversation request with this API attached, they know which account to charge. There are currently two models for paid LLM services: "subscription membership" and "pay-as-you-go", but I would rather recommend deploying an LLM model on your own computer β for example, using software like LM Studio or oMLX to easily deploy a local LLM server for development. noddock is also software that runs purely locally. If your computer has 16β24 GB of RAM, you can try deploying a Qwen3.5 9B (Q4 quantized) model β this small model is enough for many simple tasks. If you are not good at local deployment, you can create a DeepSeek account and API at https://api-docs.deepseek.com, because it is pay-as-you-go β compared to a subscription, you can complete every task in this tutorial with very little money.
Now let's try building a chatbot in noddock. The idea is simple:
- Create a
Core--Container--Jsonnode to hold all the conversation records mentioned above, and copy one for later use. - Create an
LLM--OpenAI--Chatnode and fill in your endpoint (i.e. the API url), api, and model. For how to fill these in, refer to the platform where you bought the API, or the server configuration of LM Studio and oMLX. Theapifield can take the API key directly, or a ref from the Vault (recommended, see the Vault section) β that way sharing the project will not leak the key. - Connect the Json node's output to the
messagesvariable ofLLM--OpenAI--Chat. - Then connect the
messagesoutput of theLLM--OpenAI--Chatnode to the copied Json node.
That's it β a simple chatbot is done! Try adding {"role":"user", "content":"Hello, what model are you?"} to the first Json, then click Run in the top-right corner of this workflow and see if there is any response. If it works, observe the Json node again β has the data inside been updated?
If you are interested, click the gear in the top-right corner of the Json node to inspect it β you will find it has only one variable, json, which is simultaneously an input, an output, and editable. So when you modify the json data, the output changes accordingly. The LLM--OpenAI--Chat node, on the other hand, has multiple outputs: messages stuffs the LLM's input into the context and returns the complete conversation record, reply returns only the LLM's current reply (including tool_calls), and tokens returns the token usage of this request β you can create a new Json node and connect it to inspect the specific output. Other variables such as stream_out carry streaming data; connect it to a streaming-capable node to preview the output, but note that the streaming node used for previewing must be independent from the nodes that handle reply or messages. If you look carefully enough, in the Connection section there is also a hidden settings_extra parameter that lets you add extra control parameters to the input β for example, some providers accept {"thinking": {"type": "enabled/disabled"}} to toggle thinking mode, and you can make extra adjustments here.
Of course, filling in the complete {role:..., content:...} every time is also a hassle. You can also create a Core--Container--String node as the user input, and combine it with a Json--Property--SetString (or another type of Set node) and a Core--Container--List node to assemble the context automatically. If you can write JS, then Json--InlineJS will be very helpful. When you are not sure what these nodes do or how to use them, there are a few methods you can try:
- Click the gear icon to view the built-in description β there is usually a simple description and notes (a full node wiki is on hold for now).
- Adjust the Connection attributes and test its inputs and outputs in a new workflow, or refer to other projects.
- Go to the official GitHub repository and look at the public Go code directly.
Next you can try building it yourself with basic nodes, or open this tutorial's editor page β there are two workflows, example1_chat_workflow and example1_compress_workflow, for you to study. The Conversation node they use is actually not much different from the Json node used earlier β it just uses the Custom HTML feature to get a more convenient operating UI. The first workflow is ordinary chat; the second compresses the conversation: you select a range of messages in the UI, the LLM summarizes it and replaces it back into messages, so long conversations do not grow without bound. If you are interested, try adding nodes to bring out variables and see what changes and how the data flows β making the LLM's internal process transparent and controllable is precisely noddock's design motivation. Later we will also learn how to create your own Custom HTML from scratch.
Example 2: Build an MCP-Capable Workflow with the LLM--OpenAI--Chat Node, and Create Your Own Tool
We previously created a chatbot, but modern LLMs can do much more than chat: control your computer, read files and write code, operate Blender, generate images, and so on. How is that possible? It is actually not complicated at all. As mentioned before, an LLM only takes text in and produces text out β beyond that it can do nothing. But you can add a node after the string output to try to parse its reply, letting that node or some other software execute the operation mentioned in the reply and return the result into the context. Then the LLM appears to have completed the operation and received the reply. This is what is called a Tool Call β the LLM successfully calling an external tool to complete an operation.
For example, in the chatbot from the previous section, if you do not tell the LLM your name and then ask it to state your name, you can use a Tool Call to let the LLM proactively fetch your name. This process requires the following three prerequisites:
- The conversation must first tell the LLM what kind of reply (command) it should send if it wants to know your name;
- Behind the LLM node, there is a node that decides whether the reply is ordinary chat or the "get name" command; if it is a command, the next node is let through to execute it;
- The node that executes the command returns "the user's name is Xiaoming" and inserts it into the context, which is sent to the LLM again to get a new reply.
Once you have built it successfully, the whole flow looks like:
[
{
"role": "user",
"content": "If you want to know my name, send: γCommand: get user nameγ"
},
{ "role": "user", "content": "Hey, do you know my name?" },
{ "role": "assistant", "content": "γCommand: get user nameγ" },
{ "role": "tool", "content": "The user's name is Xiaoming" },
{ "role": "assistant", "content": "Aha, so you are Xiaoming" }
]
You will notice the whole conversation has one extra loop, because the LLM performs a tool call to fetch the information. But the real format is far more complex than "Command: get user name", because usually we want the format to be more stable and parseable by a program, so it would be much more convenient if the LLM could directly reply with JSON data. In a real example, OpenAI-format tool calling looks like this:
[
{
"role": "user",
"content": "What's the weather like in San Francisco?"
},
{
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_12345xyz",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"location\": \"San Francisco, CA\", \"unit\": \"celsius\"}"
}
}
]
},
{
"role": "tool",
"tool_call_id": "call_12345xyz",
"content": "{\"temperature\": 18, \"condition\": \"Partly Cloudy\"}"
},
{
"role": "assistant",
"content": "The weather in San Francisco is partly cloudy, the temperature is as low as 18Β°C, please be careful."
}
]
This is a conversation record of an LLM trying to use a tool to fetch the weather in San Francisco. Can you tell what happened above? It is a bit more complex, but apart from the format, the whole thing is consistent with the first example.
But if you keep observing the conversation above, you should immediately notice a problem: why does the LLM know to output
"function": {
"name": "get_weather",
"arguments": "{\"location\": \"San Francisco, CA\", \"unit\": \"celsius\"}"
}
when it wants to fetch the weather? Who defined this format and the structure inside arguments? There seems to be no description of get_weather in the context. So this conversation is actually incomplete β before this, someone must have told the LLM what get_weather is, and when and how it should be called.
Therefore, let's create an LLM--OpenAI--Chat node on a blank canvas. You will find it also has a tools input. So the answer to the question above is: besides the messages (the conversation record), what enters the LLM also includes a tools field, which records the set of tools the LLM can call.
The definition file of the get_weather tool from before is the following JSON data. You can create a Json node and fill in:
[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Retrieves current weather for the given location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. BogotΓ‘, Colombia"
},
"units": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "Units the temperature will be returned in."
}
},
"required": ["location"]
}
}
}
]
This is a definition describing what the get_weather tool does and what kind of message to send to call it. For an LLM, you could totally describe it with a piece of text like "get_weather is a function you need to call when blabla...", but the JSON format above is the format widely accepted by LLM providers, and LLM models are trained to react to this kind of structure, so we generally use this format to provide tool definitions to the LLM. You will notice the JSON inside looks a bit different from the tool call above β this is called a JSON schema: in short, in get_weather, the location the LLM wants to fetch could be San Francisco or Shanghai, but definitely not a number or a JSON object, so the "type" of location must be string. A schema specifies what structure a JSON should have and what properties a certain entry inside it should conform to. If you do not want to write a schema, you can also just search for a "json to json schema" website to convert it automatically.
So as long as you pre-load the tools the LLM can use into tools (which is essentially adding extra context), the LLM will, based on the scenarios described in the description of the tool definitions, return the tool call output designed in the definition at the appropriate moment. Why "the appropriate moment"? Because at the bottom the LLM is still that machine that takes text in and returns text out β you have only told it that it can do this; whether it actually calls a tool depends on many factors, including the LLM's intelligence, the tool description, the prompt, and the context scenario.
But there is another problem. We added the definition of get_weather to the context, and the LLM can also return a piece of text like {"function": { "name":"get_weather", "arguments": "{\"location\": \"San Francisco, CA\", \"unit\": \"celsius\"}"} depending on the situation β but that is just a piece of text with no magic at all. Who provides the answer? At this point you need to send this text to another node or server responsible for processing this data β for example, fetching the answer through a weather website. And conveniently, the argument in the LLM's reply is exactly a piece of JSON data; with a little processing it can be handed to anyone else to parse and fetch the answer.
Taking the original "get your name" conversation as an example, in noddock the complete tool call processing flow is as follows:
- Use
LLM--OpenAI--ToolCallParserto parse a single tool call (the input is an element of thetool_callslist, not the entire reply), extractingname,argument(a JSON object), andid. - Use
Logic--Compare--CompareStringto check whethernameis a tool you implemented yourself (e.g.get_name); if so, take the custom branch. - Custom branch: directly return a hardcoded result (or call your own program).
- Merge the results of the two branches with a
Logic--Ornode (whichever branch executes triggers the downstream nodes). - Use
LLM--OpenAI--ToolResultBuilderto assembleidandcontent(the execution result) into a tool result message ({"role":"tool","content":...,"tool_call_id":id}). - Use
Core--Container--List(theappendparameter) to append the tool result to the end of themessageslist. - Use
Logic--RunWorkflowto trigger the next iteration, sending the updatedmessagesto the LLM again, until the LLM produces a final reply (no longer calling tools).
The whole flow can be seen in the two workflows example2_tool_call and example2_tool_call_cycle in the tutorial project. You may notice there are two loops: one for processing tools, and one for the whole LLM conversation. Because a single reply may contain multiple tool calls at the same time, an independent workflow is needed to process them, combine the results, and stuff them back into the context. If you constrain each conversation to allow only one tool call via the prompt, you can also merge the two workflows together. Also, both workflows involve loops, so considering their exit conditions is necessary. The exit condition of example2_tool_call is simple: once there is no tool call in reply, the tool-call processing branch is no longer triggered, and it just finishes after updating the history in the latest plan with messages. The exit condition of example2_tool_call_cycle is on the leftmost Core--Container--List node: each run pops out one tool call from the list (popout), and when the list is empty it stops running, thus exiting the loop.
Another concept about tools worth mentioning is the MCP server. MCP is essentially a collection of tools, except that the tools here are written by us, and mcp.json does not contain the tool definition schema β instead it provides an http address or a program address. When you visit the mcp server at that address, you get back a list of tools. Afterwards you only need to forward the tool call generated by the LLM to that address, and after receiving the response, insert the result back into the context β in other words, this mcp server not only provides tool definitions but can also execute tool methods and return results. In noddock you do not need to worry about any of this complexity β just use the MCP--McpClient node. This node uses a lazy loading mechanism: on the first run (when call is empty or the resource does not exist) it automatically establishes the connection and fetches the tool list (the tools output, in OpenAI format, connectable to the tools input of LLM--OpenAI--Chat), and afterwards reuses the existing connection to execute tool calls. If you have Blender with the official MCP plugin installed, you can try running example2_mcp_blender_load in the tutorial (first fill in the Blender MCP server configuration, i.e. the mcp.json format, in the config parameter of the MCP--McpClient node, then delete the Stop node), and ask it to make a mug. If you are interested, you can also remove the RunWorkflow node and experience for yourself how the LLM uses tools to control Blender on each run.
Example 3: Create Custom JS and Python Nodes
In the noddock basics, you should have learned that a node is very simple: as long as you declare the variables' IDs, types, and default values, and provide a run method, you can create a custom node. noddock currently provides custom nodes based on JS and Python.
First, a custom node, like a project, needs a folder to hold its contents. So you need to create a new folder inside the project folder, for example my-node, and create node.json and main.js or main.py inside it β the two files should be at the same level. When noddock loads a project, it checks whether the first-level folders contain a node.json and tries to register them into the node list. You should also notice that in the Workspace there is a custom_nodes folder. The difference between the two is: when your custom node is placed inside custom_nodes, all projects can use it; when it is placed inside a project, only that project can access it.
JS
Let's start with a custom JS node. You only need to define a JSON file like this:
{
"id": "Me--MyNode",
"name": "Alias Node Name",
"description": "example",
"parameters": [
{
"id": "int1",
"name": "int1",
"kind": "int",
"default": 0,
"connect": ["input", "edit"]
},
{
"id": "float1",
"name": "float1",
"kind": "float",
"default": 0.0,
"connect": ["output"]
},
{
"id": "string1",
"name": "string1",
"kind": "string",
"default": "",
"selections": ["select1", "select2"]
},
{ "id": "json1", "name": "json1", "kind": "json", "default": "{}" },
{ "id": "bool1", "name": "bool1", "kind": "bool", "default": false },
{ "id": "stream1", "name": "stream1", "kind": "stream", "default": "" }
],
"run_enter": "main.js"
}
and that is enough for noddock to treat it as a node. Each variable must have a default value consistent with its type β for example, a json variable accepts {} or [] but not "". Also, selections is currently mainly used with the string type. name is not required, but id is what you should remember and keep β it is critical, and ids can only consist of letters, digits, underscores, and hyphens (the first character must be a letter or a digit).
run_enter specifies which script to invoke when this node runs to process the variables. For example, here it is main.js, so create a main.js file next to node.json and write the script directly inside (like a Python node, the whole script is executed directly):
let int1 = GetValue("int1") || 0;
let string1 = GetValue("string1") || "";
const newString1 = "new string";
SetValue("string1", newString1);
console.log("debug:", int1, string1);
The script reads variables with GetValue(id) and assigns variables with SetValue(id, value); Python nodes can also use GetValue/SetValue β they are pre-injected methods. JSON-type variables are automatically decoded into objects (not raw bytes). When you have finished your computation and obtained the final result, assign the value to the variable with the specified id through SetValue β this updates the variable in noddock and triggers the next node to run. Note that custom JS nodes currently do not handle stream-type variables. Once you have defined a custom JS node and loaded it into a project, you can use it directly β noddock performs the computation with an embedded goja engine.
The my-js-node folder in the tutorial project is a complete example: node.json defines two variables, string1 (input + editable) and string2 (output), and main.js reverses string1 and writes it into string2. The corresponding example3_custom_js_node workflow connects a Core--Container--String to string1 of MyJSNode, then connects string2 to another Core--Container--String to view the result.
Python
In noddock there are two ways to run Python scripts:
- Use the
Exec--Execnode to run a shell command directly β for example, fill in "python main.py" in the input and run it. This is the same as opening a terminal in the project folder and running the script; the result is printed to the output. Note that this is a very dangerous node: it cannot be used undersafeorriskpermission β you need to raise the project permission todangerous. - Use a custom Python node, which defines multiple variables and assigns them with a Python script, letting the variables participate in other noddock workflows. But compared to a custom JS node, which has a built-in lightweight goja engine, noddock does not embed a Python interpreter, so you need to specify a Python interpreter on your system to run the script. You can create a Python virtual environment with uv inside the current project's workspace.
First, try creating a custom node made of a node.json and a main.py in a test project folder β you do not need to write code in main.py yet. When you enter the editor, you will find the custom node has an extra address variable added by the system (string type, empty by default). You can fill in the address of a Python interpreter, absolute or relative to the project folder, for example /usr/bin/python3 or .venv/bin/python.
The address variable also serves as the key for environment sharing: all custom Python nodes with the same address share the same Python interpreter process β that is, they run in the same environment and can access the same share_state global variable. This means if you load a model in one node, other nodes can reuse it directly without reloading. If you want to shut down this shared environment, you can manually close the corresponding resource in the Monitor panel.
Why is such a shared environment needed? Because in a project, Python usually does not just run a script and exit β it typically spends time importing packages and loading models first, and the actual inference part may only take a moment. If you had to reload the entire process every time, it would be a huge waste. noddock's address mechanism lets you load the dependency packages and models only once within the project's lifetime, and subsequent executions all happen in the same environment.
If you are curious about how noddock communicates with Python nodes, you can look at the assets/scripts/python_terminal_example.py file in the GitHub repository, which shows the stdio protocol format for communicating with noddock, providing two wrapped methods, GetValue and SetValue, and the global variable share_state. So when you write the main.py of a custom Python node, you can just write:
import json
modelPath = GetValue("mode_path")
text = GetValue("text")
if "model" not in share_state:
share_state["model"] = LoadModel(...) # a long procedure
model = share_state["model"]
output = model.Process(text)
SetValue("output", output)
in this form. share_state is what lets the model avoid being reloaded every time.
The my-py-node folder in the tutorial project is a complete example: node.json defines two variables, text (input + editable) and length (output, int type), and main.py computes the length of text and writes it into length. The corresponding example3_custom_python_node workflow connects a Core--Container--String to text of MyPyNode, then connects length to a Core--Container--Int to view the result. The address of MyPyNode is filled with /usr/bin/python3. The first run takes a little longer to load Python, but subsequent runs are very fast.
Example 4: Use Custom HTML to Create Your Own UI and Project Entry for a Node
Besides custom nodes, you can also create a UI for any node. For example, the nodes in the editor are essentially just a kind of UI too β they simply display variable values in an intuitive way. You can totally read these values in an HTML file and present them in a completely new way, or even process and update them with frontend JS code. For example, the example_project tutorial opened in noddock is actually a Custom HTML: the Conversation node it relies on is not much different from a Json node β if you were to describe its run method in Python's main.py, it would take only 2 lines:
messages = GetValue("messages")
SetValue("messages", messages)
And here, including when you type text into the input box and click send, inserting the input into messages β all of that is done on the Custom HTML frontend and updated into noddock. And when you click run in the top-right corner, it is actually just letting noddock run the corresponding chat workflow. To access a node's variables in HTML, update variable values, and run a specified workflow, you need to know some specific usages in noddock.
Since I am already very tired by the time I write this β when life is going well, enjoy it; when it is time to clock out, clock out β let me just go through it briefly. First, the HTML file is recommended to be placed inside the project folder, in which case it is stored with a relative path and can be used together with the export. Then select the path to that file in the Node Property to add Custom HTML rendering to the node. Some official nodes come with templates by default, which can be invoked via /assets/templates/... (see the official repository for all available templates). For example, filling in /assets/templates/string_console.html as the Custom Render Path of a Core--Container--String enables a console-style node UI, which is very convenient for displaying nodes such as exec.
Preset Global Variables and Methods
If you want to develop your own Custom HTML, noddock provides a set of global variables and methods in advance, making it convenient for you to access and update nodes in JS:
__params: all variables of the current node (an object;__params.messagesreads the value of themessagesvariable). Variable IDs are used as keys.__nid: the ID of the current node.__setValue(key, value): update a variable of the current node (async, returns a Promise).__runWorkflow(wid): trigger running the workflow with the specified name (async, returns a Promise).
Parameter Updates and the params-updated Event
When a node's variables are updated (whether triggered by the frontend __setValue, or modified after the backend runs a workflow), noddock automatically fetches the latest variables and updates __params, then dispatches a params-updated event. You can listen to this event to sync your UI:
window.addEventListener("params-updated", () => {
// __params is already the latest value
console.log(__params.messages);
});
If you use our bundled Alpine.js framework, you can initialize a reactive variable in x-data and listen to the params-updated event to update it:
<script defer src="/assets/js_ext/[email protected]"></script>
<body
x-data="{ messages: __params.messages }"
@params-updated.window="messages = __params.messages"
>
<div x-text="messages"></div>
</body>
Security Restrictions
For security, any link pointing outside (such as <a href="https://...">, window.open, location navigation, etc.) in a Custom HTML is blocked.
Example
Here is the simplest Custom HTML example (reading the messages variable and displaying it):
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script defer src="/assets/js_ext/[email protected]"></script>
<link rel="stylesheet" href="my_style.css" />
</head>
<body
x-data="{ messages: __params.messages }"
@params-updated.window="messages = __params.messages"
>
<div id="my-messages" x-text="messages"></div>
</body>
The json_editor.html in the tutorial project is a more practical example: it provides a JSON editor UI for a Core--Container--Json node, with a textarea and three buttons β Save, Format, and Minify. The core logic is:
// Read the initial value from the host-injected __params
const raw = window.__params.json;
input.value = JSON.stringify(JSON.parse(raw), null, 2);
// Save: update the node's json parameter via the host's __setValue
async function save() {
const obj = JSON.parse(input.value);
await __setValue("json", JSON.stringify(obj));
}
Setting custom_render_path to json_editor.html in the Node Property mounts this HTML onto a node, and setting the connection attributes of the json parameter to input+edit+output makes the node display as an interactive JSON editor in the editor. The corresponding example4_custom_html workflow contains only this one node β you can open it to see the effect.
Finally, when you have created a Custom HTML for a node and want it to run in a standalone window, just like this tutorial, it is very simple: just fill in the node's ID in Enters under the Project Property in the top-right corner (separate multiple entries with commas, up to 3, and entry buttons are generated in order). On the Library page the project will have a corresponding Run button, and clicking it opens the node in a standalone window β this feature, along with noddock's windows and related technology, is mainly implemented with the wails3 framework. If you want to see a complete implementation, you can refer to example1_chat_workflow and example1_compress_workflow in the tutorial project β they are two workflows designed for the Custom HTML of the Conversation node, corresponding to the Run and Compress functions above the page, respectively. For the detailed code, refer to:
- Conversation's Go implementation: github.com/noddock/noddock/nodes/ui/conversation_node.go
- Conversation's HTML file: github.com/noddock/noddock/assets/templates/conversation.html
Example 5: Advanced Loop Techniques
See example5_cycle for details.