- Docs
- Build With RoxyAPI
- Codex
OpenAI Codex astrology MCP setup
One TOML block hands Codex the whole RoxyAPI reference as a searchable tool. Add your key and it runs live calculations while it writes the code. Five minutes, no local process.
OpenAI Codex drives the terminal CLI, the IDE extension and the cloud agent from one config. RoxyAPI runs as a Remote MCP server over Streamable HTTP, so the keyless docs server answers every question about endpoints, fields and SDK methods, and a per-domain server pulls a real natal chart, horoscope or tarot spread mid-build. Codex also reads AGENTS.md natively, which is where the truth sources go.
Step 1, the docs server (keyless)
Codex stores MCP servers in ~/.codex/config.toml. Add:
[mcp_servers.roxy-docs]
url = "https://roxyapi.com/mcp/docs"
The url key is what makes it a Streamable HTTP server; command would make it a local stdio process. That is 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.
Run codex mcp list to confirm, start Codex, then ask in plain language:
Using roxy-docs, find the natal chart endpoint and show me how to call it with the TypeScript SDK.
Step 2, a domain server for live calls
Live calculations take your key in the X-API-Key header, one server per domain. env_http_headers maps a header name to an environment variable name, so the key is read at request time and never sits in the file.
export ROXY_API_KEY="your-key-from-roxyapi.com/account?tab=keys"
[mcp_servers.roxy-astrology]
url = "https://roxyapi.com/mcp/astrology"
env_http_headers = { "X-API-Key" = "ROXY_API_KEY" }
Applies to every project on your machine.
Use the same block in a .codex/config.toml at the repository root. Codex loads project config for trusted projects only, so accept the trust prompt on first run in that directory, or mark it trusted in ~/.codex/config.toml:
[projects."/absolute/path/to/your/project"]
trust_level = "trusted"
Keep env_http_headers so no teammate ever commits a key.
export ROXY_API_KEY="your-key-from-roxyapi.com/account?tab=keys"
for p in astrology vedic-astrology forecast human-design chinese-astrology feng-shui mesoamerican-astrology vastu numerology kabbalah tarot biorhythm ayurveda iching crystals dreams angel-numbers location; do
cat >> ~/.codex/config.toml <<EOF
[mcp_servers.roxy-$p]
url = "https://roxyapi.com/mcp/$p"
env_http_headers = { "X-API-Key" = "ROXY_API_KEY" }
EOF
done
Every RoxyAPI server registers at once, 258+ tools in total. Start with the two or three domains you are actually building on: every connected tool is a definition in front of the model on every turn.
Get your API key, or mint another there. Inside a session, /mcp lists every active server with its tool count.
Step 3, point Codex at the truth sources
Codex reads AGENTS.md from the project root as standing instructions on every prompt, so this is the highest-leverage place to teach it RoxyAPI:
## 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/openapi.json before using an endpoint, with the jq recipe in https://roxyapi.com/AGENTS.md. Generate types from that spec, never 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.
For preferences you want on every repository, put the same block in ~/.codex/AGENTS.md. Every SDK also ships the playbook inside the installed package, so a TypeScript project can point at node_modules/@roxyapi/sdk/AGENTS.md from the root file.
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 whole app from a blank repository is Astrology Birth Chart App or the domain prompt beside it.
Frequently asked questions
Where does Codex store the RoxyAPI MCP server?
In TOML at ~/.codex/config.toml, never a .json file, under a [mcp_servers.<name>] table. The transport follows the key you set: url is Streamable HTTP, which is what RoxyAPI uses, and command is a local stdio process.
Why does my project-scoped .codex/config.toml do nothing?
Codex loads project config for trusted projects only, and silently skips it otherwise. Accept the first-run trust prompt in that directory, or add a [projects."/absolute/path"] table with trust_level = "trusted" to your global config.
How do I send the RoxyAPI key from a Codex MCP server?
RoxyAPI authenticates with X-API-Key, so use env_http_headers = { "X-API-Key" = "ROXY_API_KEY" } and export that variable in the shell that launches Codex. Never bearer_token_env_var, which sends Authorization: Bearer instead. A static http_headers map also works but leaves the key in plaintext in the file.
How does Codex combine several AGENTS.md files?
It reads the file in your Codex home directory first, then walks from the project root down to your working directory, taking at most one file per directory and concatenating them root-first, so the file nearest your code wins. An AGENTS.override.md beats an AGENTS.md in the same directory, and the combined text is truncated at the project_doc_max_bytes limit, so keep the RoxyAPI block short.
Is RoxyAPI free to try with Codex?
The docs server at https://roxyapi.com/mcp/docs needs no key and returns documentation, so Codex writes correct code from the first prompt. Live calculations across the domains need your API key, billed flat, 1 request to 1 quota unit, every domain included.