═══════════════════════════════════════
Pharaoh pyramid ASCII art
PHARAOH
Codebase Intelligence for AI Agents
Add this MCP server to your AI agent.
Auth flow starts. GitHub app installs. You're in.
https://mcp.pharaoh.so/sse
- or install via Claude Code -
$ claude mcp add pharaoh --transport sse https://mcp.pharaoh.so/sse
01
Add MCP server URL
to your AI client
02
Authorize via OAuth
& install GitHub app
03
Your repos are mapped.
Start querying.
Works with Claude · Cursor · Windsurf · any MCP client
☆ NOW IN BETA ☆ - Your codebase → Neo4j knowledge graph → MCP tools your AI agent can query - 2K tokens instead of 40K - No more blind coding - No more duplicate functions - ☆ PHARAOH SEES ALL ☆ - Maps modules, deps, endpoints, crons, env vars, blast radius - ☆ FREE TO START ☆ -     ☆ NOW IN BETA ☆ - Your codebase → Neo4j knowledge graph → MCP tools your AI agent can query - 2K tokens instead of 40K - No more blind coding - No more duplicate functions - ☆ PHARAOH SEES ALL ☆ - Maps modules, deps, endpoints, crons, env vars, blast radius - ☆ FREE TO START ☆ -
WITHOUT PHARAOH
Reads files one at a time
Burns 40K tokens exploring
Misses cross-module deps
Writes duplicate functions
PRDs based on vibes
Refactors break callers
No idea what hits prod
WITH PHARAOH
Full architecture in 2K tokens
Knows before it touches
Traces 5-hop dep chains
Finds existing code first
PRDs from ground truth
Blast radius before changes
Every endpoint mapped
▵ HOW THE PYRAMID IS BUILT ▵
1.
Install the GitHub App, pick your repos. Tree-sitter parses every file. TypeScript and Python today - more languages coming.
2.
Modules, functions, dependencies, endpoints, cron jobs, DB tables, env vars - all extracted into a Neo4j knowledge graph.
3.
Your AI agent connects via MCP. Thirteen tools. Full architectural awareness. Structured intelligence, not raw file dumps.
pharaoh-mcp-session - claude code
claude> "What breaks if I rename formatMessage?" ┌── pharaoh:get_blast_radius ──┐ Risk: HIGH Direct callers: 4 (across 3 modules) Transitive impact: 12 functions !! Affects endpoints: POST /api/notifications/send POST /api/slack/webhook !! Affects cron: daily-digest (09:00 UTC) └──────────────────────────────┘ claude> "Is there already a retry wrapper?" ┌── pharaoh:search_functions ──┐ Found: withRetry() src/utils/resilience.ts:42 exported: yes async: yes complexity: 8 Used by 6 callers across 3 modules └──────────────────────────────┘ → Agent imports existing function instead of writing a new one.
☆ 13 SACRED TOOLS ☆
Codebase Map
Full structural overview - modules, dependency graph, entry points, hot files. The 30-second briefing your AI never had.
Module Context
Everything about a module before you touch it - functions, exports, internal deps, complexity scores. Context, not guesswork.
Function Search
Find existing functions before writing new ones. Name, signature, location, callers - so your AI reuses instead of reinventing.
Blast Radius
See every caller, transitive dependent, and affected endpoint before changing a function. Know the damage radius first.
Regression Risk
Score every function by how likely a change breaks production. Complexity, exposure, churn - ranked so you know where to be careful.
Reachability Check
Verify new code is actually wired into your app. If nothing calls it from a real entry point, Pharaoh flags it before it ships.
Vision Gaps
What's specified but not built? What's built but not specified? Finds the drift between your docs and your code.
Understand Codebase Map, Module Context, Function Search
Protect Blast Radius, Regression Risk, Reachability Check
Clean Dead Code Detection, Consolidation Opportunities, Test Coverage Map
Align Vision Docs, Vision Gaps
Scale Cross-Repo Audit, Dependency Paths
▵ WHO ENTERS THE TOMB ▵
Solo founders & small teams
You can't hire a CTO to hold the architecture in their head. Pharaoh holds it in a graph.
AI-native dev teams
Your agents are coding blind. Give them sight. 2K tokens of structured intelligence beats 40K of file dumps.
Anyone shipping with Claude Code, Cursor, or Windsurf
If your agent touches code, it should know the codebase first. Not hope. Know.
☆ FREE & OPEN SOURCE ☆
FREE
AI Code Quality Framework
AI coding tools are fast - but they silently accumulate debt. Unused imports, orphan exports, tests that can't actually fail. This framework makes bad output impossible through deterministic enforcement: real-time hooks, mutation testing, dead code detection, and CI gates.
Biome · Knip · Stryker · Lefthook · Claude Code Hooks
View on GitHub →
Your AI writes code blind.
Give it the map of the pyramid.
https://mcp.pharaoh.so/sse
- or via Claude Code -
$ claude mcp add pharaoh --transport sse https://mcp.pharaoh.so/sse
Free to start. Connect your repo in 60 seconds.

