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
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):
Or run it locally over stdio:
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.
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
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.