world-model-mcp
Maintain a persistent, deterministic 3D/2D spatial world model for AI agents, enabling entity tracking, spatial reasoning, simulation, multi-agent coordination, and Playwright game automation.
Entity management: Create, update, query, and search spatial entities with 3D positions, orientations, AABBs, tags, properties, confidence, and lifecycle status.
Spatial relationships: Record topological links like
on,inside,near,contains, and custom relations between entities.World export: Export the spatial model as JSON, GeoJSON, glTF, OBJ, summary, compact decision slices, and more.
Movement simulation: Predict trajectories, detect AABB collisions, and compute obstacle-avoiding navigation waypoints.
Vision integration: Ingest camera/sensor detections, re-identify entities by proximity, and reconcile against expected frustum views.
View computation: Determine which entities are visible or occluded from an observer pose using FOV cones and ray-AABB occlusion.
Goal linking: Associate entities and regions with state-memory tasks and retrieve goal-relevant spatial context.
Outcome recording: Record action results, movement deltas, property changes, and entity destruction.
Spatial SDD: Register physical baseline contracts, verify constraints (clearance, containment, bounds), and create SHA-256 evidence packs.
Multi-agent coordination: Use a spatial blackboard for topics, collision alerts, and mutex region leases across agents.
Snapshots & rollback: Save, diff, restore, undo, and time-travel the spatial database state.
Game automation: Generate Playwright WASD/arrow hold sequences and project/unproject 3D coordinates to screen pixels.
Async waiting: Poll until an entity exists, becomes active, exceeds a confidence threshold, or enters a region.
CLI & visualizer: Initialize projects, run stats, inspect maps, export/import, and launch a 3D WebGL scene visualizer.
@putervision/world-model-mcp
@putervision/world-model-mcp is a zero-infrastructure, deterministic Model Context Protocol (MCP) server that maintains a persistent 3D/2D spatial world model for AI agents. It bridges perception (@putervision/vision-memory-mcp) and reasoning/action (@putervision/state-memory-mcp) with durable entity tracking, object permanence with confidence decay, movement simulation with AABB collision avoidance, expected view frustum projection, and Playwright 3D game automation.
๐ Official Documentation & Website: putervision.com
โก Quick Start & Installation
Prerequisites: Node.js >= 18.18.0
# 1. Install globally
npm install -g @putervision/world-model-mcp
# 2. Navigate to your project directory
cd your-project
# 3. Initialize world-model-mcp
# Creates .world-model-mcp/, updates .gitignore, registers project,
# and scaffolds IDE instructions and MCP configs for Cursor, Claude, VS Code, Windsurf, etc.
world-model-mcp init
# Done! Restart your IDE or Agent Manager to activate.Alternative Options
# Run directly via binary (after global install)
world-model-mcp run
# Launch interactive 3D WebGL Scene Visualizer
world-model-mcp view
# Display database metrics and permanence confidence stats
world-model-mcp statsRelated MCP server: persistent-kb-mcp
๐ Key Highlights
๐ Deterministic 3D/2D Spatial Memory & Compact Slices: Zero LLM in the loop for spatial indexing; deterministic SQLite WAL queries with FTS5 search, 3D Euclidean proximity radius lookups, and sub-1KB observer-relative compact slices ($K \le 16$ nearest entities) for System 1 fast path evaluation.
โก 15 Production-Grade Consolidated MCP Tools: Full CRUD, topological spatial graphs (
on,inside,contains,near), ray-AABB occlusion frustum culling, waypoint navigation, and time-travel rollback.โณ Object Permanence & Decay: Entities remain in persistent memory even when out of view, with configurable exponential confidence decay ($C = C_0 \cdot e^{-\lambda t}$) and status lifecycles (
activeโhiddenโlost).๐ Collision & Movement Simulation: Predicts entity displacement trajectories, detects AABB obstacle collisions, and computes obstacle-avoiding navigation waypoints before actions execute.
๐ฎ Playwright Game Automation: Generates timed WASD / Arrow keyboard hold sequences (
KeyW for 450ms,ArrowLeft for 290ms) and 3Dโ2D coordinate screen projections.๐ค Multi-Agent Spatial Blackboard: Topic-based coordination with TTL, mutex locks, and collision intent alerts across parallel subagents.
๐ก๏ธ Spatial Spec-Driven Development (Spatial SDD): Physical design contract baseline registration, live verification (clearance, bounds, containment), and cryptographic SHA-256 evidence bundles.
๐จ Interactive 3D WebGL Visualizer: Browser-based Three.js 3D viewport rendering active entities, orientation axes, frustum cones, and topological links (
world-model-mcp view).๐ 100% Local & Private: All spatial entities, relations, and history stay inside
.world-model-mcp/in your workspace.
๐ ๏ธ MCP Tool Suite
@putervision/world-model-mcp provides 15 production-grade consolidated MCP tools organized across 5 core workflow domains:
Spatial Memory & Search:
update_entity(entity CRUD, 3D bounds, properties, confidence),query_entities(FTS5 search, proximity radius, status/tags filter, history lookup),set_relation(topological graph links:on,inside,near,contains),get_spatial_map(JSON, GeoJSON, glTF 2.0, OBJ, summary, andformat: "compact_slice").Simulation & Vision Integration:
simulate_movement(displacement prediction, AABB collision checks, waypoint routing),ingest_observation(vision detection ingestion, Euclidean re-identification, frustum reconciliation),get_expected_view(observer pose, horizontal FOV cone, ray-AABB occlusion).Goal & State Integration:
link_to_goal(associate entities/regions with State Memory tasks, extract spatial context slices),record_outcome(record execution results, position shifts, property changes, destruction).Spatial SDD & Proofs:
manage_spatial_spec(register physical clearance/containment contracts, live verification scoring),create_evidence_pack(cryptographic SHA-256 evidence bundles linking spatial proofs to task nodes).Multi-Agent, Replay & Automation:
use_spatial_blackboard(topic board, mutex claim/release, intent conflicts),manage_snapshot(checkpoints, snapshot diffing, time-travel undo),wait_for_spatial_state(async polling for target spatial condition),generate_game_inputs(Playwright WASD hold timings, 3Dโ2D screen ray projection).
๐ For complete parameter specifications, return schemas, and example payloads, see the API Reference Guide and Database Schema.
๐ Architecture & Spatial Memory Lifecycle
Perception / Vision Detection
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Perception Ingestion & Re-ID โ โโโถ ingest_observation(reconcile: true)
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Durable Entity & Permanence โ โโโถ update_entity(...)
โ (3D Bounding Boxes, Decay) โ โโโถ set_relation(relation: "on"|"inside")
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Simulation & Waypoint Routing โ โโโถ simulate_movement(mode: "navigate")
โ (AABB Collision Avoidance) โ โโโถ get_expected_view(fov: 90)
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Playwright & Action Execution โ โโโถ generate_game_inputs(...)
โ (WASD Sequences, Screen Rays) โ โโโถ record_outcome(action_type: "move")
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Spatial SDD & Cryptographic โ โโโถ manage_spatial_spec(action: "verify")
โ Evidence Bundling to Tasks โ โโโถ create_evidence_pack(...)
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Persistent SQLite Engine โ โโโถ .world-model-mcp/world.db (WAL mode)
โ Append-Only History Ledger โ โโโถ SHA-256 Cryptographic Audit Chain
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ Documentation Directory
Explore dedicated guides and deep dives in the docs/ directory:
Guide | Description |
High-signal architectural overview, module inventory, data flows, and design decisions. | |
PuterVision Autonomous Triad interaction, 3D WebGL scene visualizer, and evidence packs. | |
Object Permanence ($C = C_0 \cdot e^{-\lambda t}$), Confidence Decay, Frustum Projection, and Spatial SDD. | |
โ๏ธ Configuration & IDE Setup | Auto-Initialization details, Environment Variables, and Editor Configs (Cursor, VS Code, Claude, Windsurf). |
๐ ๏ธ CLI Command Reference | CLI flags ( |
Complete reference for all 15 Consolidated MCP Tools, legacy tool mapping, and parameter examples. | |
๐๏ธ Database Schema | SQLite tables ( |
Autonomous 3D browser arena with Three.js bridge diagnostics ( | |
๐งญ Examples & Tutorials | Deep-dive examples: Spatial Navigation, Perception Reconciliation, and Multi-Agent Blackboard. |
๐ Agent Playbook: 5-Step Canonical Workflow
When an autonomous AI agent enters a repository with world-model-mcp:
1. Orient & Explore โโโถ get_spatial_map(format: "summary") + get_expected_view(fov: 90)
2. Query & Locate โโโถ query_entities(query: "chest", radius: 15) + query_entities(entity_id: "...")
3. Plan & Simulate โโโถ simulate_movement(mode: "navigate") + manage_spatial_spec(action: "verify")
4. Execute & Ingest โโโถ generate_game_inputs(...) + ingest_observation(reconcile: true)
5. Record & Evidence โโโถ record_outcome(...) + create_evidence_pack(task_id: "...")๐งช Testing
# Run full unit, integration, and geometry stress test suite across 47 test files (206 tests)
npm test
# Run multi-Node matrix test suite across Node.js 18, 20, and 22
npm run test:matrix
# Run 3D geometry, projection, and Playwright game loop tests
npm run test:3dโ๏ธ License & Disclaimers
Developed and maintained by PuterVision. Released under the MIT License.
Local Storage Guarantee: All spatial coordinates, bounding volumes, and entity history remain 100% local in your workspace. No telemetry or project data is ever transmitted.
Trademarks & Non-Affiliation: Product names (Cursor, Claude Code, Gemini, Windsurf, VS Code, GitHub, SQLite, Three.js, Playwright) are property of their respective owners and used solely for compatibility identification.
Available Tools
15 toolscreate_evidence_packA
Package entity positions, observation reconciliations, and snapshot states into an immutable, SHA-256 hashed cryptographic evidence pack for compliance and state-memory task verification. Does not change entities; hashes current proof. Returns {ok, pack_id, hash, payload}. Use create_evidence_pack instead of manage_snapshot when creating immutable cryptographic verification packages rather than database checkpoints.
Inputs: project, task_id, entity_ids, observation_ids, +3 more.
generate_game_inputsARead-onlyIdempotent
Translate 3D navigation paths into Playwright commands (WASD/click-to-move) or project/unproject 3D coordinates and screen pixels. Actions: generate_inputs, project_screen, unproject_ray. Read-only: generates Playwright inputs, does not press keys. Returns {ok, action, inputs[]|screen_coords|ray}. Use generate_game_inputs instead of simulate_movement when translating 3D trajectories into Playwright browser automation commands.
Inputs: action, camera, project, screen_x, +13 more.
get_expected_viewARead-onlyIdempotent
Compute which entities should be visible from an observer pose and FOV cone, with ray-AABB occlusion. Read-only. Does not write entities. Returns {visible[], occluded[], observer}. Use get_expected_view instead of get_spatial_map when computing observer FOV visibility and occlusion cones rather than unfiltered world states.
Inputs: observer_position (required), project, fov_degrees, max_distance, +1 more.
get_spatial_mapARead-onlyIdempotent
Export the known world as json, geojson, topological_graph, gltf, obj, joint, spatial_vlm, summary, or compact_slice. Optional region_id and min_confidence filters. Read-only snapshot of current SQLite state (not a live renderer). Returns the payload in requested format. Use get_spatial_map instead of query_entities when exporting full environment snapshots or 3D meshes rather than filtering entities.
Inputs: k, format, project, region_id, +3 more.
ingest_observationA
Merge vision detections into the world model: re-identify by Euclidean proximity, boost confidence, and optionally reconcile against the expected frustum. This is the perception writer. It may create or update entities when reconcile=true. Returns {ok, matched[], created[], lost[], reconcile}. Use ingest_observation instead of update_entity when merging camera or sensor perception detections rather than manual authoring.
Inputs: detections (required), project, reconcile, field_of_view, +2 more.
link_to_goalA
Link or unlink entities and regions to state-memory task nodes, or extract a goal-relevant spatial slice. Actions: link, unlink, get_context. link/unlink mutate association rows only. get_context is read-only. Returns {ok, action, links[]|context}. Use link_to_goal instead of record_outcome when associating entities with state-memory task nodes rather than recording physical movement deltas.
Inputs: notes, action, radius, project, +9 more.
manage_snapshotADestructive
Checkpoint, diff, undo, or time-travel the spatial world database. Actions: save, restore, diff, list, undo, history, time_travel. restore (overwrites live state) and undo (reverts last matching mutation) are destructive and not always reversible except by saving first. diff, list, history, and time_travel are read-only. Returns {ok, action, snapshots[]|diff|state}. Use manage_snapshot instead of update_entity when rolling back, diffing, or time-traveling database state rather than editing single entities.
Inputs: name, type, action, project, +5 more.
manage_spatial_specA
Manage Spatial Spec-Driven Development (Spatial SDD) physical baseline contracts. Actions: set (registers a baseline spec), verify (evaluates live entities against constraints without mutating), list (returns all registered specs). verify is read-only. set persists constraints. Returns {ok, action, spec_id, passed:boolean, violations[]}. Use manage_spatial_spec instead of update_entity when validating physical contract baselines rather than mutating live entity state.
Inputs: name, action, bounds, project, +4 more.
query_entitiesARead-onlyIdempotent
Find entities by keyword query (FTS5 search), type, region, spatial proximity, tags, or status. Alternatively, provide entity_id for single-entity location and historical trajectory lookup. Read-only. Returns {ok, count, entities[]}. Use query_entities instead of get_spatial_map when searching for specific subsets rather than exporting the full topology.
Inputs: tags, type, limit, query, +9 more.
record_outcomeA
Record action execution results, movement deltas, property changes, entity destruction, or spool outcome ingestion from 60Hz loop. Not for vision ingest or manual pose edits. Mark entity destroyed via status: "destroyed". Returns {ok, action, success:boolean, ...}. Use record_outcome instead of update_entity when applying executed action results and status deltas rather than hand-authoring entities.
Inputs: items, action, project, success, +9 more.
set_relationA
Record or remove a spatial relationship between two entities. Actions: add, remove. Relations: on, inside, next_to, above, below, near, contains, occluded_by, connected_to, facing, holding, part_of, custom. This mutates the relation graph only, not entity poses. Returns {ok, relation}. Use set_relation instead of update_entity when establishing topological links (on, inside, contains) rather than setting entity coordinates.
Inputs: relation (required), source_id (required), target_id (required), action, +5 more.
simulate_movementARead-onlyIdempotent
Predict entity trajectory, test for AABB obstacle collisions, or compute navigation waypoints (modes: simulate, navigate, waypoints). Read-only simulation. Returns {ok, is_valid, destination, collisions[], waypoints[]}. Use simulate_movement instead of record_outcome when testing hypothetical motion and collisions before executing an action.
Inputs: mode, project, velocity, entity_id, +7 more.
update_entityA
Create or upsert one spatial entity (position, orientation, AABB, tags, properties, confidence). Manual authoring only. Omit id to create (ULID assigned). Provide id to update. Omitted fields are preserved; this is a partial merge, not a full replace. status defaults to active. confidence is 0.0โ1.0 object-permanence. Does not ingest vision detections or apply action results. Returns {ok, entity_id, created:boolean, entity}. Use update_entity instead of ingest_observation when authoring entities directly rather than merging perception detections.
Inputs: name (required), type (required), id, tags, +11 more.
use_spatial_blackboardADestructive
Publish or read multi-agent spatial coordination topics, collision alerts, and mutex region leases. Actions: get, set, delete, lease, list, post, read, claim, release. set writes payload (coordinates allowed for collision alerts) with optional ttl_seconds. lease acquire fails if the resource is held. delete is destructive. Returns {ok, action, items[]|entry|lease}. Use use_spatial_blackboard instead of set_relation when coordinating transient multi-agent collision alerts and mutex region leases.
Inputs: id, mode, limit, topic, +11 more.
wait_for_spatial_stateARead-onlyIdempotent
Poll and wait until an entity reaches a specific spatial condition (exists, active, confidence threshold, or enters region). Read-only polling tool. Default timeout: 10000ms, poll_interval: 500ms. On timeout returns {ok: false, timeout: true}. Returns {ok, condition_met:boolean, entity}. Use wait_for_spatial_state instead of query_entities when polling asynchronously for an entity state transition or region entry.
Inputs: condition (required), entity_id (required), project, region_id, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 15 tools
The descriptions aggressively disambiguate with explicit 'Use X instead of Y when...' guidance, which helps a lot. However, there are still three entity-writing paths (update_entity, record_outcome, ingest_observation) and three reading/export paths (query_entities, get_spatial_map, get_expected_view) whose boundaries require careful reading, so some residual confusion remains.
All 15 tools use snake_case verb-first naming (update_entity, query_entities, manage_snapshot, create_evidence_pack, wait_for_spatial_state). Even the multi-word variants (link_to_goal, wait_for_spatial_state) follow a predictable verb_noun/verb_prep_noun convention.
15 tools sits at the top of the well-scoped range and each tool maps to a distinct capability (authoring, perception, querying, simulation, snapshots, coordination, verification, automation). For a spatial world-model server, this breadth is justified rather than padded.
The surface covers entity lifecycle (create/update, status-destroyed), relations, querying, export, simulation, perception ingest, snapshots, goal linking, blackboard coordination, spec verification, evidence packing, game inputs, and polling. Explicit deletion/region-management tools are absent, but the destroy-status pattern and region references mostly compensate.
Maintenance
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
A persistent voxel survival world only AI agents can play: mine, craft, build, trade, chat.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Shared voxel world for AI agents. Extend First Light at the world centre over HTTP or MCP; no auth.
Related MCP Servers
- AlicenseAqualityBmaintenanceA local-first MCP server that gives AI coding agents persistent memory and controlled commands. Features a git-backed markdown knowledge vault with FTS5 search, surgical section edits, token-aware context budgeting, and a sandboxed command engine with human approval gates. Works with Claude Code, Cursor, Copilot, Gemini, and more.62601 npm1Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA local-first MCP server providing persistent, searchable knowledge base via SQLite, enabling AI agents to save and recall facts across sessions without cloud dependencies.MIT
- AlicenseAqualityNot gradedmaintenancePersistent memory MCP server for AI agents, using SQLite with hybrid keyword and semantic search for long-term memory storage.5Do What The F*ck You Want To Public
- AlicenseNot gradedqualityBmaintenanceA local MCP server using SQLite to unify context and memory across multiple AI agents, enabling persistent decisions and preferences without re-explanation.ISC