Documentation

How Pharaoh Works

Pharaoh parses your codebase using tree-sitter — a deterministic parser with zero hallucination risk — into a Neo4j knowledge graph. Functions, files, modules, imports, exports, call chains, HTTP endpoints, cron handlers, database access patterns, and environment variables are all extracted as nodes and edges. Your AI tool connects via Model Context Protocol (MCP) and queries the graph for structural context before writing or modifying code.

Parsing takes approximately 60 seconds for a 50K LOC TypeScript project. The graph re-indexes automatically via GitHub webhook on every push to the default branch.

Analysis Tools

Pharaoh exposes 13 analysis tools via MCP. 5 are always free; the rest require Pro for full results (free tier receives real preview data).

Codebase Map
Codebase Map — full structural overview with module dependencies, hot files, and endpoint mapping
Module Context
Module Context — complete module profile with functions, DB tables, endpoints, and external callers
Search Functions
Search Functions — find existing code across the entire codebase before creating duplicates
Blast Radius
Blast Radius — trace all downstream callers up to 5 hops before refactoring
Query Dependencies
Query Dependencies — trace forward, reverse, and circular dependencies between modules
Check Reachability
Check Reachability — verify exports are wired to production entry points
Vision Docs
Vision Docs — cross-reference PRDs and CLAUDE.md specs against implementation
Vision Gaps
Vision Gaps — find specs without code and complex code without specs
Cross-Repo Audit
Cross-Repo Audit — compare two repositories for structural duplication and drift
Consolidation Opportunities
Consolidation Opportunities — detect duplicate logic, parallel consumers, and signature twins
Unused Code
Unused Code — graph-based dead code detection with text-reference backup verification
Test Coverage
Test Coverage — per-module coverage with untested high-complexity function flagging
Regression Risk
Regression Risk — score every function by complexity, exposure, churn, and caller count

Architecture

Deterministic tree-sitter parsing into Neo4j graph. No LLM in the analysis pipeline — zero hallucination risk, reproducible results, no per-query API costs. Graph queries trace transitive dependencies up to 5 hops deep, resolving relationships invisible to file-level grep or import scanning.

PR Guard

Automated structural checks on every pull request. Catches unreachable exports, assesses blast radius of changes, scores regression risk, verifies test coverage, and detects introduced duplication. Runs as a GitHub Check Run — advisory on Free, blocking on Pro.

FAQ

Does Pharaoh store my source code?
No. Pharaoh stores structural metadata only — function signatures, file paths, import/export relationships, call edges, complexity scores. No source code, comments, string literals, or variable values are ever stored. The graph is architectural, not textual.
How long does initial setup take?
Under 5 minutes. Install the GitHub App, select repos, add the MCP endpoint to your AI tool. Pharaoh parses the codebase automatically. A 50K LOC TypeScript project maps in about 60 seconds.
How does the graph stay current?
Pharaoh installs a GitHub webhook that triggers re-mapping on every push to your default branch. The graph is always within one commit of HEAD. You can also trigger manual refresh via the account management tool.
What languages does Pharaoh support?
TypeScript and Python today, with full support for imports, exports, call chains, decorators, and barrel files. More languages are planned — Pharaoh's parser is built on tree-sitter, which supports 100+ languages.
How is Pharaoh different from Sourcegraph?
Sourcegraph helps AI find code across repositories — text search, symbol navigation, code intelligence. Pharaoh tells AI what happens if you change that code — blast radius, dependency chains, reachability from production entry points. Sourcegraph answers "where is it?" Pharaoh answers "what breaks?"
How is Pharaoh different from CodeScene?
CodeScene analyzes individual file health using git history patterns — complexity trends, code age, developer coupling. Pharaoh analyzes cross-module architectural relationships using a knowledge graph — how modules connect, what depends on what, which functions are reachable from production. CodeScene is behavioral; Pharaoh is structural.
How is Pharaoh different from SonarQube?
SonarQube performs line-level static analysis — bugs, code smells, security vulnerabilities, style violations. Pharaoh provides system-level structural intelligence — blast radius, dead code via entry-point tracing, module boundary analysis. SonarQube looks at lines; Pharaoh looks at architecture.
Can I use Pharaoh with private repositories?
Yes. The GitHub App requests read-only access to repository contents. All graph data is tenant-isolated. Pharaoh never writes to your repository.
What happens if I cancel?
Your graph data is deleted. Pharaoh has no lock-in — it reads your code, it doesn't store it. Re-subscribing re-maps from scratch.