> For the complete documentation index, see [llms.txt](https://pharaoh.so/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pharaoh.so/docs/setup/claude-ai.md).

# Claude.ai

Connect Pharaoh to Claude.ai so it sees your codebase architecture in every conversation.

**Prerequisite:** [Install the GitHub App](/docs/setup/github-app.md) first.

## Setup

1. Open the Claude desktop app
2. Go to **Settings > MCP Servers**
3. Click **Add**
4. Enter the URL: `https://mcp.pharaoh.so/sse`
5. Complete the GitHub OAuth flow in the browser window that opens
6. Authorize with the GitHub account that has the Pharaoh app installed

MCP servers require the Claude desktop app. The browser-only version of Claude.ai does not support MCP.

## Verify

Start a new conversation and ask:

```
What modules does my codebase have? Use get_codebase_map.
```

Claude should return a module breakdown with file counts, function counts, and dependency relationships.

## What happens automatically

* Claude 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 Claude has room to reason

## Troubleshooting

**"MCP server fails to connect":** MCP requires the Claude desktop app. If you're using Claude in a browser tab, download the desktop app from [claude.ai/download](https://claude.ai/download).

**Tools appear but return no data:** The GitHub App must be installed and mapping must be complete. Check your Pharaoh dashboard or wait 1-3 minutes after installing the app for initial mapping to finish.

**OAuth redirect loop or authorization error:** Clear your browser cookies for `mcp.pharaoh.so`, then try again. If that fails, try in an incognito window to rule out extension interference.

**Wrong repos showing up:** Pharaoh maps the repos your GitHub App installation covers. To change which repos are included, go to **GitHub > Settings > Applications > Pharaoh > Configure**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pharaoh.so/docs/setup/claude-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
