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 分