loading…
Search for a command to run...
loading…
AI reads your codebase like a book - one page at a time. Pharaoh gives it the index and a map of how every chapter connects.
AI reads your codebase like a book - one page at a time. Pharaoh gives it the index and a map of how every chapter connects.
npm version license node pharaoh MCP server
MCP proxy for Pharaoh — maps codebases into queryable knowledge graphs for AI agents.
Pharaoh gives AI coding assistants a complete architectural map of your codebase: every function, dependency, module, and connection. Instead of reading files one at a time, your AI agent queries the knowledge graph and gets instant answers about blast radius, unused code, dependency chains, and more.
This package enables Claude Code to connect to Pharaoh in headless environments (VPS, SSH, containers, CI) where a browser isn't available for OAuth. It acts as a stdio-to-SSE proxy, presenting itself as a local MCP server while relaying all communication to the remote Pharaoh server.
Run the proxy directly to trigger the device authorization flow:
npx @pharaoh-so/mcp
This displays a device code and a URL. Open the URL on any device (phone, laptop, tablet) and enter the code to authorize. Credentials are saved to ~/.pharaoh/credentials.json and remain valid for 7 days, with automatic re-authorization when they expire.
npx @pharaoh-so/mcp
Verify the connection:
claude mcp list
You should see pharaoh listed as a stdio server.
If you previously added Pharaoh as an SSE server, remove it first:
claude mcp remove pharaoh
npx @pharaoh-so/mcp
Claude Code ← stdio → @pharaoh-so/mcp ← SSE/HTTP → mcp.pharaoh.so
The proxy implements the Model Context Protocol (MCP) specification:
Authentication uses RFC 8628 (OAuth 2.0 Device Authorization Grant) — no browser is needed on the machine running Claude Code.
Once connected, Pharaoh provides 19 MCP tools organized into four categories:
| Tool | What it answers |
|---|---|
get_codebase_map |
What modules exist and how do they relate? |
get_module_context |
What does this module look like before I modify it? |
search_functions |
Does this function already exist somewhere? |
get_design_system |
What UI components and tokens already exist? |
| Tool | What it answers |
|---|---|
get_blast_radius |
What breaks if I change this function/file/module? |
query_dependencies |
How are these two modules connected? |
check_reachability |
Is this function actually reachable from entry points? |
get_vision_docs |
Is there a PRD or spec for this? |
| Tool | What it answers |
|---|---|
get_vision_gaps |
What's specified but not built? What's built but not specified? |
get_cross_repo_audit |
Are shared dependencies drifting between repos? |
get_consolidation_opportunities |
Where is duplicate or overlapping logic? |
get_unused_code |
What code is never called and safe to delete? |
get_test_coverage |
Which modules/functions lack test coverage? |
get_regression_risk |
How risky is this change to production? |
| Tool | What it answers |
|---|---|
request_upload |
Map a local repo without installing the GitHub App |
setup_environment |
Install recommended development plugins |
pharaoh_account |
Check plan, toggle PR Guard, trigger refresh |
pharaoh_feedback |
Report false positives or tool issues |
pharaoh_admin |
Org-level administration |
Use --inspect to dump the full tool manifest as JSON (useful for MCP registry validation and debugging):
npx @pharaoh-so/mcp --inspect
This outputs the complete list of tools with their schemas and exits immediately, without connecting to the server.
Usage: pharaoh-mcp [options]
Options:
--server <url> Pharaoh server URL (default: https://mcp.pharaoh.so)
--logout Clear stored credentials and exit
--inspect Output tool manifest as JSON and exit
--help Show help
--version Show version number
Credentials are stored at ~/.pharaoh/credentials.json with 0600 permissions (owner-read/write only). The file contains:
To clear credentials:
npx @pharaoh-so/mcp --logout
For self-hosted Pharaoh instances or development, register manually:
claude mcp add --scope user pharaoh -- npx @pharaoh-so/mcp --server https://your-pharaoh-instance.com
| Variable | Default | Description |
|---|---|---|
PHARAOH_SERVER_URL |
https://mcp.pharaoh.so |
Pharaoh server URL (alternative to --server) |
0600 — owner-read/write only)If you discover a security vulnerability, please report it responsibly by emailing [email protected]. Do not open a public issue.
The Pharaoh server may be temporarily unavailable. Check status.pharaoh.so or try again in a few minutes.
Re-authenticate by running the proxy directly:
npx @pharaoh-so/mcp
Or clear credentials and start fresh:
npx @pharaoh-so/mcp --logout
npx @pharaoh-so/mcp
claude mcp listMake sure you added it with the correct command:
npx @pharaoh-so/mcp
Note the -- separator between pharaoh and npx.
The first run after installation may take a moment as npm downloads the package. Subsequent runs use the cached version. To pre-install globally:
npm install -g @pharaoh-so/mcp
claude mcp add --scope user pharaoh -- pharaoh-mcp
Pharaoh parses your repositories using tree-sitter and maps structural metadata into a Neo4j knowledge graph. The graph contains:
No source code is stored — only structural metadata. When an AI agent queries Pharaoh, it gets architectural facts in minimal tokens, not raw code dumps. This means your AI assistant can understand your entire codebase architecture without consuming its context window reading files one by one.
Contributions are welcome. Please open an issue first to discuss what you'd like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)MIT -- Pharaoh, Inc.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"pharaoh-your-ai-breaks-things-it-can-t-see": {
"command": "npx",
"args": []
}
}
}