# Behavior Trees

> Behavior Trees is an open-source MCP server for developer tools. Validate and convert behavior trees, then open them in a visual editor. It can run locally on your machine or as a hosted remote server.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Web, CLI, API
- **Website:** https://www.behaviortrees.com
- **Repository:** https://github.com/behaviortrees/behaviortrees/tree/HEAD/packages/cli
- **MCP Registry name:** io.github.behaviortrees/behaviortrees
- **Categories:** developer tools, games and play
- **Listing updated:** 2026-11-14

## About

Behavior trees for game AI and robotics are easy to get subtly wrong, and this server checks them before they reach an engine. Validation catches dangling children, nodes with two parents, cycles, decorators with more than one child, leaves with children and unknown node names, and works on behavior3 JSON and BehaviorTree.CPP XML.

Conversion runs between the two formats, with BehaviorTree.CPP v4 for ROS 2 Jazzy and Groot2 and v3 for ROS 2 Humble. The link tool packs a tree into a URL that opens it laid out in the browser editor; the README says the tree travels inside the link and nothing is uploaded.

It runs remotely or locally over stdio via npx, and a CLI offers the same commands. The code is AGPL-3.0-only. The site sells custom integrations from $2,500.

## Features

- **Structural validation:** Detects cycles, dangling children and bad decorators.
- **Format conversion:** Converts between behavior3 JSON and BehaviorTree.CPP XML.
- **Editor links:** Opens a tree in the editor without uploading it.
- **Built-in node list:** Lists node types and example trees.
- **Guides:** Reads behaviortrees.com guides.
- **CI-friendly CLI:** validate exits 1 on errors.

## Good for

- Check an AI-written tree before running it
- Move a Nav2 tree XML into behavior3 JSON
- Share an editable tree through a link
- Add validation to a CI pipeline

## Install

### Claude Code (Terminal)

```sh
claude mcp add --transport http behaviortrees https://www.behaviortrees.com/mcp
```

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://www.behaviortrees.com/mcp
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "behaviortrees": {
      "url": "https://www.behaviortrees.com/mcp"
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "behaviortrees": {
      "type": "http",
      "url": "https://www.behaviortrees.com/mcp"
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "behaviortrees": {
      "serverUrl": "https://www.behaviortrees.com/mcp"
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "behaviortrees": {
      "type": "http",
      "url": "https://www.behaviortrees.com/mcp"
    }
  }
}
```

## Tools

- `validate_tree`: Validates a behavior tree.
- `create_editor_link`: Builds a URL that opens the tree in the editor.
- `convert_tree`: Converts between behavior3 JSON and BehaviorTree.CPP XML.
- `list_node_types`: Lists built-in node types.
- `get_example`: Returns an example tree.
- `read_guide`: Reads a guide from behaviortrees.com.

## FAQ

### Which formats are supported?

behavior3 JSON and BehaviorTree.CPP XML (v3 and v4).

### Is anything uploaded?

The README says the tree travels inside the link, so nothing is uploaded.

### What licence?

AGPL-3.0-only.

### Remote or local?

Both: a remote endpoint or npx over stdio.

### Is Behavior Trees free?

Yes. Behavior Trees is open source, so you can use and self-host it for free.

### How do I add Behavior Trees to Claude Code?

Run this command in your terminal: claude mcp add --transport http behaviortrees https://www.behaviortrees.com/mcp

### What are the best alternatives to Behavior Trees?

The closest alternatives to Behavior Trees are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/behavior-trees
