Asterwise MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Astrology and divination calculations as MCP tools. **118 tools** covering Vedic and Western astrology, numerology, tarot, crystals, dreams, natal charts, Dasha, matchmaking and Panchanga, with interpretations that follow classical Jyotish method. Every position is verified against an independent Swiss Ephemeris run (asterwise.com/proof) and checked against NASA JPL Horizons, median 0.050 arcseconds over 80 positions (asterwise.com/accuracy). How it compares with seven other astrology APIs, sourced and dated: asterwise.com/compare.
Quick Start (2 minutes)
See it first: 46-second demo of Claude Desktop casting a chart through this server, and the independent Swiss Ephemeris cross-check.
Get your API key
Sign up free at asterwise.com/dashboard: 500 calls/month on the Sandbox tier. No credit card. No time limit.
Connect to Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Connect to Cursor
Add to .cursor/mcp.json in your project:
Test the connection
Authentication
Three methods supported:
**Method 1 — API Key (quick start)**
Pass your Asterwise API key (starts with aw_) either as Authorization: Bearer or as an X-API-Key: header. Both are equivalent; use whichever your MCP client can set.
**Method 2 — OAuth 2.1 (production)**
Exchange your API key for a short-lived token:
Returns: {"access_token": "...", "expires_in": 3600, ...}
Use the token: Authorization: Bearer
Access tokens are stateless HS256 JWTs. The API key is carried inside the token encrypted with a key derived from JWT_SECRET; only a SHA-256 hash of the key appears in the sub claim. Keep JWT_SECRET private.
**Method 3 — OAuth 2.1 authorization code for MCP clients (Claude, Cursor, VS Code, Smithery)**
MCP clients log a user in through the standard authorization-code flow with PKCE (S256). Discovery is at /.well-known/oauth-authorization-server. Two ways for a client to identify itself are supported:
- **Client ID Metadata Documents** (current MCP spec, preferred): use an HTTPS URL as client_id. The URL must serve a JSON document whose client_id equals the URL, with client_name, redirect_uris, and token_endpoint_auth_method: "none". These clients are public: no secret, PKCE only, authorization_code and refresh_token grants, refresh tokens rotate on every use. Redirect URIs must be https, or http on localhost / 127.0.0.1 / [::1] (port ignored, per RFC 8252). A reference document you can copy: .
- **Dynamic Client Registration** (POST /oauth/register, deprecated in the MCP spec but still supported): returns a client_id and client_secret; the secret is required at /oauth/token.
The server fetches metadata documents with SSRF protections (public addresses only, no redirects, 64 KB, 10 s) and caches them for the document's Cache-Control: max-age (60 s to 24 h, default 1 h). The consent page shows the host that published the document.
Run over stdio
For hosts that speak stdio instead of HTTP (Glama hosted builds, a local Claude Desktop entry, quick tests):
Over stdio the key comes from ASTERWISE_API_KEY; the server starts and lists its tools without one, and tool calls need it. Logs go to stderr.
Configuration
Copy .env.example to .env and set at least:
| Variable | Required | Description |
|----------|----------|-------------|