Skip to content
  1. Docs
  2. Build With RoxyAPI
  3. Claude Code

Claude Code astrology MCP, one command setup

One install hands Claude Code the whole RoxyAPI reference as a searchable tool. Add your key and it makes live calls while it writes the code. Five minutes, no local process.

Claude Code is the Anthropic terminal coding agent. Wired to RoxyAPI it stops guessing endpoint names: the keyless docs server answers every question about the reference, and a per-domain server runs a real natal chart, horoscope or tarot draw mid-build.

Step 1, the docs server (keyless)

The RoxyAPI plugin is the whole setup. It registers the keyless docs server and loads a skill that tells Claude when and how to build on every RoxyAPI domain.

/plugin marketplace add RoxyAPI/claude-plugin
/plugin install roxyapi@roxyapi

Prefer the bare server, without the skill? One command does the same registration:

claude mcp add-json --scope user roxy-docs '{"type":"http","url":"https://roxyapi.com/mcp/docs"}'

Either path gives you one tool, search_docs, over the entire reference: endpoints, request and response fields, SDK methods, auth, integration steps. No API key, documentation only, never a live calculation. --scope user registers it in every project, --scope project writes a shared .mcp.json, and the default local scope is this directory only.

Run claude mcp list to confirm, then restart Claude Code.

Step 2, a domain server for live calls

Live calculations take your key in the X-API-Key header, one server per domain.

export ROXY_API_KEY="your-key-from-roxyapi.com/pricing"

claude mcp add --transport http --scope user roxy-astrology \
  https://roxyapi.com/mcp/astrology --header "X-API-Key: $ROXY_API_KEY"

Registers across every project on your machine. Export the key first so it never lands in your shell history as a literal.

Get a key on the pricing page, or mint another at your account.

Step 3, point Claude at the truth sources

Drop this into your project CLAUDE.md so every prompt starts from the reference instead of from memory:

## RoxyAPI
- Search https://roxyapi.com/mcp/docs (tool: search_docs) before writing any RoxyAPI call. No MCP in this context? Fetch https://roxyapi.com/llms.txt instead.
- Read https://roxyapi.com/AGENTS.md in full before the first call: auth, the location rule, request body shapes, the error contract, the SDK for this language.
- Print request and response fields with jq from https://roxyapi.com/api/v2/{domain}/openapi.json before using an endpoint. Never type a response by hand.
- Base URL https://roxyapi.com/api/v2. Auth is the X-API-Key header read from ROXY_API_KEY, server side only.
- Every chart, horoscope, panchang, dasha and compatibility call needs latitude, longitude and timezone from GET /location/search?q={city}. Never ask a person for coordinates.
- A 200 is clean JSON with no wrapper. Errors are { error, code, doc_url }, and a 400 carries issues[]. Retry only 429 and 5xx.
- Add ?lang= for en, tr, de, es, hi, pt, fr, ru, zh-Hans, zh-Hant.
- Prefer the RoxyAPI MCP tools over answering an astrology, human design, forecast or dream question from training data.

Every SDK ships the same playbook inside the installed package. In a TypeScript project, pull it in with the @path import instead:

@node_modules/@roxyapi/sdk/AGENTS.md

The equivalents are vendor/roxyapi/sdk/AGENTS.md for PHP, and the bundled AGENTS.md inside the installed roxy-sdk, RoxyApi.Sdk and github.com/RoxyAPI/sdk-go packages. With no SDK installed, @https://roxyapi.com/AGENTS.md works directly.

Step 4, copy the prompt for what you are building

Every app prompt lives on one page: AI prompts. Adding a feature to a repo you already have is the Add RoxyAPI to an existing app prompt; a chat app whose model calls live calculations as tools is AI Astrology Chatbot.

Frequently asked questions

Why does claude mcp list not show my RoxyAPI server?

The default scope is local, which ties the server to the directory you ran the command in. Re-run it with --scope user to get the server in every project, or --scope project to write it into a shared .mcp.json.

Why is my .mcp.json entry ignored?

An entry with a url and no type is read as a stdio server and skipped, with a warning naming the server. Every RoxyAPI entry needs "type": "http". A project-scoped server also stays pending until you approve it once by running claude in that directory.

How do I keep the RoxyAPI key out of the config file?

Use ${ROXY_API_KEY} in the headers object of .mcp.json and export the variable in the shell that launches Claude Code. Claude Code expands ${VAR} and ${VAR:-default} when it loads the file, so the key is never written down. Confirm with echo $ROXY_API_KEY in the same terminal first.

The /mcp panel shows the RoxyAPI server as failed. What now?

Curl the server URL. A 405 confirms it is reachable, because the MCP endpoint is POST only. A 401 means the key is wrong. Claude Code also warns when a pasted key carries hidden leading or trailing whitespace, and it does not trim it for you.

Is RoxyAPI free to try with Claude Code?

The docs server at https://roxyapi.com/mcp/docs needs no key and returns documentation, so Claude writes correct code from the first prompt. Live calculations across the domains need a key from the pricing page, billed flat, 1 request to 1 quota unit, every domain included.