XHelio-SPICE

io.github.huangzesen由 GitHub 帳號 huangzesen 發布v0.5.1更新於 Oct 24, 2026

Spacecraft ephemeris made easy — auto-managed SPICE kernels for heliophysics

已驗證STDIO僅桌面資料與分析AI 與機器學習

概覽

AI 產生的概覽

一個本機 MCP 伺服器,為助理提供太空船星曆工具,自動下載並快取用於太陽物理任務的 NAIF SPICE 核心。

可以做什麼
計算單一時間點或 CSV 時間序列形式的太空船位置與速度,以及兩個天體之間的距離,所用 SPICE 核心會視需要下載並快取在本機。在 J2000、ECLIPJ2000、GSE、RTN 等座標系之間轉換向量。列出支援的太空船任務與可用座標系及其說明。管理核心快取,包括確保任務核心已下載並載入,以及釋放記憶體。
適用情境
適合處理太陽物理或行星探測任務軌跡時使用,例如帕克太陽探測器、太陽軌道器、STEREO-A、朱諾號、航海家號、新視野號等,讓助理直接回答位置、距離或座標轉換問題,而不必手動設定 SPICE。
執行需求
以本機 Python 程序執行;需安裝含 MCP 附加元件的套件,並啟動 xhelio-spice-mcp 指令(或模組進入點)。首次使用需連網從 NAIF 下載核心,核心快取於 ~/.xhelio_spice/kernels/,可用 XHELIO_SPICE_KERNEL_DIR 覆寫。未宣告需要身分驗證。
安裝前請注意
伺服器會透過網路從 NAIF 下載核心檔案並寫入本機快取目錄,查詢的任務越多佔用磁碟越多。只有部分任務支援自動下載核心,其他任務僅提供 NAIF ID 或需要尚未支援的多段核心載入,因此這些任務可能無法傳回結果。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 XHelio-SPICE,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

xhelio-spice

Spacecraft ephemeris made easy — auto-managed SPICE kernels for heliophysics missions.

xhelio-spice wraps SpiceyPy with automatic kernel download, caching, and loading. Ask for a spacecraft position and xhelio-spice handles the rest: downloading the right NAIF kernels, loading them in the correct order, and returning results as Python dicts or pandas DataFrames.

Installation

bash
pip install xhelio-spice

For MCP server support (Claude Desktop, Claude Code, Cursor, etc.):

bash
pip install xhelio-spice[mcp]

Quick Start

python
from xhelio_spice import get_position, get_trajectory
# Where is Parker Solar Probe right now?pos = get_position("PSP", observer="SUN", time="2024-01-15", frame="ECLIPJ2000")print(f"PSP is {pos['r_au']:.3f} AU from the Sun")
# Get a month of trajectory data as a DataFramedf = get_trajectory(    "PSP", observer="SUN",    time_start="2024-01-01", time_end="2024-01-31",    step="1h", frame="ECLIPJ2000",)print(df[["r_au"]].describe())

Kernels are automatically downloaded from NAIF on first use and cached in ~/.xhelio_spice/kernels/.

Supported Missions

With SPICE Kernels (auto-downloaded)

  • PSP (Parker Solar Probe) — 2018-2030
  • Solar Orbiter (SOLO) — 2020-2030
  • STEREO-A — 2017-2031
  • Juno — 2011-present (updated regularly)
  • Voyager 1/2 — 1981-2100 / 1989-2100
  • New Horizons — 2019-2030

NAIF IDs Only (no auto-download yet)

  • ACE, Wind, DSCOVR, MMS (1-4) — no public SPK kernels exist
  • Cassini, MAVEN — require multi-segment kernel loading (planned)
  • Galileo, Pioneer 10/11, Ulysses, MESSENGER, STEREO-B

Natural Bodies

Sun, Earth, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto

API Reference

Position & Trajectory

python
from xhelio_spice import get_position, get_trajectory, get_state
# Single positionpos = get_position("ACE", observer="EARTH", time="2024-06-01", frame="GSE")
# Full state (position + velocity)state = get_state("PSP", observer="SUN", time="2024-01-15", frame="ECLIPJ2000")
# Trajectory timeseries (returns pandas DataFrame)df = get_trajectory(    "Cassini", observer="SATURN",    time_start="2010-01-01", time_end="2010-12-31",    step="6h", frame="ECLIPJ2000",    include_velocity=True,)

Coordinate Transforms

python
from xhelio_spice import transform_vector, list_available_frames
# J2000 to Eclipticv_ecl = transform_vector([1.0, 0.0, 0.0], "2024-01-15", "J2000", "ECLIPJ2000")
# RTN transform (requires spacecraft)v_rtn = transform_vector(    [5.0, -3.0, 1.0], "2024-01-15",    from_frame="ECLIPJ2000", to_frame="RTN",    spacecraft="PSP",)
# List all framesprint(list_available_frames())

Mission Registry

python
from xhelio_spice import resolve_mission, list_supported_missions
# Resolve name aliasesnaif_id, key = resolve_mission("Parker Solar Probe")  # -> (-96, "PSP")
# List all spacecraftmissions = list_supported_missions()

Kernel Management

python
from xhelio_spice import get_kernel_manager
km = get_kernel_manager()km.ensure_mission_kernels("PSP")  # Download + loadprint(km.get_cache_info())        # Cache statskm.unload_all()                    # Free memory

Configuration

MethodDescription
XHELIO_SPICE_KERNEL_DIR env varOverride kernel cache directory
KernelManager(kernel_dir=...)Per-instance override
Default~/.xhelio_spice/kernels/

MCP Server

xhelio-spice includes an MCP server for LLM tool use:

bash
# Run directlyxhelio-spice-mcp
# Or via Pythonpython -m xhelio_spice.server

Claude Desktop Configuration

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "xhelio-spice": {      "command": "xhelio-spice-mcp"    }  }}

Available MCP Tools

ToolDescription
get_ephemerisPosition/velocity — single time (inline) or timeseries (CSV)
compute_distanceDistance between two bodies
transform_coordinatesCoordinate frame transform
list_spice_missionsSupported missions
list_coordinate_framesAvailable frames with descriptions
manage_kernelsKernel cache management

MCP smoke test

For a CI-safe MCP check that does not request kernel downloads, run:

bash
uv run --extra mcp python scripts/smoke_mcp_list_tools.py --json

The smoke starts the stdio server with an isolated temporary kernel cache, runs MCP initialize + list_tools, and verifies the advertised tool names.

License

MIT

來源:README.md,提交 9aeb318

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.5.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分