Server data from the Official MCP Registry
Temporal knowledge graph for codebases with constraint enforcement at the edit boundary.
Temporal knowledge graph for codebases with constraint enforcement at the edit boundary.
World Model MCP is a well-structured developer tool with reasonable architecture and proper use of environment variables for sensitive credentials. However, there are several moderate-severity concerns: the server makes unauthenticated calls to external APIs (GitHub, Anthropic) without explicit user consent prompts in tool invocations, implements broad file system access without path validation in some operations, and lacks comprehensive input validation on user-provided file paths and queries that could enable directory traversal or injection attacks in edge cases. Supply chain analysis found 5 known vulnerabilities in dependencies (0 critical, 3 high severity). Package verification found 1 issue.
4 files analyzed · 14 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Set these up before or after installing:
Environment variable: WORLD_MODEL_DB_PATH
Environment variable: ANTHROPIC_API_KEY
Environment variable: WORLD_MODEL_EXTRACTION_MODEL
Environment variable: WORLD_MODEL_REASONING_MODEL
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-saravananjaichandar-world-model-mcp": {
"env": {
"ANTHROPIC_API_KEY": "your-anthropic-api-key-here",
"WORLD_MODEL_DB_PATH": "your-world-model-db-path-here",
"WORLD_MODEL_REASONING_MODEL": "your-world-model-reasoning-model-here",
"WORLD_MODEL_EXTRACTION_MODEL": "your-world-model-extraction-model-here"
},
"args": [
"-y",
"world-model-hooks"
],
"command": "npx"
}
}
}From the project's GitHub README.
The event clock for coding agents. An MCP server that builds a temporal knowledge graph for your codebase -- captures decision traces from Claude Code sessions, links them to test outcomes, learns trajectories, and enforces constraints at the edit boundary.
Status: Alpha (v0.6.0) -- The event clock for coding agents. 22 MCP tools, 186 tests, PreToolUse enforcement, decision traces, prediction layer. Contributions welcome.
mcp-name: io.github.SaravananJaichandar/world-model-mcp
World Model MCP creates a temporal knowledge graph of your codebase that learns from every Claude Code session to:
Think of it as giving Claude a long-term memory of your project.
Download the latest .mcpb from Releases and drag it into Claude Desktop. Auto-installs hooks, MCP server config, and dependencies.
# 1. Install the package
pip install world-model-mcp
# 2. Setup in your project (auto-seeds the knowledge graph from existing code)
cd /path/to/your/project
python -m world_model_server.cli setup
# 3. Restart Claude Code
# Done! The world model is pre-populated and active
You can also re-seed or seed manually at any time:
# Seed from existing codebase
world-model seed
# Re-seed with force (re-processes already seeded files)
world-model seed --force
your-project/
├── .mcp.json # MCP server configuration
├── .claude/
│ ├── settings.json # Hook configuration
│ ├── hooks/ # Compiled TypeScript hooks
│ └── world-model/ # SQLite databases (~155 KB)
Before:
// Claude invents an API that doesn't exist
const user = await User.findByEmail(email); // This method doesn't exist
After:
// Claude checks the world model first
const user = await User.findOne({ email }); // Verified to exist
Goal: Reduce non-existent API references by validating against the knowledge graph
Session 1: User corrects Claude
// Claude writes:
console.log('debug info');
// User corrects to:
logger.debug('debug info');
// World model learns: "Use logger.debug() not console.log()"
Session 2: Claude uses the learned pattern
// Claude automatically writes:
logger.debug('debug info'); // No correction needed
Goal: Learned patterns persist across sessions and prevent repeat violations
// Week 1: Bug fixed (null check added)
if (user && user.email) { ... }
// Week 2: Refactoring
// World model warns: "This line preserves a critical bug fix"
// Claude preserves the null check
// Result: Bug not re-introduced
Goal: Detect potential regressions before code execution
┌──────────────────────────────────────────────────────────┐
│ Claude Code + Hooks │
│ Captures: file edits, tool calls, user corrections │
└──────────────────────────────────────────────────────────┘
|
v
┌──────────────────────────────────────────────────────────┐
│ MCP Server (Python) │
│ - 22 MCP tools for querying/recording/predicting │
│ - LLM-powered entity extraction (Claude Haiku) │
│ - External linter integration (ESLint, Pylint, Ruff) │
└──────────────────────────────────────────────────────────┘
|
v
┌──────────────────────────────────────────────────────────┐
│ Knowledge Graph (SQLite + FTS5) │
│ - entities.db: APIs, functions, classes │
│ - facts.db: Temporal assertions with evidence │
│ - relationships.db: Entity dependency graph │
│ - constraints.db: Learned rules from corrections │
│ - sessions.db: Session history and outcomes │
│ - events.db: Activity log with reasoning chains │
└──────────────────────────────────────────────────────────┘
Temporal Facts: Every fact has validAt and invalidAt timestamps
Evidence Chains: Every assertion traces back to source
Constraint Learning: Pattern recognition from user corrections
Dual Validation: Combines two validation sources
Twenty-two MCP tools available to Claude Code:
query_factCheck if APIs/functions exist before using them
result = query_fact(
query="Does User.findByEmail exist?",
entity_type="function"
)
# Returns: {exists: bool, confidence: float, facts: [...]}
record_eventCapture development activity with reasoning chains
record_event(
event_type="file_edit",
file_path="src/api/auth.ts",
reasoning="Added JWT authentication middleware"
)
validate_changePre-execution validation against constraints and linters
result = validate_change(
file_path="src/api/auth.ts",
proposed_content="..."
)
# Returns: {safe: bool, violations: [...], suggestions: [...]}
get_constraintsRetrieve project-specific rules for a file
constraints = get_constraints(
file_path="src/**/*.ts",
constraint_types=["linting", "architecture"]
)
record_correctionLearn from user edits (HIGH PRIORITY)
record_correction(
claude_action={...},
user_correction={...},
reasoning="Use logger.debug instead of console.log"
)
get_related_bugsRegression risk assessment
result = get_related_bugs(
file_path="src/api/auth.ts",
change_description="refactoring authentication logic"
)
# Returns: {bugs: [...], risk_score: float, critical_regions: [...]}
seed_projectScan the codebase and populate the knowledge graph with entities and relationships
result = seed_project(
project_dir=".",
force=False
)
# Returns: {files_seeded: int, entities_created: int, relationships_created: int}
ingest_pr_reviewsPull GitHub PR review comments and convert team feedback into constraints
result = ingest_pr_reviews(
repo="owner/repo", # Auto-detected from git remote if omitted
count=10
)
# Returns: {prs_scanned: int, constraints_created: int, constraints_updated: int}
# Run tests
pytest
# With coverage
pytest --cov=world_model_server --cov-report=html
186 tests covering knowledge graph CRUD, FTS5 search, constraint management, bug tracking, auto-seeding, PR review ingestion, decision traces, outcome linkage, trajectory learning, prediction layer, memory health, contradiction detection, transcript pointers, project identity, and PreToolUse enforcement. See tests/ for details.
# Database location (default: ./.claude/world-model/)
export WORLD_MODEL_DB_PATH="/custom/path"
# Anthropic API key (optional - enables LLM extraction)
# IMPORTANT: Never commit this! Use .env file (see .env.example)
export ANTHROPIC_API_KEY="your-api-key-here"
# Model selection
export WORLD_MODEL_EXTRACTION_MODEL="claude-3-haiku-20240307" # Fast
export WORLD_MODEL_REASONING_MODEL="claude-3-5-sonnet-20241022" # Accurate
# Debug mode
export WORLD_MODEL_DEBUG=1
Note: Create a .env file in your project root (see .env.example) - it's automatically ignored by git.
Edit .claude/settings.json to customize which tools trigger world model hooks:
{
"hooks": {
"PostToolUse": [{
"matcher": "Edit|Write|Bash",
"hooks": [...]
}]
}
}
Currently Supported:
Coming Soon:
Extensible Architecture: Easy to add new language parsers (see CONTRIBUTING.md)
API Key Usage (only if you provide ANTHROPIC_API_KEY):
Security Best Practices:
.env files.env.example as template.env files only.gitignore automatically excludes sensitive filesContributions are welcome. See CONTRIBUTING.md for:
Areas where help is needed:
Project Size:
Storage Efficiency:
MIT License - Free for commercial and personal use
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.