# Claude Code

Connect the AstroWay API to **Claude Code** over MCP. No file editing — it's all one terminal command.

## Prerequisites

Get an API key in the [dashboard](https://api.astroway.info/dashboard/sign-up). For free testing use a sandbox `aw_test_*` key — it doesn't spend credits.

## Setup

Run one of the commands in your terminal, then **restart Claude Code**.

**Hosted (HTTP)** — zero install, Bearer-token auth:

<Code lang="bash" title="terminal" code={`claude mcp add --transport http astroway https://mcp.astroway.info/mcp \\
  --header "Authorization: Bearer aw_live_YOUR_KEY"`} />

**Stdio (npx)** — local subprocess, env-var auth, offline-ready:

<Code lang="bash" title="terminal" code={`claude mcp add astroway --env ASTROWAY_API_KEY=aw_live_YOUR_KEY -- npx -y @astroway/mcp`} />

## Verify

Tell Claude in chat: "List the AstroWay tools" — or ask it to call a free reference tool, such as fetching the list of zodiac signs. If a result comes back, the connection works.

## Troubleshooting

- **401 / invalid key** — make sure the key is prefixed `aw_live_*` or `aw_test_*` and isn't revoked. Check it in the [dashboard](https://api.astroway.info/dashboard/sign-up).
- **Tools don't appear** — fully restart Claude Code and confirm the server was added (`claude mcp list`).
- **`-32602` validation errors** (stdio) — update the package: `npm i @astroway/mcp@latest`. Schemas are regenerated from the live spec.

See all clients — [Agent setup](/en/agent-setup/).
