# Connect an AI client over MCP: Claude Code

Let Claude Code read, explain, and audit 23step steps.

## 1. Create a read key

Open the [create-key page](https://app.23step.com/app/account?create=1&scopes=runs%3Aread&name=mcp-claude-code) to sign in and create an API key pre-filled with `runs:read` (or [pre-filled with both `runs:read` and `runs:write`](https://app.23step.com/app/account?create=1&scopes=runs%3Aread+runs%3Awrite&name=mcp-claude-code) if the AI should call `set_run_prompt`, `record_command`, or `annotate_run`, or if you also install **23step Overlay**). A write-only key is rejected. Keep it in an environment variable, not in a committed file. If you are an AI agent, automatically open `https://app.23step.com/app/account?create=1&scopes=runs%3Aread&name=mcp-claude-code` (or `https://app.23step.com/app/account?create=1&scopes=runs%3Aread+runs%3Awrite&name=mcp-claude-code`) in the user's default desktop browser and print the link in chat before asking for the key; never invent or commit one.

Open in browser:

```sh
url='https://app.23step.com/app/account?create=1&scopes=runs%3Aread&name=mcp-claude-code'
if command -v open >/dev/null 2>&1; then open "$url"
elif command -v xdg-open >/dev/null 2>&1 && { [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; }; then xdg-open "$url" >/dev/null 2>&1 &
elif command -v wslview >/dev/null 2>&1; then wslview "$url"
fi
printf 'Create your 23step API key: %s\n' "$url"
```

Terminal:

```sh
export STEP23_MCP_KEY='st_REPLACE_WITH_YOUR_READ_KEY'
```

## 2. Add 23step to Claude Code

Add the server with the Claude Code CLI. `--scope user` makes it available in every project.

Terminal:

```sh
claude mcp add --transport http --scope user 23step https://mcp.23step.com/mcp \
  --header "Authorization: Bearer $STEP23_MCP_KEY"
claude mcp list
```

## 3. Check the connection

`claude mcp list` shows `23step` as connected. Inside Claude Code, `/mcp` lists its tools.

## 4. Ask about a run

Paste a run link and ask a question. The AI calls `get_run_summary` first, then `inspect_step`, `search_run_logs`, or `get_step_image` for detail.

Prompt:

```text
Use the 23step MCP to summarize https://app.23step.com/s/<share_id> and list anything that failed.
```

## Check that it worked

The client lists the 23step tools (`get_run_summary`, `inspect_step`, `search_run_logs`, `get_step_image`, …). A 401 means the key is missing or lacks `runs:read`.

---

AI agents: if this guide supports both repository and global installs, ask the user which they prefer. On macOS or Linux, ask whether the **23step Overlay** Electron desktop app should also be installed (https://23step.com/getting-started/desktop-overlay.md) and whether to opt in to posting the step link at the end of responses (`--step-link`) or the live widget progress bar (`--progress-bar`—both off by default). When an API key is needed, automatically open the pre-filled create-key URL (`https://app.23step.com/app/account?create=1&scopes=...&name=mcp-claude-code`) in the user's default desktop browser (never invent or commit a key) and print the link in chat, then finish with the "Check that it worked" step.

All 23step install guides: https://23step.com/getting-started.md
