> 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/connect/cursor.md).

# Cursor

Set up Pharaoh as a Cursor MCP server: add one entry to \~/.cursor/mcp.json, sign in with GitHub, and let the agent query your codebase map.

Before you connect, [install the GitHub App](/docs/connect/github-app.md) and wait for a live repository to finish mapping on the [setup page](https://mcp.pharaoh.so/setup).

Add Pharaoh to `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "Pharaoh": { "url": "https://mcp.pharaoh.so/mcp" }
  }
}
```

If the file already lists other servers, add the `Pharaoh` entry inside the existing `mcpServers` object. To share the setup with a team, put the same entry in `.cursor/mcp.json` at the project root. The file holds only the server URL, no credentials: each teammate signs in with their own GitHub account.

Complete GitHub sign-in when Cursor requests it. Access tokens last 7 days. Pharaoh also issues a refresh token, so a client that supports refresh renews access without a new sign-in. Ask the agent to use Pharaoh to show a codebase map for a live repository.

## Verify the connection

1. Open Cursor's MCP settings and check that Pharaoh is enabled and lists its tools.
2. In chat, ask: “Which Pharaoh tools do you have?” The answer should include `get_codebase_map` and `search_functions`.
3. Ask for the codebase map of a live repository and its last refreshed time.

Cursor calls MCP tools when they fit the request. To get a specific answer, name the tool: “Use Pharaoh's get\_blast\_radius for this function.” On the setup page, **Connect your AI client** shows the time of the last question.

## Common errors

* **No Pharaoh tools in chat**: check that the JSON is valid and the server is enabled, then restart Cursor. Server start-up and sign-in errors appear in the Output panel under **MCP Logs** (Cmd+Shift+U on macOS).
* **“is not tracked by Pharaoh”**: the GitHub App can't read that repository. Grant it access in [GitHub's installed-app settings](https://github.com/settings/installations), or for an organization's repository in that organization's settings under GitHub Apps, then refresh setup.
* **“isn't in your access list”**: Pharaoh maps the repository, but your GitHub account can't reach it. Ask an owner for access on GitHub.
* **A repository that isn't live**: on the free plan, the answer names the live repository and offers a switch. See [account and billing](/docs/use-pharaoh/pricing.md).

[Setup status](https://mcp.pharaoh.so/setup) · [Connection checks](/docs/use-pharaoh/troubleshooting.md)
