Behavior Trees

io.github.behaviortreesPublished by GitHub account behaviortreesv0.1.1Updated Nov 3, 2026

Validate, convert (behavior3 JSON, BehaviorTree.CPP XML) and open behavior trees in a visual editor

VerifiedStreamable HTTPWeb executable

Overview

Behavior Trees's hosted MCP server (www.behaviortrees.com); no sign-in required; Streamable HTTP; 6 tools.

No AI overview yet: these facts come from the registry entry and the server itself.

Endpoint
www.behaviortrees.com
Last checked

Installation

In SourceWeft

  1. Open Behavior Trees in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.behaviortrees%2Fbehaviortrees/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "behavior-trees": {
      "type": "http",
      "url": "https://www.behaviortrees.com/mcp"
    }
  }
}

README

behaviortrees

Validate, convert and share behavior trees from the command line or any MCP client. It uses the same code as the free visual editor at behaviortrees.com, so what it accepts, the editor opens.

  • Validate behavior3 JSON and BehaviorTree.CPP XML: dangling children, nodes with two parents, cycles, decorators with more than one child, leaves with children, unknown node names.
  • Convert between behavior3 JSON and BehaviorTree.CPP XML (v4 for ROS 2 Jazzy and Groot2, v3 for ROS 2 Humble).
  • Link: turn a tree into a URL that opens it in the editor, laid out and editable. The tree travels inside the link, so nothing is uploaded.

CLI

sh
npx behaviortrees validate tree.jsonnpx behaviortrees convert tree.json --to btcpp-v4 -o tree.xmlnpx behaviortrees convert nav2_tree.xml --to behavior3npx behaviortrees link tree.json --opennpx behaviortrees nodes            # built-in node typesnpx behaviortrees examples         # example trees; add an id to print onenpx behaviortrees guides           # behaviortrees.com guides; add a slug to read one

Leave out the file, or pass -, to read from stdin. --json gives machine-readable output, and validate exits with status 1 when a tree has errors, so it works in CI.

MCP server

Lets an AI assistant write a behavior tree, check it, and hand you a link that opens it in the editor. Tools: validate_tree, create_editor_link, convert_tree, list_node_types, get_example, read_guide.

Remote, nothing to install (Streamable HTTP):

https://www.behaviortrees.com/mcp

Or run it locally over stdio:

json
{  "mcpServers": {    "behaviortrees": { "command": "npx", "args": ["-y", "behaviortrees", "mcp"] }  }}

For Claude Code: claude mcp add --transport http behaviortrees https://www.behaviortrees.com/mcp

Tree format

A minimal behavior3 tree. Positions are optional; the editor lays the tree out.

json
{  "title": "Guard",  "root": "a",  "nodes": {    "a": { "name": "Priority", "children": ["b", "c"] },    "b": { "name": "Sequence", "children": ["d", "e"] },    "c": { "name": "Patrol" },    "d": { "name": "IsEnemyVisible" },    "e": { "name": "Attack" }  },  "custom_nodes": [    { "name": "IsEnemyVisible", "category": "condition" },    { "name": "Attack", "category": "action" },    { "name": "Patrol", "category": "action" }  ]}

Composites list children in run order, decorators have one child, and anything else is a leaf. Priority is behavior3's selector (fallback). Declare any node that isn't built in under custom_nodes.

Library

js
import { validateTree, convertTree, createEditorLink } from 'behaviortrees';
const { valid, findings } = await validateTree(json);const { output } = await convertTree(json, 'btcpp-v4');const { url } = await createEditorLink(json);

License

AGPL-3.0-only (see LICENSE). Portions are derived from the MIT-licensed behavior3editor by Renato de Pontes Pereira (see LICENSE-MIT). Source: github.com/behaviortrees/behaviortrees.

Source: packages/cli/README.md at commit 64f818a

Tools

6

validate_tree

Validate a behavior tree

Checks a behavior tree for errors: missing or dangling children, nodes with two parents, cycles, decorators with more than one child, leaves with children, unknown node names, and BehaviorTree.CPP import problems. Returns valid (true when there are no errors), the trees found, and findings at error, warning or info level.

Parameterstreerequired

convert_tree

Convert a behavior tree

Convert between behavior3 JSON and BehaviorTree.CPP XML (v4 for ROS 2 Jazzy and Groot2, v3 for ROS 2 Humble), the same way the editor imports and exports. Returns the converted text and any issues (BT.CPP has no equivalent for some behavior3 nodes and vice versa).

Parameterstorequiredtreerequired

list_node_types

List built-in node types

The built-in behavior3 nodes a tree can use without declaring them: composites (Sequence, Priority = selector/fallback, MemSequence, MemPriority), decorators (Inverter, Repeater, MaxTime, ...) and leaves (Wait, Succeeder, Failer, ...), with descriptions and default properties.

Takes no parameters.

get_example

Get an example tree

Complete, working example trees (enemy patrol, cooldown-gated attacks, robot navigation with recovery, and more) to learn the format from or start with. Without an id, lists the examples; with an id, returns that tree as behavior3 JSON.

Parametersid

read_guide

Read a behavior tree guide

Practical guides from behaviortrees.com/learn as Markdown: what behavior trees are, node types, blackboards, debugging, structuring large trees, and behavior trees in Unity, Unreal, Godot, Python and robotics (BehaviorTree.CPP, ROS 2, Nav2). Without a slug, lists the guides.

Parametersslug

Version history

1
  1. v0.1.1LatestNov 3, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts