world-model-mcp — Claude Code MCP server
This MCP server keeps project memory in a local knowledge graph and checks constraints at the edit boundary. It suits agents that must retain context across sessions.
claude mcp add --env WORLD_MODEL_DB_PATH=<WORLD_MODEL_DB_PATH> --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --env WORLD_MODEL_EXTRACTION_MODEL=<WORLD_MODEL_EXTRACTION_MODEL> --env WORLD_MODEL_REASONING_MODEL=<WORLD_MODEL_REASONING_MODEL> --transport stdio world-model-mcp -- uvx world-model-mcpWhat world-model-mcp does
world-model-mcp gives an agent a local SQLite knowledge graph for the codebase. The agent queries that memory on each turn, so corrections persist across sessions and project constraints can be checked before an edit is applied.
The server runs locally and can maintain a signed audit chain. Closed epochs use hybrid Ed25519 and SLH-DSA-SHA2-128f signatures, while etch-verify can validate records offline. The Claude Code setup requires an ANTHROPIC_API_KEY and starts the server through uvx.
Python 3.11+ is required for the server to run. Choose the SQLite database location before connecting it to a project.
What it helps with
- retain project decisions across agent sessions
- check repository constraints before applying edits
- record agent events in a signed audit chain
- verify audit records offline without an account or network
Example prompts for the agent
- Check the project memory before changing the architecture and follow its saved constraints.
- Store this decision for later sessions and use it when editing the repository.
- Inspect the decision history and report whether any event appears tampered with.
How to install world-model-mcp
Platform CLI
claude mcp add --env WORLD_MODEL_DB_PATH=<WORLD_MODEL_DB_PATH> --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --env WORLD_MODEL_EXTRACTION_MODEL=<WORLD_MODEL_EXTRACTION_MODEL> --env WORLD_MODEL_REASONING_MODEL=<WORLD_MODEL_REASONING_MODEL> --transport stdio world-model-mcp -- uvx world-model-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from world-model-mcp <command>
Platform CLI
codex mcp add world-model-mcp --env WORLD_MODEL_DB_PATH=<WORLD_MODEL_DB_PATH> --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --env WORLD_MODEL_EXTRACTION_MODEL=<WORLD_MODEL_EXTRACTION_MODEL> --env WORLD_MODEL_REASONING_MODEL=<WORLD_MODEL_REASONING_MODEL> -- uvx world-model-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from world-model-mcp <command>
Config file
{
"mcpServers": {
"world-model-mcp": {
"command": "uvx",
"args": [
"world-model-mcp"
],
"env": {
"WORLD_MODEL_DB_PATH": "<WORLD_MODEL_DB_PATH>",
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>",
"WORLD_MODEL_EXTRACTION_MODEL": "<WORLD_MODEL_EXTRACTION_MODEL>",
"WORLD_MODEL_REASONING_MODEL": "<WORLD_MODEL_REASONING_MODEL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from world-model-mcp <command>
Config file
{
"servers": {
"world-model-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"world-model-mcp"
],
"env": {
"WORLD_MODEL_DB_PATH": "<WORLD_MODEL_DB_PATH>",
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>",
"WORLD_MODEL_EXTRACTION_MODEL": "<WORLD_MODEL_EXTRACTION_MODEL>",
"WORLD_MODEL_REASONING_MODEL": "<WORLD_MODEL_REASONING_MODEL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from world-model-mcp <command>
Platform CLI
gemini mcp add -e WORLD_MODEL_DB_PATH=<WORLD_MODEL_DB_PATH> -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -e WORLD_MODEL_EXTRACTION_MODEL=<WORLD_MODEL_EXTRACTION_MODEL> -e WORLD_MODEL_REASONING_MODEL=<WORLD_MODEL_REASONING_MODEL> world-model-mcp uvx world-model-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from world-model-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about world-model-mcp
How do I install world-model-mcp in Claude Code?
Run claude mcp add world-model-mcp -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- uvx world-model-mcp.
What does world-model-mcp do?
It stores codebase memory in a local SQLite knowledge graph, lets the agent query it on every turn, and can sign audit events for offline verification.
What does world-model-mcp need to run?
The Claude Code setup needs ANTHROPIC_API_KEY. The project targets Python 3.11+ and launches through uvx.