behavior-mcp
@putervision/behavior-mcp
High-Frequency (~60Hz) In-Browser Behavior Tree Tactical Runtime Engine for AI Agents
@putervision/behavior-mcp is a Model Context Protocol (MCP) server that executes deterministic behavior trees directly in browser runtimes at ~60Hz with reactive trigger preemption, frame recordings, SHA-256 Merkle audit chains, and a 5-layer safety guardrail stack.
๐ Official Documentation: putervision.com โข Interactive Web Docs
โก 15-Second Quick Start
# 1. Initialize runtime & seed default behavior trees in your workspace
npx @putervision/behavior-mcp init
# 2. Run system diagnostic and health checks
npx @putervision/behavior-mcp doctor
# 3. Inspect active executions, blackboard state, and reactive triggers
npx @putervision/behavior-mcp inspect๐ ๏ธ 10 Core MCP Tools
Tool | Actions | Purpose |
|
| Inject, initialize, or hot-swap a behavior tree in browser runtime |
|
| Dynamically update or query runtime execution parameters |
|
| Query active status, node traversal path, tick count, duration |
|
| Halt, pause, or resume behavior execution safely |
|
| Configure reactive interrupt triggers with priority preemption |
|
| Capture or inspect deterministic browser action sequences |
|
| Retrieve runtime telemetry, tick durations, and stuck events |
|
| CRUD for immutable behavior tree JSON with SHA-256 tree hashes |
|
| Read, write, or query shared behavior tree blackboard variables |
|
| SQLite diagnostics, SHA-256 Merkle audit, and checkpoint rollback |
๐ก๏ธ 5-Layer Safety Guardrail Stack
Fail-Closed Evaluator: Unrecognized node definitions throw fatal exceptions immediately.
Watchdog Heartbeat Timer: Halts execution if tick evaluation stalls beyond 5,000ms.
Action Rate Limiter: Strict 60 actions/sec maximum throughput ceiling.
Leaf Policy Gate: Blocks irreversible, high-risk mutations (
delete_item,spend_currency).Emergency Kill Switch: Atomic safety latch (
EmergencySafety.engageKillSwitch()) halts all runtimes.
๐ Deep Documentation Guides
๐ Formal API Reference: Full parameter tables, type definitions, and tool schemas.
๐ก Core Architecture & Concepts: Behavior tree execution model, ~60Hz loop, and trigger lifecycle.
๐ฅ๏ธ CLI Usage Guide: Complete CLI command reference (
init,doctor,inspect,run).๐พ Database Schema: SQLite table structures, indexes, and Merkle audit ledger.
โ๏ธ Configuration Reference:
.behavior-mcp.jsonparameters and environment variables.
๐ Client Configuration
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"mcpServers": {
"behavior-mcp": {
"command": "behavior-mcp",
"args": ["run"]
}
}
}๐งช Testing
# Run full unit and integration test suite across 15 test files (87 tests)
npm test๐ License
MIT ยฉ PuterVision