npm saju-mcpstdioupdated 2mo ago
An MCP (Model Context Protocol) server that wraps the Saju API β Korean Four Pillars of Destiny (μ¬μ£Όνμ / BaZi / ε «ε) β so any MCP-capable AI client (Claude Desktop, Cursor, VS Code, Windsurf, and custom agents) can compute, interpret, and compare Korean Saju charts directly in a conversation.
What can you do with saju mcp?
Saju MCP β Korean Four Pillars & BaZi Astrology
An MCP (Model Context Protocol) server that wraps the Saju API β Korean Four Pillars of Destiny (μ¬μ£Όνμ / BaZi / ε «ε) β so any MCP-capable AI client (Claude Desktop, Cursor, VS Code, Windsurf, and custom agents) can compute, interpret, and compare Korean Saju charts directly in a conversation.
SAJU_API_KEY="sajuapi_free_xxx" npx saju-mcp
30-second path: get a free key β add the config β ask your AI client "calculate the saju for someone born 1990-05-15 14:00, male."
Why this MCP?
- The only production-grade Korean Saju engine available as an MCP server.
- KASI-validated lunar conversion (47,000+ days cross-checked, zero failures).
- Ten Gods (εη₯) + Yongshin (η¨η₯) + Daeun (ε€§ι) β interpretive features absent from generic Western astrology APIs that only return sun/moon signs.
- 10 output languages: Korean, English, Japanese, Chinese, Spanish, Portuguese, Vietnamese, Indonesian, Hindi, Thai.
- Free tier: 100 requests/day, no credit card. Freemium β start building today and upgrade only when your app needs production volume.
Backed by the live API at https://saju-api.pages.dev.
What it looks like in practice
Ask your AI client a natural-language question; it calls saju_calculate and gets
back structured data it can reason over. This is a real, unedited response from
the live API for { year: 1990, month: 5, day: 15, hour: 14, gender: "M", lang: "en" }:
{
"pillars": {
"year": { "stem": "κ²½", "branch": "μ€", "stem_hanja": "εΊ", "branch_hanja": "ε" },
"month": { "stem": "μ ", "branch": "μ¬", "stem_hanja": "θΎ", "branch_hanja": "ε·³" },
"day": { "stem": "κ²½", "branch": "μ§", "stem_hanja": "εΊ", "branch_hanja": "θΎ°" },
"hour": { "stem": "κ³", "branch": "λ―Έ", "stem_hanja": "ηΈ", "branch_hanja": "ζͺ" }
},
"elements": { "wood": 0, "fire": 2, "earth": 2, "metal": 3, "water": 1 },
"day_master": { "stem": "κ²½", "element": "metal", "polarity": "yang" },
"zodiac": "horse",
"tier": "free",
"remaining": 99
}
Every response is returned to the model as both human-readable text and
structuredContent, so agents can branch on day_master.element, elements, a
compatibility score, etc. without re-parsing prose.
Tools
| Tool | Upstream endpoint | What it does |
|---|---|---|
saju_calculate |
POST /api/v1/calculate |
Four Pillars (stem+branch+hanja), five-element distribution, Day Master, zodiac, from a solar birthdate. |
saju_interpret |
POST /api/v1/interpret |
Full reading: Ten Gods (μμ ), hidden stems, Yongshin (μ©μ ), Daeun (λμ΄), localized summaries. |
saju_compatibility |
POST /api/v1/compatibility |
Two-person κΆν© score (0β100) with breakdown (element balance, Day Master relation, branch harmony/clash). |
saju_daily |
GET /api/v1/daily |
Daily fortune snapshot (score + advice) for a Day Master and date. |
Quickstart
1. Get a free API key (no card)
The free tier is 100 requests/day, no credit card:
curl -X POST https://saju-api.pages.dev/api/v1/keys/create \
-H "Content-Type: application/json" \
-d '{"email":"dev@yourcompany.com"}'
The response contains an api_key of the form sajuapi_free_...:
{
"api_key": "sajuapi_free_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"tier": "free",
"daily_limit": 100,
"rps": 1,
"monthly_price_usd": 0,
"note": "Store this key safely β it is shown only once. Send with header `X-API-Key: <key>`."
}
The key is shown only once β store it now. It is passed to the server via the
SAJU_API_KEYenvironment variable, never hardcoded. (Disposable /example.comemail domains are rejected β use a real address.)
2. (Optional) Smoke-test without an MCP client
npx runs the server straight from npm β no clone, no local build:
SAJU_API_KEY="sajuapi_free_xxx" npx -y saju-mcp
It speaks MCP over stdio and exposes the four saju_* tools. Press Ctrl-C to exit.
3. Register in your MCP client
The server is stdio-based, so every MCP client uses the same three pieces:
command: npx, args: ["-y", "saju-mcp"], and an env with your SAJU_API_KEY.
Edit your config file, then restart Claude Desktop:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"saju": {
"command": "npx",
"args": ["-y", "saju-mcp"],
"env": { "SAJU_API_KEY": "sajuapi_free_your_key_here" }
}
}
}
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project), then
reload:
{
"mcpServers": {
"saju": {
"command": "npx",
"args": ["-y", "saju-mcp"],
"env": { "SAJU_API_KEY": "sajuapi_free_your_key_here" }
}
}
}
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"saju": {
"command": "npx",
"args": ["-y", "saju-mcp"],
"env": { "SAJU_API_KEY": "sajuapi_free_your_key_here" }
}
}
}
Add to ~/.codeium/windsurf/mcp_config.json, then refresh MCP servers:
{
"mcpServers": {
"saju": {
"command": "npx",
"args": ["-y", "saju-mcp"],
"env": { "SAJU_API_KEY": "sajuapi_free_your_key_here" }
}
}
}
Restart / reload your client. The four saju_* tools appear in its tool list.
Example tool inputs
saju_calculate / saju_interpret:
{ "year": 1990, "month": 5, "day": 15, "hour": 14, "gender": "M", "lang": "en" }
(hour: -1 if the birth hour is unknown.)
saju_compatibility:
{
"person_a": { "year": 1990, "month": 5, "day": 15, "hour": 14, "gender": "M" },
"person_b": { "year": 1992, "month": 8, "day": 3, "hour": 9, "gender": "F" },
"lang": "en"
}
saju_daily (Day Master from a prior calculate/interpret call):
{ "day_master": "κ°", "date": "2026-06-17", "lang": "en" }
Input bounds (validated server-side, mirrors the API): year 1920β2050,
month 1β12, day 1β31, hour -1β23, gender "M"|"F", lang one of the 10
supported codes (default ko).
Environment variables
| Variable | Required | Default | Notes |
|---|---|---|---|
SAJU_API_KEY |
yes (for real calls) | (empty) | Your sajuapi_* key, sent as the X-API-Key header. Without it, every call returns 401 invalid_api_key. |
SAJU_API_BASE |
no | https://saju-api.pages.dev |
Override the upstream base URL (e.g. a staging deploy). |
Errors & troubleshooting
When an upstream call fails, the tool returns an MCP error result (isError: true)
whose text is Saju API error <status>: <body> plus a hint. Common cases:
| Symptom | HTTP status | Cause | Fix |
|---|---|---|---|
401 invalid_api_key |
401 | SAJU_API_KEY is missing, mistyped, or revoked. |
Set the env var to a valid sajuapi_* key. Get a free one. |
429 (daily quota exceeded) |
429 | Free tier is 100 req/day, 1 rps. | Wait for the daily reset, or upgrade to a paid tier for production volume. |
invalid_input |
400 | A field is out of bounds (e.g. month: 13) or missing. |
Check the input bounds above; the reason field names the offending field. |
| Tools don't appear in the client | β | Client not restarted, or npx can't fetch the package. |
Restart the client; run npx -y saju-mcp once in a terminal to confirm it starts. |
non_json_response |
any | Upstream returned non-JSON (rare; network/proxy). | Retry; if persistent, check SAJU_API_BASE is correct. |
Keys never appear in tool output or logs. If a key leaks, mint a new one β the old one keeps its own quota and can be abandoned.
Develop / build from source
git clone https://github.com/ghdejr11-beep/saju-mcp.git
cd saju-mcp
npm install
npm run build # compiles src/index.ts -> dist/index.js
npm run typecheck # tsc --noEmit
Run the local build directly:
{
"mcpServers": {
"saju": {
"command": "node",
"args": ["/absolute/path/to/saju-mcp/dist/index.js"],
"env": { "SAJU_API_KEY": "sajuapi_free_your_key_here" }
}
}
}
Requires Node.js 18+ (uses the built-in global fetch).
Upgrading to production
The free tier (100 req/day, 1 rps) is for building and evaluation. When your app ships, higher-volume tiers are available on the same API β see https://saju-api.pages.dev for current plans and the key endpoint. Your code and config don't change; only the key does.
Related
- Korea Calendar API β Korean public holidays, lunarβsolar conversion, the gapja (κ°μ§) pillars and the 24 solar terms over REST. Pairs naturally with this server when you need the raw calendar facts behind a saju reading: https://korea-calendar-api.kunstudio.workers.dev
License
Proprietary β KunStudio. Wraps the Saju API; subject to that API's terms.
Install
Add saju mcp to your client. Pick the one you use.
claude mcp add saju-mcp -- npx -y saju-mcpcodex mcp add saju-mcp -- npx -y saju-mcpamp mcp add saju-mcp -- npx -y saju-mcp{
"mcpServers": {
"saju-mcp": {
"command": "npx",
"args": [
"-y",
"saju-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"saju-mcp": {
"command": "npx",
"args": [
"-y",
"saju-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"saju-mcp","command":"npx","args":["-y","saju-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"saju-mcp": {
"command": "npx",
"args": [
"-y",
"saju-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"saju-mcp": {
"command": "npx",
"args": [
"-y",
"saju-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"saju-mcp": {
"command": "npx",
"args": [
"-y",
"saju-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"saju-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"saju-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"saju-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"saju-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y saju-mcpRun `goose configure`, choose **Add Extension β Command-line Extension**, and paste this command.
4 tools
saju mcp exposes 4 tools to a connected agent.
- saju_calculate
- `POST /api/v1/calculate`
- saju_interpret
- `POST /api/v1/interpret`
- saju_compatibility
- `POST /api/v1/compatibility`
- saju_daily
- `GET /api/v1/daily`
Score
65 / 100
Good
- Documentation25/25
- Maintenance16/25
- Trust6/20
- Capability6/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 65 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 4 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint β no local install
Version history
| Versions | Published |
|---|---|
| 0.1.0Latest | Jun 17, 2026 |