OpenClaw

Connect Pharaoh to OpenClaw so your AI agent sees your codebase architecture. Works with desktop instances and headless bots on Signal, Telegram, Discord, and WhatsApp.

Prerequisite: Install the GitHub App first.

Setup

Option A: Command

/mcp add pharaoh https://mcp.pharaoh.so/sse

Complete the GitHub OAuth flow when prompted.

Option B: Config file (browser-based)

Add to your OpenClaw MCP configuration:

{
  "mcpServers": {
    "pharaoh": {
      "url": "https://mcp.pharaoh.so/sse"
    }
  }
}

The OAuth flow runs on first connection.

Option C: Headless bots (Signal, Telegram, Discord, WhatsApp)

Bots on messaging platforms have no browser. Use the stdio transport with device flow auth:

On first run, the CLI prints a URL and a code. Open the URL on any device with a browser, enter the code, and authorize with GitHub. The bot stores the token and reconnects automatically after that.

Verify

Ask your OpenClaw agent:

The agent should call get_codebase_map and return a module breakdown with file counts, function counts, and dependency relationships.

What happens automatically

  • The agent calls Pharaoh tools before making architectural decisions - checking for duplicate functions, understanding callers, mapping module boundaries

  • Every push to your default branch refreshes the graph within minutes

  • No config files or per-repo setup needed after the initial install

  • Pharaoh tools return structured data in minimal tokens so the agent has room to reason

Troubleshooting

"Skill not loading" or MCP tools don't appear: Check that your OpenClaw version supports MCP. Update to the latest release if tools aren't showing.

Auth fails in headless mode: Use the stdio transport (Option C) with device flow. The SSE transport (Options A and B) requires a browser for OAuth.

"No repos found" or empty results: The GitHub App must be installed on the correct org or account. Go to github.com/apps/pharaoh-so/installations/newarrow-up-right and verify the installation.

Device code expired: Device codes expire after 15 minutes. Run the bot again to get a new code.

Bot authorized but returns no data: Wait 1-3 minutes after installing the GitHub App for initial mapping to complete. Large repos take longer.

Last updated