Behavior Trees

io.github.behaviortrees由 GitHub 帳號 behaviortrees 發布v0.1.1更新於 Nov 3, 2026

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

已驗證Streamable HTTP可網頁執行

概覽

Behavior Trees 的託管 MCP 服務(www.behaviortrees.com);無需登入;Streamable HTTP;6 個工具。

暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。

端點
www.behaviortrees.com
最近檢查

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Behavior Trees,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.behaviortrees%2Fbehaviortrees/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "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.

來源:packages/cli/README.md,提交 64f818a

工具

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.

輸入參數tree必填

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).

輸入參數to必填tree必填

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.

無需輸入參數。

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.

輸入參數id

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.

輸入參數slug

版本歷史

1
  1. v0.1.1最新Nov 3, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分