{"id":48666081,"url":"https://github.com/pharaoh-so/pharaoh-mcp","last_synced_at":"2026-04-10T11:01:04.481Z","repository":{"id":342453779,"uuid":"1174070836","full_name":"Pharaoh-so/pharaoh-mcp","owner":"Pharaoh-so","description":"Codebase intelligence MCP server — gives AI agents full architectural awareness through 19 analysis tools. Maps codebases into queryable knowledge graphs.","archived":false,"fork":false,"pushed_at":"2026-03-26T04:07:01.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-08T18:25:07.884Z","etag":null,"topics":["ai-agent","architecture","claude-code","code-analysis","dependency-graph","developer-tools","knowledge-graph","mcp","model-context-protocol","neo4j","python","static-analysis","tree-sitter","typescript"],"latest_commit_sha":null,"homepage":"https://pharaoh.so","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pharaoh-so.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T03:20:14.000Z","updated_at":"2026-03-26T04:07:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Pharaoh-so/pharaoh-mcp","commit_stats":null,"previous_names":["pharaoh-so/pharaoh-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pharaoh-so/pharaoh-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pharaoh-so%2Fpharaoh-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pharaoh-so%2Fpharaoh-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pharaoh-so%2Fpharaoh-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pharaoh-so%2Fpharaoh-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pharaoh-so","download_url":"https://codeload.github.com/Pharaoh-so/pharaoh-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pharaoh-so%2Fpharaoh-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","architecture","claude-code","code-analysis","dependency-graph","developer-tools","knowledge-graph","mcp","model-context-protocol","neo4j","python","static-analysis","tree-sitter","typescript"],"created_at":"2026-04-10T11:00:57.576Z","updated_at":"2026-04-10T11:01:04.458Z","avatar_url":"https://github.com/Pharaoh-so.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# @pharaoh-so/mcp\n\n[![npm version](https://img.shields.io/npm/v/@pharaoh-so/mcp)](https://www.npmjs.com/package/@pharaoh-so/mcp)\n[![license](https://img.shields.io/npm/l/@pharaoh-so/mcp)](https://github.com/Pharaoh-so/pharaoh-mcp/blob/main/LICENSE)\n[![node](https://img.shields.io/node/v/@pharaoh-so/mcp)](https://nodejs.org)\n[![pharaoh MCP server](https://glama.ai/mcp/servers/Pharaoh-so/pharaoh/badges/score.svg)](https://glama.ai/mcp/servers/Pharaoh-so/pharaoh)\n\nMCP proxy for [Pharaoh](https://pharaoh.so) — maps codebases into queryable knowledge graphs for AI agents.\n\nPharaoh 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.\n\nThis package enables [Claude Code](https://docs.anthropic.com/en/docs/build-with-claude/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.\n\n## Quick Start\n\n### Step 1 — Authenticate\n\nRun the proxy directly to trigger the device authorization flow:\n\n```bash\nnpx @pharaoh-so/mcp\n```\n\nThis 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.\n\n### Step 2 — Add to Claude Code\n\n```bash\nnpx @pharaoh-so/mcp\n```\n\nVerify the connection:\n\n```bash\nclaude mcp list\n```\n\nYou should see `pharaoh` listed as a **stdio** server.\n\n### Switching from SSE\n\nIf you previously added Pharaoh as an SSE server, remove it first:\n\n```bash\nclaude mcp remove pharaoh\nnpx @pharaoh-so/mcp\n```\n\n## How It Works\n\n```\nClaude Code ← stdio → @pharaoh-so/mcp ← SSE/HTTP → mcp.pharaoh.so\n```\n\nThe proxy implements the [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) specification:\n\n1. **Claude Code** launches the proxy as a child process and communicates via **stdio** (stdin/stdout)\n2. **The proxy** authenticates with Pharaoh using stored credentials (or triggers device flow)\n3. **All MCP messages** (tool calls, responses, notifications) are relayed to the remote Pharaoh server over **SSE** (Server-Sent Events)\n4. **Pharaoh** queries the knowledge graph and returns architectural data to the proxy\n5. **The proxy** forwards responses back to Claude Code via stdio\n\nAuthentication uses [RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628) (OAuth 2.0 Device Authorization Grant) — no browser is needed on the machine running Claude Code.\n\n## Available Tools\n\nOnce connected, Pharaoh provides 19 MCP tools organized into four categories:\n\n### Orient (Free)\n\n| Tool | What it answers |\n|------|----------------|\n| `get_codebase_map` | What modules exist and how do they relate? |\n| `get_module_context` | What does this module look like before I modify it? |\n| `search_functions` | Does this function already exist somewhere? |\n| `get_design_system` | What UI components and tokens already exist? |\n\n### Investigate (Free + Pro)\n\n| Tool | What it answers |\n|------|----------------|\n| `get_blast_radius` | What breaks if I change this function/file/module? |\n| `query_dependencies` | How are these two modules connected? |\n| `check_reachability` | Is this function actually reachable from entry points? |\n| `get_vision_docs` | Is there a PRD or spec for this? |\n\n### Audit (Pro)\n\n| Tool | What it answers |\n|------|----------------|\n| `get_vision_gaps` | What's specified but not built? What's built but not specified? |\n| `get_cross_repo_audit` | Are shared dependencies drifting between repos? |\n| `get_consolidation_opportunities` | Where is duplicate or overlapping logic? |\n| `get_unused_code` | What code is never called and safe to delete? |\n| `get_test_coverage` | Which modules/functions lack test coverage? |\n| `get_regression_risk` | How risky is this change to production? |\n\n### Manage (Free)\n\n| Tool | What it answers |\n|------|----------------|\n| `request_upload` | Map a local repo without installing the GitHub App |\n| `setup_environment` | Install recommended development plugins |\n| `pharaoh_account` | Check plan, toggle PR Guard, trigger refresh |\n| `pharaoh_feedback` | Report false positives or tool issues |\n| `pharaoh_admin` | Org-level administration |\n\n## Inspect Mode\n\nUse `--inspect` to dump the full tool manifest as JSON (useful for MCP registry validation and debugging):\n\n```bash\nnpx @pharaoh-so/mcp --inspect\n```\n\nThis outputs the complete list of tools with their schemas and exits immediately, without connecting to the server.\n\n## CLI Options\n\n```\nUsage: pharaoh-mcp [options]\n\nOptions:\n  --server \u003curl\u003e   Pharaoh server URL (default: https://mcp.pharaoh.so)\n  --logout         Clear stored credentials and exit\n  --inspect        Output tool manifest as JSON and exit\n  --help           Show help\n  --version        Show version number\n```\n\n## Configuration\n\n### Credentials\n\nCredentials are stored at `~/.pharaoh/credentials.json` with `0600` permissions (owner-read/write only). The file contains:\n\n- **Access token** — used to authenticate MCP requests\n- **Refresh token** — used to obtain new access tokens when they expire\n- **Expiry timestamp** — tokens are refreshed automatically before expiration\n\nTo clear credentials:\n\n```bash\nnpx @pharaoh-so/mcp --logout\n```\n\n### Custom Server\n\nFor self-hosted Pharaoh instances or development, register manually:\n\n```bash\nclaude mcp add --scope user pharaoh -- npx @pharaoh-so/mcp --server https://your-pharaoh-instance.com\n```\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `PHARAOH_SERVER_URL` | `https://mcp.pharaoh.so` | Pharaoh server URL (alternative to `--server`) |\n\n## Requirements\n\n- **Node.js** \u003e= 18\n- **Claude Code** or any MCP-compatible AI client\n- A **Pharaoh account** — sign up at [pharaoh.so](https://pharaoh.so)\n\n## Security\n\n- Credentials are stored with restrictive file permissions (`0600` — owner-read/write only)\n- Authentication uses the [RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628) device authorization flow — no secrets are embedded in the package\n- All communication with the Pharaoh server uses HTTPS/TLS\n- No source code is ever transmitted — Pharaoh maps structural metadata (function names, file paths, dependency relationships) into a knowledge graph. Your code never leaves your machine.\n- Tokens expire after 7 days and are refreshed automatically\n- Only use trusted server URLs — the proxy sends your auth token to the configured server\n\n### Reporting Vulnerabilities\n\nIf you discover a security vulnerability, please report it responsibly by emailing [security@pharaoh.so](mailto:security@pharaoh.so). Do not open a public issue.\n\n## Troubleshooting\n\n### \"Connection refused\" or \"ECONNREFUSED\"\n\nThe Pharaoh server may be temporarily unavailable. Check [status.pharaoh.so](https://pharaoh.so) or try again in a few minutes.\n\n### \"Token expired\" or \"401 Unauthorized\"\n\nRe-authenticate by running the proxy directly:\n\n```bash\nnpx @pharaoh-so/mcp\n```\n\nOr clear credentials and start fresh:\n\n```bash\nnpx @pharaoh-so/mcp --logout\nnpx @pharaoh-so/mcp\n```\n\n### \"pharaoh\" not showing in `claude mcp list`\n\nMake sure you added it with the correct command:\n\n```bash\nnpx @pharaoh-so/mcp\n```\n\nNote the `--` separator between `pharaoh` and `npx`.\n\n### Device code not working\n\n- Ensure you're opening the URL on a device with browser access\n- The device code expires after 15 minutes — request a new one by re-running the command\n- Check that you're logged into GitHub when authorizing\n\n### Slow startup\n\nThe first run after installation may take a moment as npm downloads the package. Subsequent runs use the cached version. To pre-install globally:\n\n```bash\nnpm install -g @pharaoh-so/mcp\nclaude mcp add --scope user pharaoh -- pharaoh-mcp\n```\n\n## How Pharaoh Works\n\nPharaoh parses your repositories using [tree-sitter](https://tree-sitter.github.io/) and maps structural metadata into a [Neo4j](https://neo4j.com/) knowledge graph. The graph contains:\n\n- **Functions** — names, signatures, complexity scores, export visibility\n- **Files** — paths, module membership, language classification\n- **Modules** — logical groupings detected from directory structure\n- **Dependencies** — import/export relationships, call chains, module connections\n- **Vision specs** — PRD/spec documents linked to implementation\n\nNo 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.\n\n## Supported Languages\n\n- **TypeScript / JavaScript** — full support (functions, classes, imports, exports, JSX)\n- **Python** — full support (functions, classes, imports, decorators)\n- More languages planned via tree-sitter grammar support\n\n## Contributing\n\nContributions are welcome. Please open an issue first to discuss what you'd like to change.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\n[MIT](LICENSE) -- Pharaoh, Inc.\n\n## Links\n\n- [Pharaoh website](https://pharaoh.so)\n- [Documentation](https://docs.pharaoh.so)\n- [MCP specification](https://modelcontextprotocol.io/)\n- [Claude Code](https://docs.anthropic.com/en/docs/build-with-claude/claude-code)\n- [Report an issue](https://github.com/Pharaoh-so/pharaoh-mcp/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpharaoh-so%2Fpharaoh-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpharaoh-so%2Fpharaoh-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpharaoh-so%2Fpharaoh-mcp/lists"}