Skip to main content
Glama

@putervision/behavior-mcp

npm version version CI Node License: MIT

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

Related MCP server: agent-reasoning-mcp

🛠️ 10 Core MCP Tools

Tool

Actions

Purpose

load_behavior

load, unload, swap

Inject, initialize, or hot-swap a behavior tree in browser runtime

set_parameters

set, get, reset

Dynamically update or query runtime execution parameters

get_status

current, history, tree_state

Query active status, node traversal path, tick count, duration

abort_behavior

abort, pause, resume

Halt, pause, or resume behavior execution safely

register_trigger

register, list

Configure reactive interrupt triggers with priority preemption

replay_recording

capture, list

Capture or inspect deterministic browser action sequences

get_metrics

current, history

Retrieve runtime telemetry, tick durations, and stuck events

manage_behaviors

register, get, list

CRUD for immutable behavior tree JSON with SHA-256 tree hashes

manage_blackboard

get, set

Read, write, or query shared behavior tree blackboard variables

manage_runtime_db

stats, audit, snapshot, restore

SQLite diagnostics, SHA-256 Merkle audit, and checkpoint rollback


🛡️ 5-Layer Safety Guardrail Stack & System 1 Invariants

  1. Fail-Closed Evaluator: Unrecognized node definitions throw fatal exceptions immediately.

  2. 60Hz Tick Invariant & Synchronous semantic_check: The loop never blocks on external network calls; semantic condition checks resolve synchronously against blackboard caches.

  3. HMAC Intention Gate Verification: Intentions dispatched to execution nodes require unexpired, cryptographically signed dispatch tokens (PENTAD_HMAC_SECRET).

  4. Action Rate Limiter & Leaf Policy Gate: Strict 60 actions/sec maximum throughput ceiling and policy guardrails blocking irreversible mutations.

  5. Emergency Kill Switch & Watchdog Heartbeat: Atomic safety latch and watchdog timers halting execution if tick stalls beyond 5,000ms.


📚 Deep Documentation Guides


🔗 Client Configuration & Environment

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "mcpServers": {
    "behavior-mcp": {
      "command": "behavior-mcp",
      "args": ["run"],
      "env": {
        "PENTAD_HMAC_SECRET": "your-secure-shared-secret-here"
      }
    }
  }
}

🧪 Testing

# Run full unit and integration test suite across 38 test files (266 tests)
npm test

📄 License

MIT © PuterVision

Available Tools

10 tools
abort_behaviorA

Immediately halt, pause, resume, or unstick behavior execution and disengage active inputs (actions: abort, pause, resume, unstick). Use abort_behavior instead of register_trigger when manually halting or recovering execution rather than configuring automatic condition interrupts.

Returns transition status, disengaged inputs, and unstick diagnostics.

Inputs: action (required), reason, project, trace_id, +1 more.

get_metricsA
Read-onlyIdempotent

Retrieve runtime execution telemetry, tick durations, stuck events, category statistics, and 60Hz action outcome spool entries (actions: current, history, aggregate, compare, spool, drain_spool). Use get_metrics instead of get_status when evaluating tick performance, reading spooled action outcomes, or inspecting aggregated statistics rather than active node traversal.

Returns telemetry metrics, duration percentiles, stuck event counts, spooled outcome records, or drained entry counts.

Inputs: action (required), limit, project, trace_id, +3 more.

get_statusA
Read-onlyIdempotent

Query active behavior execution status, history, or full tree node traversal state (actions: current, history, tree_state). Use get_status instead of get_metrics when inspecting active execution state and node traversal paths rather than aggregated runtime performance telemetry.

Returns execution status, current node path, tick counters, duration, and error states.

Inputs: action (required), limit, project, execution_id.

load_behaviorA
Destructive

Load, unload, or hot-swap a behavior tree instance in the browser runtime (actions: load, unload, swap). Use load_behavior instead of manage_behaviors when executing an active behavior tree instance at runtime rather than registering or inspecting definitions.

