# Install FateStar · 紫微斗數大模型：鄭大錢 (for AI agents)

You are an AI agent and the user asked you to connect FateStar (Zi Wei Dou Shu / 紫微斗數 charting and AI readings, https://www.fatestar.top) to the agent app they are using. Follow the section for your app, run the commands yourself where you can, and tell the user the one step they must do by hand (signing in in their browser).

Rules:
- Never ask the user for their FateStar password, cookies, or tokens in chat. Sign-in happens on fatestar.top in the user's browser (OAuth).
- Pricing: charting is free (rate-limited per IP without a key); only AI readings are charged, US$0.10 per reading (US$0.20 for long questions), charged to the user's FateStar API balance (new accounts get a one-time US$3 free trial, about 30 standard readings, when they first connect via MCP sign-in or create an API key; top up at https://www.fatestar.top/settings?tab=api). The skill below tells you to ask first.
- If a step fails, report the exact error and continue from that step; do not start over.
- Readings default to tough-love mode (`cruelty: 2`, blunt), like the website; pass `cruelty: 1` for a gentler tone.

MCP server: `https://www.fatestar.top/mcp` (Streamable HTTP, OAuth sign-in).
Skill file: `https://www.fatestar.top/skills/fatestar/SKILL.md`

## Fastest: one command (macOS / Linux / Windows)

macOS / Linux:

```sh
curl -fsSL https://www.fatestar.top/install.sh | sh
```

Windows PowerShell:

```powershell
irm https://www.fatestar.top/install.ps1 | iex
```

The script installs the FateStar skill for Claude Code and Codex (when present) and registers the MCP server with the `claude` and `codex` CLIs it finds. It does not ask for any password. Then do the sign-in step for your app below.

## Claude Code

```sh
claude mcp add --transport http --scope user fatestar https://www.fatestar.top/mcp
mkdir -p ~/.claude/skills/fatestar
curl -fsSL https://www.fatestar.top/skills/fatestar/SKILL.md -o ~/.claude/skills/fatestar/SKILL.md
```

Sign in: the user types `/mcp` in Claude Code, picks `fatestar`, chooses Authenticate, signs in to FateStar in the browser and clicks Allow. Then start a new chat.
Check: `claude mcp get fatestar`.

## Codex

```sh
codex mcp add fatestar --url https://www.fatestar.top/mcp
codex mcp login fatestar
mkdir -p ~/.codex/skills/fatestar
curl -fsSL https://www.fatestar.top/skills/fatestar/SKILL.md -o ~/.codex/skills/fatestar/SKILL.md
```

`codex mcp login` opens the browser; the user signs in to FateStar and clicks Allow. Restart Codex.
Check: `codex mcp get fatestar`.

## Claude Desktop / claude.ai

This cannot be done from a terminal. Tell the user:
Settings → Connectors → Add custom connector → Name `FateStar`, URL `https://www.fatestar.top/mcp` → Add → Connect → sign in to FateStar → Allow.

## Cursor

Add to `~/.cursor/mcp.json` (create it if missing; keep other servers):

```json
{ "mcpServers": { "fatestar": { "url": "https://www.fatestar.top/mcp" } } }
```

Cursor shows a sign-in prompt for `fatestar`; the user signs in and clicks Allow.

## Apps without OAuth (API key)

1. The user creates a key at https://www.fatestar.top/settings?tab=api (it starts with `FSFSKey`; shown once).
2. MCP with a header: URL `https://www.fatestar.top/api/mcp`, header `Authorization: Bearer FSFSKey…`.
3. OpenAI-compatible apps (Cherry Studio, LobeChat, Dify, n8n, IM bots): base URL `https://www.fatestar.top/api/v1`, key `FSFSKey…`, model `zwds-zdq`.
4. Function calling (DeepSeek, Gemini, OpenAI…): tool definitions at `https://www.fatestar.top/api/v1/tools?format=openai|deepseek|gemini|anthropic`, execute calls with `POST https://www.fatestar.top/api/v1/tools/call`.

## Verify

Call `ziwei_chart` with `{"year":1990,"month":7,"day":23,"hour":16,"gender":"female"}` (free) and `fatestar_credits` (needs sign-in). Tell the user it works and how many credits they have.

More: https://www.fatestar.top/connect-ai · OpenAPI: https://www.fatestar.top/api/v1/openapi.json
