behavior-trees
Converts behavior trees to and from BehaviorTree.CPP XML for ROS 2 Jazzy (v4) and Humble (v3), enabling trees to be used with ROS 2 and Groot2-compatible tooling.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Behavior Trees Editor

A free, open-source visual editor for behavior trees, live at behaviortrees.com. Model AI for games, robotics, and simulations, then export to an open JSON format you can load with any behavior3-compatible library.
Originally based on behavior3editor by Renato de Pontes Pereira, since rebuilt as a modern React editor on the Nocturne design system and extended with a guides site. The original AngularJS editor lives on at old.behaviortrees.com.
MCP server and CLI
This repo also contains an MCP (Model Context Protocol) server for behavior trees, so AI assistants like Claude can write a tree, check it, and hand you a link that opens it in the editor. Its source is in packages/cli and it's built on the official MCP TypeScript SDK (@modelcontextprotocol/sdk). The tools are registered in packages/cli/src/mcp.ts, and the Streamable HTTP transport is in src/http.ts.
MCP tool | What it does |
| Checks a behavior3 JSON or BehaviorTree.CPP XML tree for structural errors: dangling children, nodes with two parents, cycles, decorators with more than one child, leaves with children, unknown node names |
| Returns a URL that opens the tree in the editor at behaviortrees.com |
| Converts between behavior3 JSON and BehaviorTree.CPP XML (v4 for Groot2 and ROS 2 Jazzy, v3 for Humble) |
| Lists the built-in behavior3 nodes |
| Returns example trees |
| Returns the behaviortrees.com guides as Markdown |
All tools are read-only. Connect to the hosted server, or run it yourself:
Remote (Streamable HTTP):
https://www.behaviortrees.com/mcpLocal (stdio):
npx -y behaviortrees mcp. Thebehaviortreesnpm package is also a CLI (npx behaviortrees validate tree.json) and a library.Claude Code:
claude mcp add --transport http behaviortrees https://www.behaviortrees.com/mcp
It's listed in the official MCP Registry as io.github.behaviortrees/behaviortrees. See packages/cli/README.md for details.
Related MCP server: godot-mcp-server
What's in this repo
A pnpm + Turborepo monorepo:
Path | What it is | Where it deploys |
| Main editor (React + TypeScript + React Flow) | |
| Classic editor (AngularJS + gulp) | |
| Guides and articles (Astro) | |
|
| npm, and behaviortrees.com/mcp |
| Shared example trees consumed by both editors | bundled into both editors |
apps/editor-classic is intentionally not a workspace member — its gulp 3 toolchain keeps its own npm lockfile. Never run pnpm inside it.
Features
Custom nodes: create your own node types in any of the four basic categories — composite, decorator, action, or condition
Node properties: edit titles, descriptions, and custom properties per node instance
Manual and auto layout: drag nodes around, or press
ato auto-organize the whole treeMultiple trees per project: create and manage as many trees as you need
JSON import/export: an open format that works with any behavior3-compatible runtime
BehaviorTree.CPP XML import/export: v4 and v3, including Groot2 and ROS 2 Nav2 trees
Shareable links: Copy link puts the whole tree in a URL that opens it in the editor
No lock-in: runs in the browser, no accounts, no external tools or engines required
Development
git clone https://github.com/behaviortrees/behaviortrees.git
cd behaviortrees
pnpm install
pnpm dev --filter @behaviortrees/editor # React editor (Vite)
pnpm dev --filter @behaviortrees/site # guides site (Astro)
pnpm build # build editor + site via Turborepo
pnpm test # editor test suiteClassic editor
Uses Node <= 22 (see .nvmrc) and its own npm toolchain:
pnpm build:classic # npm install + bower install + gulp build, from the repo root
# or, inside apps/editor-classic:
npm install --ignore-scripts
npx bower install
gulp serve # live reload at http://127.0.0.1:8000Deployment
The React editor deploys to behaviortrees.com through apps/editor/vercel.json (Vercel root directory: apps/editor); its build also bundles the guides site so /learn is served from the same deploy. build-deploy.sh builds the classic editor and the guides site, merging both into deploy/ as the static site Netlify serves at old.behaviortrees.com (via netlify.toml).
License
The classic editor and repo root are MIT — see LICENSE, © 2014 Renato de Pontes Pereira.
The React editor (
apps/editor/) is AGPL-3.0 © Alan Hoskins, with portions derived from the MIT original — see apps/editor/LICENSE and apps/editor/LICENSE-MIT.
Credit to the original behavior3 team for the editor this project grew from.
Available Tools
6 toolsconvert_treeConvert a behavior treeARead-onlyIdempotentInspect
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).
Inputs: to (required), tree (required).
create_editor_linkOpen a tree in the editorARead-onlyIdempotentInspect
Make a link that opens the tree in the behaviortrees.com editor in the user's browser, auto-laid-out and editable, with no account needed. The tree travels inside the link (the URL fragment), so nothing is uploaded or stored. The tree must validate without errors. Give the user the returned url.
Inputs: tree (required).
get_exampleGet an example treeARead-onlyIdempotentInspect
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.
Inputs: id.
list_node_typesList built-in node typesARead-onlyIdempotentInspect
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.
Inputs: no named parameters.
read_guideRead a behavior tree guideARead-onlyIdempotentInspect
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.
Inputs: slug.
validate_treeValidate a behavior treeARead-onlyIdempotentInspect
Check a behavior tree for errors before using it: 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.
Inputs: tree (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct role: validation, editor-link generation, format conversion, node reference, examples, and guides. The three reference-oriented tools (list_node_types, get_example, read_guide) differ in content type and would not be easily confused in normal use.
All tools use snake_case with a predictable verb-first pattern: validate_tree, create_editor_link, convert_tree, list_node_types, get_example, read_guide. The convention is consistent across the entire set.
Six tools is well-scoped for a behavior-tree validation, conversion, editing, and reference server. Each tool covers a distinct part of the workflow without excessive surface area.
The surface covers validation, conversion, editor integration, node discovery, examples, and guides, which are the core authoring workflows. There is no direct runtime execution or debugging tool, but that appears outside the stated editor/conversion focus.
Maintenance
Related MCP Connectors
Static n8n workflow validator: workflow errors and repair suggestions. No execution.
Build, check and fix n8n workflows from Claude, Cursor or ChatGPT. Built on 1,100+ real n8n node definitions and curated templates, with a validator that repairs common mistakes (wrong node types, missing settings) and returns JSON ready to import into n8n. Sign in with a free gydmation.com account; nothing to install.
Control Unreal Engine to browse assets, import content, and manage levels and sequences. Automate…
Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables control and monitoring of Nav2 navigation operations, including navigation, waypoints, costmap management, and lifecycle control, through the MCP protocol.88Apache 2.0
- AlicenseCqualityCmaintenanceEnables AI agents to interact with the Godot game engine, including project inspection, scene/script parsing, headless exports, runtime control with live scene-tree inspection and evaluation, and API documentation search.100807 npm5MIT
- AlicenseAqualityDmaintenanceROS2 MCP server that bridges AI agents (Claude Code, OpenClaw, Cursor) to ROS2, allowing them to read topics, call services, control robots, and wrap telemetry into verifiable hash-chained proof bundles.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to read, review, and generate Unreal Engine 5.4+ blueprints, including dumping graph JSON, reviewing Wwise logic chains, and building blueprints from JSON specs.2MIT