Returns execution handle, runtime state, active node, and session/intention bindings.

Inputs: action (required), behavior_name (required), project, trace_id, +7 more.

manage_behaviorsA

Manage immutable JSON behavior tree definitions with SHA-256 hash verification (actions: register, list, get, synthesize). Use manage_behaviors instead of load_behavior when defining, versioning, or synthesizing behavior tree structures rather than executing them.

Returns tree definition, version metadata, SHA-256 content hash, or synthesis DAG.

Inputs: action (required), name, tree, steps, +6 more.

manage_blackboardA
Destructive

Read, write, delete, lease, list, or ingest structured state slices into shared behavior tree blackboard state (actions: get, set, delete, lease, list, ingest_slice). Use manage_blackboard instead of set_parameters when coordinating state across behavior nodes, projecting perception/spatial slices with staleness protection, or acquiring agent mutex leases.

Returns blackboard value, lease acquisition status, key listings, or slice ingestion summary with expiry metadata.

Inputs: action (required), key, mode, value, +7 more.

manage_runtime_dbA
Destructive

Database maintenance, diagnostics, SHA-256 Merkle audit verification, and snapshot management (actions: stats, audit, doctor, snapshot, diff, restore). Use manage_runtime_db instead of get_metrics when auditing SQLite integrity and Merkle proofs or restoring database snapshots.

Returns maintenance diagnostics, Merkle audit trees, snapshot metadata, or diff reports.

Inputs: action (required), name, project, description.

register_triggerA

Configure or list reactive interrupt triggers with priority preemption and cooldown guards (actions: register, list). Use register_trigger instead of abort_behavior when defining automatic condition-based interrupts rather than manually pausing or stopping a tree.

Returns registered trigger configuration, ID, or trigger list.

Inputs: action (required), name, project, priority, +5 more.

replay_recordingA

Capture or list deterministic browser action sequences with adaptive timing (actions: capture, list). Use replay_recording instead of load_behavior when recording or inspecting fixed action sequences rather than running a dynamic behavior tree.

Returns recording metadata, frame sequences, or list of stored recordings.

Inputs: action (required), name, frames, project, +2 more.

set_parametersA

Dynamically set, inspect, or reset execution parameters for the active behavior runtime (actions: set, get, reset). Use set_parameters instead of manage_blackboard for tuning tree-level execution variables and thresholds rather than sharing cross-node data keys.

Returns updated parameter map and execution ID.

Inputs: action (required), project, parameters, execution_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of behavior tree runtime management, and descriptions explicitly guide against misselection (e.g., 'use X instead of Y'). Overlaps like get_status vs get_metrics and load_behavior vs manage_behaviors are clearly differentiated.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern (e.g., load_behavior, set_parameters, get_status, manage_blackboard). No mixing of conventions or vague abbreviations.

    Tool Count5/5

    10 tools is well-scoped for a behavior tree runtime server. Each tool earns its place by covering a unique functional area without redundancy.

    Completeness4/5

    The surface covers definition, execution, monitoring, data sharing, triggers, recordings, metrics, and DB maintenance. Minor gaps exist: no explicit delete/update for behavior definitions (immutability may excuse this), no release for blackboard leases, and no delete for recordings.

    Maintenance

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI agents to execute sandboxed JavaScript code to control external web applications in real-time. It utilizes WebSockets to synchronize script execution with frontend animations, allowing complex UI interactions to be handled in a single agent turn.
      ISC
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to resolve typed routing, loop-stall arbitration, and tool safety checks locally at sub-millisecond latency, avoiding unnecessary frontier LLM calls. It enforces reversible execution checkpoints, token budgets, and decayed episodic memory for safe, privacy-first autonomous operation.
      7
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to combine ambient multimodal perception, continuous episodic memory, and recency-decay context briefing for fast deterministic decisions and safe tool routing. It integrates with MCP clients to reduce unnecessary frontier LLM calls while enforcing token budgets and local-first memory retention.
      7
      MIT