Skip to main content
Glama
DrewCyber

astro-mcp

by DrewCyber

astro-mcp

占星術MCPサーバー — LLMエージェント向けの高精度占星術ツール。

Swiss Ephemeris(pyswisseph)を基盤とする14のツールを実装し、あらゆるModel Context Protocolクライアント(Claude Desktopなど)と統合します。

Tools

#

Name

Description

1

calculate_natal_chart

出生図全体:惑星、アングル、ハウス、アスペクト

2

calculate_transits

出生図へのトランジットアスペクト、月相、月の満ち欠け、ボイド・オブ・コース

3

calculate_secondary_progressions

1日=1年のプログレッション+ソーラーアーク

4

calculate_solar_return

年次ソーラーリターン図

5

calculate_rectification_hints

候補となる出生時刻をライフイベントと照合してスコアリング

6

calculate_lunar_return

月次ルナリターン図

7

calculate_synastry

クロスチャートアスペクト+ハウスオーバーレイ

8

calculate_composite_chart

ミッドポイントまたはデイビソン・コンポジット図

9

calculate_profections

年次プロフェクション — 年主星と活性化ハウス

10

get_planetary_hours

任意の日付・場所における24の惑星時

11

calculate_arabic_parts

12のアラビックパーツ/ロット(フォーチュン、スピリット、マリッジなど)

12

get_ephemeris

日付範囲にわたる惑星位置表

13

find_aspect_exact_dates

特定のアスペクトの正確な日付を検索

14

calculate_antiscia

アンティスキアとコントラ・アンティスキアのポイント、オプションでトランジットのコンタクト付き

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

EPHE_PATH

./ephe

Swiss Ephemeris .se1 データファイルへのパス

GEOCODING_PROVIDER

nominatim

nominatim または opencage

OPENCAGE_API_KEY

—

GEOCODING_PROVIDER=opencage の場合に必要

GEOCODING_USER_AGENT

astro-mcp/1.0

Nominatim ユーザーエージェント

GEOCODE_CACHE_SIZE

512

ジオコーディング結果のLRUキャッシュサイズ

GEOCODE_CACHE_PATH

~/.cache/astro-mcp/geocode.json

再起動後も検索結果が保持される永続ジオコードキャッシュ。都市→緯度/経度/タイムゾーンのみを保存。空に設定すると無効

DEFAULT_HOUSE_SYSTEM

P

P=プラシーダス、W=ホールサイン、K=コッホ

DEFAULT_ORB_FACTOR

1.0

グローバルオーブ倍率(0.1〜3.0)

NODE_TYPE

true

true=真のノード、mean=平均ノード(全ツールで一貫して適用)

LOG_LEVEL

WARNING

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 14

Output 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

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Multi-tradition astrology engine that computes real birth charts, transits, and synastry for AI agents via MCP tools.
    10
    -
  • A
    license
    A
    quality
    C
    maintenance
    Astrology 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.
    12
    61 npm
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Calculates astrological natal charts with high precision using Swiss Ephemeris, supporting multiple house systems and location inputs.
    2
    18 npm
    5
    AGPL 3.0
  • A
    license
    A
    quality
    A
    maintenance
    Vedic 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.
    103
    MIT