
World Model Mcp
Give your coding agent a persistent temporal knowledge graph of the repo and block edits that violate declared constraints.
Overview
World Model MCP is a MCP server for the Build phase that maintains a temporal codebase knowledge graph and enforces constraints when your agent edits files.
What is this MCP server?
- Maintains a temporal knowledge graph of entities and relationships across your codebase
- Enforces constraints at the edit boundary before agent-driven patches land
- Stores graph data under configurable WORLD_MODEL_DB_PATH (default ./.claude/world-model/)
- Optional ANTHROPIC_API_KEY enables LLM-powered entity extraction (Haiku) and reasoning (Sonnet)
- stdio MCP package on PyPI: world-model-mcp v0.7.5
- Server version 0.7.5 on PyPI identifier world-model-mcp
- Transport: stdio
- Default extraction model claude-3-haiku-20240307; default reasoning claude-3-5-sonnet-20241022
Community signal: 4 GitHub stars.
What problem does it solve?
Agents lose track of how your codebase fits together and can ship edits that break undocumented rules you only hold in your head.
Who is it for?
Solo builders running long Claude Code sessions on medium-to-large repos who need memory and edit-time guardrails without a separate doc wiki.
Skip if: Greenfield hello-world repos or teams that only want a one-shot file search with no graph maintenance or constraint modeling.
What do I get? / Deliverables
After you register the server, your agent can query a living graph of the project and hit guardrails before unsafe patches are written.
- Local temporal knowledge graph persisted for the project
- MCP tools to query structure and apply constraint checks at edit time
- Configurable extraction and reasoning model IDs via environment variables
Recommended MCP Servers
Journey fit
Canonical shelf is Build because the server is meant to sit at the edit boundary while you implement and refactor code with an agent. Agent-tooling fits tools that shape how Claude Code and similar agents read structure and apply changes safely.
How it compares
MCP knowledge-graph integration for agents, not a static architecture markdown skill or a generic ripgrep wrapper.
Common Questions / FAQ
Who is World Model MCP for?
Indie and solo developers using Claude Code or other MCP agents who want structured repo memory and safer automated edits.
When should I use World Model MCP?
Use it when refactoring, adding features across modules, or enforcing architectural constraints during agent-driven coding.
How do I add World Model MCP to my agent?
Install the PyPI package world-model-mcp, run it over stdio in your MCP config, set WORLD_MODEL_DB_PATH, and optionally ANTHROPIC_API_KEY for extraction.