# Behavior Trees

This MCP server for Claude Code checks behavior trees, converts formats, and creates links to a visual editor. The agent can call it while working with behavior3 JSON or BehaviorTree.CPP XML.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6 repo stars
- Author: behaviortrees
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/behaviortrees/behaviortrees/tree/HEAD/packages/cli
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/behavior-trees

## What it does

The server checks tree structure for cycles, nodes with multiple parents, and other errors. It converts between behavior3 JSON and BehaviorTree.CPP XML. The agent can also create an editor link or fetch node types, examples, and guides.

Connect to the remote server at `https://www.behaviortrees.com/mcp`, or run it locally with `npx`. Tree data stays inside the generated link rather than being uploaded. Local use requires `npx`.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://www.behaviortrees.com/mcp`

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http behaviortrees https://www.behaviortrees.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add cli -- npx -y behaviortrees
```

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add cli --url https://www.behaviortrees.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add cli -- npx -y behaviortrees
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cli": {
            "url": "https://www.behaviortrees.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cli": {
            "command": "npx",
            "args": [
                "-y",
                "behaviortrees"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cli": {
            "type": "http",
            "url": "https://www.behaviortrees.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cli": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "behaviortrees"
            ]
        }
    }
}
```

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http cli https://www.behaviortrees.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add cli npx -y behaviortrees
```

## When to use it
- find cycles and structural errors in a behavior tree
- convert behavior3 JSON to BehaviorTree.CPP XML
- create an editor link for a tree
- retrieve node types and sample trees

## Example prompts
- Check `tree.json` for structural errors and report the findings.
- Convert `tree.json` to BehaviorTree.CPP XML.
- Create a visual editor link for this behavior tree.

## Similar
- [unreal-behavior-trees](https://affpapa.org/en/nevibecode/skills/unreal-behavior-trees.md) — skill · 10500 installs
- [ai-behavior-trees-utility-ai](https://affpapa.org/en/nevibecode/skills/ai-behavior-trees-utility-ai.md) — skill · 11000 installs
- [ue-state-trees](https://affpapa.org/en/nevibecode/skills/ue-state-trees.md) — skill · 1400 installs
- [cmux-shared-behavior](https://affpapa.org/en/nevibecode/skills/cmux-shared-behavior.md) — skill · 4900 installs
- [behavior-driven-development](https://affpapa.org/en/nevibecode/skills/behavior-driven-development.md) — skill · 151 installs
- [game-ai-behavior](https://affpapa.org/en/nevibecode/skills/game-ai-behavior.md) — skill · 124 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
