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

# OpenClaw

Install Pharaoh's MCP server and skills for OpenClaw with one npx command, then authorize GitHub from any device on the agent's first tool call.

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).

Run this in the environment that runs your agent:

```sh
npx @pharaoh-so/mcp --install-skills
```

It adds Pharaoh's MCP server to `~/.openclaw/openclaw.json` and its skills to `~/.openclaw/skills/`. Restart OpenClaw. The agent's first Pharaoh tool call returns an authorization URL and a code: open the URL on any device, complete GitHub authorization, then re-run the tool.

Plain `npx @pharaoh-so/mcp` also sets up OpenClaw and signs you in right away, but it stops unless the Claude Code CLI (`claude`) is on your PATH.

For a remote connector that supports OAuth and Streamable HTTP, use `https://mcp.pharaoh.so/mcp`.

## What the installer changes

* `~/.openclaw/openclaw.json` gets a `pharaoh` entry under `mcpServers` that runs `npx @pharaoh-so/mcp` pinned to the installed version. Run `npx @pharaoh-so/mcp@latest --install-skills` to move to a newer version. An existing `pharaoh` entry that runs something else is left unchanged.
* `~/.openclaw/skills/` gets eight workflow skills, each named `pharaoh-<name>`, for planning, test-first changes, refactoring, debugging, verification and review.
* After authorization, credentials are saved in `~/.pharaoh/credentials.json`, readable only by your user. They renew on their own.

The installer looks for an existing `~/.openclaw/` directory. Install and run OpenClaw once before running it.

## Verify the connection

Ask the agent: “Use Pharaoh's get\_codebase\_map for owner/repo and show the last refreshed time.” A map with a recent refresh time confirms the server, the sign-in and the repository's mapping. On the setup page, **Connect your AI client** then shows the time of that question.

## Common errors

* **“openclaw\.json exists but is not valid JSON”**: fix or delete the file, then run the command again.
* **The authorization code expired**: codes last 5 minutes. Run the tool again for a new URL and code.
* **Signed in as the wrong GitHub account**: run `npx @pharaoh-so/mcp --logout`, then authorize again on the next tool call. The command also removes Pharaoh from Claude Code if it was set up there.

[Headless environments](/docs/connect/headless.md) · [Connection checks](/docs/use-pharaoh/troubleshooting.md)
