astromock-mcp
by Anshiika123
README.md
# astromock-mcp
A standalone [MCP](https://modelcontextprotocol.io) server that exposes Vedic
astrology calculations as reusable tools. Any MCP client — Claude Desktop, a
chatbot, the ASTRO-MOCK web app, or future projects — can consume these tools.
Calculations use the **sidereal zodiac** with **Lahiri ayanamsha**,
**Whole Sign houses** and **mean lunar nodes**, powered by the Swiss Ephemeris
(`pyswisseph`, built-in Moshier ephemeris — no extra data files needed).
## Available tools
### `calculate_kundali`
Calculates the D-1 (Rashi) birth chart. Returns the ascendant (lagna) and all
nine grahas (Sun, Moon, Mars, Mercury, Jupiter, Venus, Saturn, Rahu, Ketu)
with sign, degree, nakshatra, pada, Whole Sign house and retrograde status.
### `calculate_navamsa`
Calculates the D-9 (Navamsa) divisional chart. Returns each planet's navamsa
sign and house from the navamsa lagna.
### `calculate_dasha`
Vimshottari Dasha timeline: Mahadashas covering 120 years from birth with
calendar dates, the birth-time balance, and the current Mahadasha's full
Antardasha breakdown (active one included). Optional `as_of` (YYYY-MM-DD)
overrides "today". Use for any timing question.
### `get_current_transits`
Gochar: sidereal transit signs of all 9 grahas for today (or optional
`target_date`). Pass the optional `moon_sign` (the `rashi.sign` from
`calculate_kundali`) to also get each planet's house counted from the Moon
and the `sade_sati_status` flag (Saturn in 12th/1st/2nd from the Moon).
### `get_question_context`
One-shot context for a life-area question (English or Hinglish): routes the
question to its Vedic houses (career/naukri → 10, marriage/shaadi → 7,
wealth/paisa → 2+11, health/sehat → 1+6, education/padhai → 4+5,
children/santan → 5, family/parivar → 4+9, personality/swabhav → 1),
analyzes each house in the native's chart (sign, occupant planets, house
lord, lord's placement) and retrieves the most relevant BPHS passages (with
page numbers) from the bundled index (`data/book_index.json`). Takes the
birth-data fields plus `question`.
### `generate_horoscope`
Everything needed to write a transit-based horoscope for a natal Moon sign,
for one of three timeframes: `today` (Moon + Sun aspect, ~100 words),
`2weeks` (Sun/Mercury/Venus with upcoming sign changes, ~200 words),
`6months` (Jupiter/Saturn/Rahu/Ketu with Sade Sati, ~300 words). Returns
the filtered transit facts, relevant BPHS passages, and a ready-to-use
`system_prompt` + `suggested_prompt`. **The server does not call an LLM** —
the client writes the horoscope text: Claude Desktop's model follows the
returned prompts directly; the ASTRO-MOCK Flask app passes them to its own
`llm_provider`. Only `moon_sign` and `timeframe` are required; `transit_data`
and `sade_sati_status` are computed automatically when omitted.
## Prompt
### `vedic-interpretation`
The interpretation ruleset (never invent placements, cite reasoning,
non-deterministic language, structured Summary/Factors/Interpretation/
References/Confidence format). Attach it in the client, then answer
questions using the tool outputs.
**Typical flow for "kya mera career acha hoga":**
1. `calculate_kundali` → lagna, rashi, placements
2. `get_question_context` (same birth data + question) → houses, analysis, BPHS refs
3. `calculate_dasha` → current Mahadasha/Antardasha
4. `get_current_transits` with `moon_sign` → Gochar + Sade Sati
5. Interpret per the `vedic-interpretation` prompt.
**Inputs (both tools):**
| Parameter | Type | Example |
|-----------------|--------|------------------|
| `date_of_birth` | string | `"1995-08-21"` |
| `time_of_birth` | string | `"14:35"` |
| `latitude` | number | `28.6139` |
| `longitude` | number | `77.2090` |
| `timezone_str` | string | `"Asia/Kolkata"` |
| `unknown_time` | boolean (optional, default `false`) | `true` if birth time is uncertain — ascendant and houses are then omitted |
## Setup
```powershell
python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
```
## Running the server
The server speaks MCP over **stdio** (an HTTP transport is planned later):
```powershell
.venv\Scripts\python server.py
```
It will sit waiting for an MCP client on stdin/stdout — that's normal; it is
not meant to be used directly from the terminal.
### Use with Claude Desktop
Add to your `claude_desktop_config.json`
(`%APPDATA%\Claude\claude_desktop_config.json` on Windows):
```json
{
"mcpServers": {
"astromock": {
"command": "C:\\Users\\anshi\\Downloads\\astromock-mcp\\.venv\\Scripts\\python.exe",
"args": ["C:\\Users\\anshi\\Downloads\\astromock-mcp\\server.py"]
}
}
}
```
Restart Claude Desktop; the `calculate_kundali` and `calculate_navamsa`
tools will appear.
### Verify with the MCP Inspector
```powershell
npx @modelcontextprotocol/inspector .venv\Scripts\python.exe server.py
```
This opens a web UI where you can list the tools and invoke them with test
inputs.
### Verify with the bundled test client
```powershell
.venv\Scripts\python test_client.py
```
Spawns the server over stdio, lists registered tools, and calls
`calculate_kundali` with sample birth data.
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues