astro-mcp
astro-mcp
占星術MCPサーバー — LLMエージェント向けの高精度占星術ツール。
Swiss Ephemeris(pyswisseph)を基盤とする14のツールを実装し、あらゆるModel Context Protocolクライアント(Claude Desktopなど)と統合します。
Tools
# | Name | Description |
1 |
| 出生図全体:惑星、アングル、ハウス、アスペクト |
2 |
| 出生図へのトランジットアスペクト、月相、月の満ち欠け、ボイド・オブ・コース |
3 |
| 1日=1年のプログレッション+ソーラーアーク |
4 |
| 年次ソーラーリターン図 |
5 |
| 候補となる出生時刻をライフイベントと照合してスコアリング |
6 |
| 月次ルナリターン図 |
7 |
| クロスチャートアスペクト+ハウスオーバーレイ |
8 |
| ミッドポイントまたはデイビソン・コンポジット図 |
9 |
| 年次プロフェクション — 年主星と活性化ハウス |
10 |
| 任意の日付・場所における24の惑星時 |
11 |
| 12のアラビックパーツ/ロット(フォーチュン、スピリット、マリッジなど) |
12 |
| 日付範囲にわたる惑星位置表 |
13 |
| 特定のアスペクトの正確な日付を検索 |
14 |
| アンティスキアとコントラ・アンティスキアのポイント、オプションでトランジットのコンタクト付き |
Related MCP server: auseklis
Installation
# 1. Clone
git clone https://github.com/DrewCyber/astro-mcp
cd astro-mcp
# 2. Create virtual environment
python3.11 -m venv .venv
source .venv/bin/activate
# 3. Install package + dev dependencies
pip install -e ".[dev]"
# 4. Download Swiss Ephemeris data files
bash scripts/download_ephe.sh
# 5. Set environment variable
export EPHE_PATH="$(pwd)/ephe"
# 6. Run tests
pytest tests/Claude Desktop configuration
~/Library/Application Support/Claude/claude_desktop_config.json に追加します:
{
"mcpServers": {
"astro": {
"command": "/path/to/astro-mcp/.venv/bin/python",
"args": ["-m", "astro_mcp"],
"env": {
"EPHE_PATH": "/path/to/astro-mcp/ephe",
"GEOCODING_PROVIDER": "nominatim",
"GEOCODING_USER_AGENT": "astro-mcp/1.0",
"LOG_LEVEL": "WARNING"
}
}
}
}Environment Variables
Variable | Default | Description |
|
| Swiss Ephemeris |
|
|
|
| — |
|
|
| Nominatim ユーザーエージェント |
|
| ジオコーディング結果のLRUキャッシュサイズ |
|
| 再起動後も検索結果が保持される永続ジオコードキャッシュ。都市→緯度/経度/タイムゾーンのみを保存。空に設定すると無効 |
|
|
|
|
| グローバルオーブ倍率(0.1〜3.0) |
|
|
|
|
| Python ロギングレベル |
Architecture
src/astro_mcp/
├── server.py # MCP server — tool registration and dispatch
├── schemas.py # Pydantic input models (source of the JSON schemas)
├── config.py # Settings from environment variables
├── core/
│ ├── models.py # Data models and astrological constants
│ ├── errors.py # AstroError and the structured error codes
│ ├── ephemeris_provider.py # Swiss Ephemeris wrapper (pyswisseph)
│ ├── geocoding.py # City → lat/lon/tz (geopy + timezonefinder)
│ ├── moon.py # Lunar phase, lunations and void-of-course
│ └── formatters.py # LLM-optimized serialization
└── tools/
├── natal.py # Tool 1
├── transits.py # Tool 2
├── progressions.py # Tool 3
├── returns.py # Tools 4 + 6
├── rectification.py # Tool 5
├── synastry.py # Tools 7 + 8
├── profections.py # Tool 9
├── planetary_hours.py # Tool 10
├── arabic_parts.py # Tool 11
├── ephemeris.py # Tools 12 + 13
└── antiscia.py # Tool 14Output Format
すべてのツールは、LLMコンテキストトークンを最小限に抑えるため、空白なしのコンパクトなJSONを返します(冗長なJSONより約75%小さい)。惑星コードは省略形(Su、Mo、Meなど)、アスペクトは3文字コード(Cnj、Tri、Squ)、逆行フラグ("R":true)は順行時には省略され、追加トークンを節約します。
失敗も同じ契約を使用するため、クライアントは散文を解析する必要がありません:
{"error":true,"code":"INPUT_ERROR","message":"Invalid arguments for 'calculate_natal_chart'.","hint":"birth_location.lat: Input should be less than or equal to 90"}Planet Codes
ツール全体でサポートされるコード:
Su太陽Mo月Me水星Ve金星Ma火星Ju木星Sa土星Ur天王星Ne海王星Pl冥王星ChカイロンLiブラックムーンリリス(平均遠地点)NNノースノード(デフォルトは真のノード、NODE_TYPE=meanの場合は平均ノード)SNサウスノード小惑星(
include_asteroidsがサポートされている場合):Ceケレス、Paパラス、Junジュノー、Vesベスタ
API Notes
get_ephemerisは単一のplanetまたは惑星のリストを受け入れます。get_ephemeris.stepは1h、2h、3h、6h、12h、1d、7d、30dをサポートします。get_ephemerisはtimezoneフィールドを返し、dtをoutput_tzでフォーマットします。find_aspect_exact_dates.modeは以下をサポートします:transit-to-transit:2つの移動天体用transit-to-natal:出生惑星/アングルへのトランジット用auto(デフォルト):birth_*の存在からモードを推測します
Testing
pytest tests/ -v --cov=src/astro_mcp --cov-report=term-missingゴールデンチャートの回帰テストはテストスイート(tests/test_audit_regressions.py)にインラインで存在し、Astro.com と Solar Fire に対して検証されています。
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Swiss Ephemeris for AI agents: exact natal charts, transits, synastry and birth-place resolution
Western natal charts, horoscopes, transits and synastry for AI agents, verified vs NASA JPL.
Real astrology for AI agents: cosmic weather, synastry, timing, astrocartography, and divination.
Vedic and Western astrology for AI agents: charts, dasha, matchmaking, panchanga, numerology, tarot.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceMulti-tradition astrology engine that computes real birth charts, transits, and synastry for AI agents via MCP tools.8-
- AlicenseAqualityCmaintenanceAstrology MCP server that computes natal charts, transits, synastry, progressions, returns, eclipses, retrogrades, and moon phases from a real ephemeris, enabling AI agents to provide accurate astrological calculations without hallucination.1261 npm1MIT
- AlicenseAqualityDmaintenanceCalculates astrological natal charts with high precision using Swiss Ephemeris, supporting multiple house systems and location inputs.218 npm5AGPL 3.0
- AlicenseAqualityAmaintenanceVedic and Western astrology for AI agents: 103 read-only tools for natal charts, dasha, kundali matching with Rajju and Vedha vetoes, panchanga, numerology and tarot, backed by Swiss Ephemeris and verified against NASA JPL Horizons.103MIT