Skip to main content
Glama

mcp-stargazing

计算地球上任何位置的天体(太阳、月球、行星、恒星和深空天体)的高度、升起和落下时间,并提供可选的光污染分析功能。

功能特性

  • 高度/方位角计算:获取任何天体的仰角和罗盘方位。

  • 升起/落下时间:确定天体何时出现在地平线上方或消失在地平线下方。

  • 光污染分析:加载并分析光污染地图(GeoTIFF 格式)。

  • 代码执行就绪:

    • 可序列化返回:所有工具均返回 JSON 可序列化数据(日期使用 ISO 字符串),便于 LLM 直接使用。

    • 分页支持:analysis_area 支持分页(page、page_size),以高效处理大型数据集。

    • 标准化响应:统一的响应格式 { "data": ..., "_meta": ... },以实现更好的可观测性和错误处理。

  • 性能:

    • 异步执行:非阻塞式天体计算。

    • 缓存:针对 Simbad 查询和区域分析的智能缓存。

    • 代理支持:原生支持 HTTP/HTTPS 代理(适用于下载天文数据)。

  • 时区感知:支持本地时间或 UTC 时间。

  • 数据驱动:内置 10,000 多个深空天体(梅西耶和 NGC 天体)数据库,用于智能推荐。

Related MCP server: chuk-mcp-celestial

安装

本项目使用 uv 进行依赖管理。

本地安装

  1. 安装 uv:

    pip install uv
  2. 同步依赖:

    uv sync

    这将在 .venv 中创建一个虚拟环境并安装 pyproject.toml 中定义的所有依赖项。

  3. 激活环境:

    source .venv/bin/activate
  4. 初始化数据(夜间规划器必需): 这将下载最新的梅西耶和 NGC 星表数据到 src/data/objects.json。

    python scripts/download_data.py

    注意:如果您位于防火墙后,请确保在运行此脚本前设置了 HTTP_PROXY 环境变量。

Docker 安装

您也可以使用 Docker 运行服务器,它会自动处理所有依赖项和数据初始化。

  1. 构建镜像:

    docker build -t mcp-stargazing .

    注意:如果您位于代理服务器后,请在构建时传入代理 URL:

    docker build --build-arg HTTP_PROXY=http://127.0.0.1:7890 -t mcp-stargazing .
  2. 运行容器:

    # Basic run (SHTTP mode on port 3001)
    docker run -p 3001:3001 mcp-stargazing
    
    # With Environment Variables
    docker run -p 3001:3001 \
      -e QWEATHER_API_KEY=your_key \
      -e STARGAZING_DB_CONFIG=your_db_config \
      mcp-stargazing

MCP 服务器使用

启动 MCP 服务器,向 AI 智能体或其他客户端公开工具。

1. 环境设置

创建 .env 文件或导出变量:

# Weather tools
# 推荐:使用你账号专属的 API Host(公共域名将从 2026 年起逐步停止服务)
export QWEATHER_API_HOST="abc1234xyz.def.qweatherapi.com"

# 鉴权(二选一)
# 1) API KEY(兼容旧用法)
export QWEATHER_API_KEY="your_api_key"
# 2) JWT(推荐,更安全)
# export QWEATHER_JWT_TOKEN="your_jwt_token"

# 如需临时兼容旧公共域名(不推荐),显式开启:
# export QWEATHER_ALLOW_PUBLIC_HOST=1

# Optional: Proxy for downloading astronomical data (Simbad/IERS)
# Highly recommended if you are in a restricted network environment
export HTTP_PROXY="http://127.0.0.1:7890"
export HTTPS_PROXY="http://127.0.0.1:7890"

2. 启动服务器

流式 HTTP (SHTTP) 模式(推荐大多数智能体使用):

# Basic start
python -m src.main --mode shttp --port 3001 --path /shttp

# With proxy explicitly passed (overrides env vars)
python -m src.main --mode shttp --port 3001 --path /shttp --proxy http://127.0.0.1:7890

SSE 模式:

python -m src.main --mode sse --port 3001 --path /sse

3. 响应格式

所有工具均以标准化的 JSON 格式返回数据:

{
  "data": {
    // Tool-specific return data
    "altitude": 45.5,
    "azimuth": 180.0
  },
  "_meta": {
    "version": "1.0.0",
    "status": "success"
  }
}

4. 可用工具

  • get_celestial_pos:计算高度/方位角。

  • get_celestial_rise_set:计算升起/落下时间(返回 ISO 字符串)。

  • get_moon_info:详细的月相、光照度和月龄信息。

  • get_visible_planets:列出当前在地平线上方的所有行星及其位置。

  • get_constellation:查找星座中心的位置(高度/方位角)。

  • get_nightly_forecast:智能规划器,返回今晚最佳观测天体列表(行星 + 深空天体)。

  • get_weather_by_name / get_weather_by_position:获取当前天气。

  • get_local_datetime_info:获取当前本地时间信息。

  • analysis_area:查找区域内最佳观星点。

    • 输入:top_left(左上角)、bottom_right(右下角)、time、page、page_size。

    • 返回:包含观测条件的地点列表,以及分页元数据(total、resource_id)。

示例

  • 夜间规划器:python examples/nightly_forecast_demo.py

    • 显示今晚可见的行星和深空天体精选列表,并考虑了月光影响。

  • 可见行星:python examples/visible_planets_demo.py

    • 列出当前可见的行星。

  • 月球信息:python examples/moon_phase_demo.py

    • 打印 30 天的月相日历。

  • 编排:python examples/code_execution_orchestration.py

    • 演示完整工作流:获取时间 -> 获取天体位置 -> 检查天气 -> 查找地点。

    • 展示如何以编程方式处理标准化响应格式。

  • 分页:python examples/pagination_demo.py

    • 演示如何使用 resource_id 分页获取大量结果集。

项目结构

项目采用模块化设计,以实现更好的可维护性和代码执行支持:

.
├── src/
│   ├── functions/            # Tool implementations grouped by domain
│   │   ├── celestial/        # Celestial calculations (pos, rise/set)
│   │   ├── weather/          # Weather API integration
│   │   ├── places/           # Location and area analysis
│   │   └── time/             # Time utilities
│   ├── cache.py              # Caching logic for analysis results
│   ├── response.py           # Standardized response formatting
│   ├── server_instance.py    # FastMCP server instance (avoids circular imports)
│   ├── main.py               # Entry point and tool registration
│   ├── celestial.py          # Core astronomy logic (Astropy wrappers)
│   ├── placefinder.py        # Grid analysis logic
│   └── qweather_interaction.py # Weather API client
├── tests/                    # Unified test suite
│   ├── test_celestial.py
│   ├── test_weather.py
│   ├── test_serialization.py # Validates JSON return formats
│   └── test_integration.py   # End-to-end flow tests
├── examples/                 # Usage examples
├── docs/                     # Documentation and improvement plans
└── pyproject.toml            # Project configuration and dependencies

测试

运行统一测试套件:

pytest tests/

关键测试包括:

  • test_serialization.py:确保所有工具返回具有正确模式的有效 JSON。

  • test_integration.py:模拟外部 API 以验证整个工具链。

贡献

  1. 遵循 Code Execution with MCP 的最佳实践。

  2. 确保所有新工具使用 src.response.format_response 返回标准 JSON 响应。

  3. 为任何新功能在 tests/ 中添加测试。

Available Tools

21 tools
analysis_areaA

Analyze a geographic area for suitable stargazing locations.

Use when: you need synchronous place candidates or cached pages for a fixed regional query. Do not use when: the search needs background polling/cancellation or a complete night plan. Requires: south/west/north/east bounds; keep search parameters fixed while changing pages. Follow-up: analysis_area with the same query for other pages; submit_area_analysis for background work; plan_stargazing_session for dates, weather, and target decisions.

This tool searches for dark, accessible locations with good viewing conditions. Results are cached based on search parameters. Server configuration changes can invalidate cached pages without changing resource_id. A configuration change during calculation returns structured CONFIGURATION_ERROR; resubmit after the configuration is stable. Cache lifetime is not source-data age.

Fast mode: Set road_radius_km=0 to skip road connectivity checks. This avoids OSMnx network downloads from Overpass API and is much faster — use it when you only need candidate locations with light pollution and elevation data, without road distance analysis.

Args: south, west, north, east: Bounding box coordinates. max_locations: Maximum number of candidate locations to find (before pagination). min_height_diff: Minimum elevation difference for prominence. road_radius_km: Search radius for road access. Set to 0 to skip road checks. network_type: Type of road network ('drive', 'walk', etc.). avoid_popular_spots: Penalize heuristically popular locations when ranking results. prefer_quiet_at_night: Favor locations that are likelier to quiet down at night. popularity_radius_km: Preference horizon for the popularity heuristics. db_config_path: Optional path to database config. page: Page number (1-based). page_size: Number of results per page.

Returns: Dict with keys "data", "_meta". "data" contains: - items: List of location results for the current page. - total: Total number of locations found. - page: Current page number. - page_size: Current page size. - resource_id: Cache key for the non-pagination search parameters.

Inputs: east (required), west (required), north (required), south (required), +10 more. Returns: object

cancel_area_analysis_taskA
Idempotent

Logically cancel queued/running area work and discard its late results.

Use when: a submitted area task is no longer needed and its late result must not publish. Do not use when: you want to delete cached data or interrupt another domain's operation. Requires: task_id returned by submit_area_analysis in the same server runtime. Returns: idempotent cancellation snapshot; an existing terminal state stays unchanged. A running provider call keeps its execution slot until it actually finishes. Follow-up: get_area_analysis_task to confirm state and execution_pending; wait for physical work to drain before considering resubmission.

Inputs: task_id (required). Returns: object

get_area_analysis_resultA
Read-onlyIdempotent

Page a successful area task's existing cached result without recomputing.

Use when: get_area_analysis_task reports succeeded and you need its original result pages. Do not use when: the task is queued/running and you only need to poll its state. Requires: the successful task_id, page >= 1, and page_size >= 1. Returns: cached items, pagination metadata, and resource_id with the task's publication version checked; this call never silently recomputes missing data. Follow-up: get_area_analysis_result with the same task_id for other pages; get_area_analysis_task for state; resubmit the normalized request on TASK_RESULT_EXPIRED.

Inputs: task_id (required), page, page_size. Returns: object

get_area_analysis_taskA
Read-onlyIdempotent

Poll an area task's state, deadline, failure, and normalized request.

Use when: you have a task_id and need execution state, failure, or remaining physical work. Do not use when: you need result pages; do not submit a new job merely to poll. Requires: task_id returned by submit_area_analysis in the same server runtime. Returns: task snapshot with state, failure, request, and execution_pending. Running progress is unknown; success does not guarantee the separate result cache still exists. Follow-up: get_area_analysis_result after success; cancel_area_analysis_task if unwanted. On TASK_RUNTIME_CHANGED, resubmit the original request rather than polling the old ID.

Inputs: task_id (required). Returns: object

get_best_stargazing_planA

Create a composite stargazing plan for a region and time.

Use when: an existing bbox-first integration needs ranked regional places for one night. Do not use when: starting a new intent-based integration, providing a place name, comparing several nights, or only requesting weather facts. Requires: south/west/north/east bounds, observation time, and timezone. Returns: data.query, ranked data.candidates with scores, windows, weather and targets, and data.summary; all within the standard response envelope. recommendation_score is a relative ranking, not a probability or go/no-go threshold. _meta.status=success can still contain summary.warnings and candidate notes. Only candidates with dated weather and a usable window can be recommended. Missing-weather references retain their place weight without renormalization; weather base score/contribution/weight are zero compatibility placeholders, not bad-weather facts. summary.recommended_location_name is null when none qualify. Missing night-hour weather is unknown, not clear; a null best_observation_window is not an all-night opening. night_window is civil darkness (Sun below -6 degrees), not astronomical darkness (-18 degrees) or guaranteed exposure time. Inspect the returned candidate coordinates; a regional result is not a fixed-site plan. Follow-up: plan_stargazing_session is preferred for new integrations; get_multiday_stargazing_plan preserves bbox-first comparison across nights.

Inputs: east (required), time (required), west (required), north (required), +14 more. Returns: object

get_celestial_posA

Calculate the altitude and azimuth angles of a celestial object.

Use when: you need one named object's position at a specified place and instant. Do not use when: you need an all-night target list or a complete observing decision. Requires: object name, observer coordinates, observation time, and its IANA timezone. Follow-up: get_celestial_rise_set for events; get_nightly_forecast for night targets; plan_stargazing_session for a complete observing decision.

Args: celestial_object: Name of object (e.g. "sun", "moon", "andromeda") lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string

Returns: Dict with keys "data", "_meta". "data" contains "altitude" and "azimuth" (degrees).

Inputs: lat (required), lon (required), time (required), time_zone (required), +1 more. Returns: object

get_celestial_rise_setA

Calculate the rise and set times of a celestial object.

Use when: you need one object's rise/set events. Choose calendar_day for the local date containing time, or next_events for the next rise and next set after time. Do not use when: you need a continuous observing window or a complete night plan. Requires: object name, observer coordinates, time, timezone, and the intended event scope. Follow-up: get_celestial_pos for position; plan_stargazing_session for observing windows.

Args: celestial_object: Name of object (e.g. "sun", "moon", "andromeda") lon: Observer longitude in degrees lat: Observer latitude in degrees time: Date string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string event_scope: "calendar_day" (default) finds the events in the local calendar day containing time. "next_events" finds the next rise and next set independently, rolling into following days when needed.

Returns: Dict with keys "data", "_meta". "data" contains "rise_time" and "set_time".

Inputs: lat (required), lon (required), time (required), time_zone (required), +2 more. Returns: object

get_constellationA

Get the position (altitude/azimuth) of the center of a constellation.

Use when: you need a named constellation's center position at a place and instant. Do not use when: you need to identify which constellation contains arbitrary coordinates, or to choose individual observing targets. Requires: constellation name, observer coordinates, time, and timezone. Follow-up: get_nightly_forecast for individual night targets; plan_stargazing_session for a complete observing decision.

Args: constellation_name: Name of constellation (e.g. "Orion", "Ursa Major") lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string

Returns: Dict with keys "data", "_meta". "data" contains name, altitude, azimuth.

Inputs: lat (required), lon (required), time (required), time_zone (required), +1 more. Returns: object

get_local_datetime_infoA

Retrieve the current datetime and timezone.

Use when: you need the server environment's current time and local timezone. Do not use when: you need time at a remote observing site or already have its timezone. Requires: no inputs; local means the server environment, not the user's observing site. Follow-up: use the observing site's explicit time_zone in celestial and plan_stargazing_session requests; do not infer it from the server timezone.

Returns: Dict with keys "data", "_meta". "data" contains "current_time" (ISO string).

Inputs: no named parameters. Returns: object

get_moon_infoA

Get detailed information about the Moon's phase and position.

Use when: you need lunar phase or illumination facts, with optional observer-local events. Do not use when: you need to rank observing sites or assess a target's overall suitability. Requires: time and timezone; supply both lat and lon for local position and rise/set. Follow-up: get_telescope_targets for equipment-aware targets; plan_stargazing_session for the combined effect of moonlight, weather, place, and observing goals.

When lat and lon are provided, also returns the Moon's local altitude, azimuth, moonrise, and moonset relative to the observer.

Args: time: Date string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string lat: Observer latitude in degrees (optional, for local position) lon: Observer longitude in degrees (optional, for local position)

Returns: Dict with keys "data", "_meta". "data" contains illumination, phase_name, age_days, elongation, earth_distance, and optionally altitude/azimuth plus moonrise/moonset (UTC unix timestamps).

Inputs: time (required), time_zone (required), lat, lon. Returns: object

get_multiday_stargazing_planA

Compare one to seven consecutive nights and recommend the best night and place.

Use when: an existing bbox-first integration compares one to seven consecutive nights. Do not use when: starting a new intent-based integration, querying nonconsecutive dates, more than seven nights, or checking background task status. Requires: south/west/north/east bounds, local start_date, timezone, and optional night count. Returns: normalized data.query, per-night plans, the best night, and summary; each night uses its own civil-dark window. recommendation_score is a relative ranking, not a probability or go/no-go threshold. _meta.status=success can still contain per-night errors, warnings and candidate notes. Compare the dated forecast hours for each night; do not reuse summary.current or summary.daily as night weather. Missing night-hour coverage is unknown, not clear. Civil darkness (Sun below -6 degrees) is not astronomical darkness (-18 degrees) or guaranteed exposure time; a null best_observation_window is not an all-night opening. Follow-up: plan_stargazing_session is preferred for new integrations; get_best_stargazing_plan for the compatible single-night regional detail.

Inputs: east (required), west (required), north (required), south (required), +15 more. Returns: object

get_nightly_forecastA

Get a curated list of best objects to view for the night.

Use when: place and night are known and you need general night targets and a night window. Do not use when: you need telescope-specific target matching or regional site selection. Requires: observer coordinates, time within the intended night, timezone, and optional limit. Interpretation: this is an astronomy forecast, not a weather forecast. Deep-sky altitude and score are evaluated at the supplied time; deep_sky.score sorts lower first and must not be compared with telescope suitability_score (higher first). The legacy transit_alt is an altitude estimate at that scoring time, not a separately solved meridian transit. night_window is civil darkness (Sun below -6 degrees), not astronomical darkness (-18 degrees) or guaranteed exposure time. Follow-up: get_telescope_targets for known optics; get_shooting_plan for an imaging schedule; plan_stargazing_session when place or night still needs comparison.

Args: lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time "YYYY-MM-DD HH:MM:SS" inside the intended night. A bare date means local midnight and can belong to the previous evening's night. time_zone: IANA timezone string limit: Max number of deep-sky objects to return (default 20)

Returns: Standard envelope; data contains: - moon_phase: Moon details - planets: List of visible planets - deep_sky: Sorted list of deep sky objects (Messier/NGC) - night_window: Civil-dark window for the requested night

Inputs: lat (required), lon (required), time (required), time_zone (required), +1 more. Returns: object

get_shooting_planA

Generate a single-night astrophotography shooting plan.

Use when: optics, place, and night are fixed and you need matched targets in timed slots. Do not use when: you still need to choose a site or compare nights, or only need target ranks. Requires: focal length, observer coordinates, time, and the observing timezone (defaults to UTC); optional sensor, optical, and minimum-altitude settings. Follow-up: get_telescope_targets for target details; plan_stargazing_session to reconsider place, date, equipment preset, or observing constraints.

Runs match_telescope_targets then generate_shooting_schedule, returning targets + moon + timed shooting slots in one response. Interpretation: target altitude is at civil dusk, not the requested clock time; use altitude_curve or get_celestial_pos for another time. The schedule uses a civil-dark window (Sun below -6 degrees), not astronomical darkness (-18 degrees), and does not validate weather, access, obstructions or achieved integration time. Empty/null slots or exposure values are not an all-night imaging commitment.

Returns: data.targets[] — same structure as get_telescope_targets data.moon — {illumination, phase, moonrise, moonset, always_down, always_up, dark_fraction, altitude_curve} data.plan — {date, slots[{start_time, end_time, target_name}], total_exposure_min, moon_phase, moon_illumination, moon_delay_min} data.config — the TelescopeConfig used data.total — number of matched targets

Inputs: lat (required), lon (required), time (required), focal_length_mm (required), +12 more. Returns: object

get_telescope_targetsA

Recommend astrophotography targets for a telescope setup.

Use when: place, time, and optics are known and you need ranked deep-sky imaging targets. Do not use when: you only need naked-eye targets, a timed schedule, or a choice of sites. Requires: focal length, observer coordinates, time, and timezone; supply known sensor and optical details for matching. For equipment presets use plan_stargazing_session. Follow-up: get_shooting_plan for timed imaging slots; plan_stargazing_session if the observing place or night still needs comparison; get_celestial_pos for altitude at a specific clock time (the target altitude field is at civil dusk).

Given a telescope/camera configuration and observing location+time, returns a ranked list of deep-sky objects best suited for imaging. Interpretation: altitude is at civil dusk, not at the requested clock time; azimuth is at civil midnight. Use altitude_curve or get_celestial_pos for another time. transit_alt is the sampled peak within the civil-night window, in degrees; transit_time and curve time values are UTC Unix seconds. Null rise/set values mean no crossing was found inside that window, not that an object can never rise/set. suitability_score is a heuristic (higher is better), not a probability or weather clearance. Missing photometry is unknown; do not infer a seasonal visibility error from missing magnitude or from the civil-dusk altitude alone.

Args: focal_length_mm: Telescope focal length in mm (e.g. 250 for RedCat51) lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string (e.g. "Asia/Shanghai", "UTC") aperture_mm: Telescope aperture in mm (optional, for limiting magnitude) sensor_width_mm: Camera sensor width in mm (optional) sensor_height_mm: Camera sensor height in mm (optional) sensor_pixel_size_um: Camera pixel size in microns (optional) central_obstruction_pct: Central obstruction percentage (0-50) reducer_factor: Focal reducer factor (default 1.0) barlow_factor: Barlow/extender factor (default 1.0) mount_type: "equatorial" or "altaz" (default "equatorial") filter_type: Filter type — "Hα", "OIII", "SII", or None for LRGB limit: Maximum number of targets to return (default 20)

Returns: data.targets[] — ranked list, best first. Each target has: name, type, magnitude, catalog altitude (civil dusk, degrees), azimuth (civil midnight, degrees), dawn_altitude angular_size_arcmin, angular_size_min_arcmin, angular_size_pa_deg surface_brightness (mag/arcmin²), fov_fit_score, fov_fill_ratio suitability_score (0-100), mosaic_recommended, optimal_rotation_deg rise_time, set_time, transit_time (UTC unix timestamps), transit_alt (degrees) altitude_curve[{time, alt}] civil_dusk, civil_dawn, observation_time data.moon — {illumination, phase, altitude_curve, always_down, always_up, dark_fraction, moonrise, moonset} data.config — the TelescopeConfig used data.total — number of targets returned

Inputs: lat (required), lon (required), time (required), time_zone (required), +11 more. Returns: object

get_tool_catalogA

Get metadata for all registered MCP tools.

Use when: you need the wrapped catalog with full documentation and parameter summaries. Do not use when: your client only needs standard MCP tools/list discovery or a business result. Requires: no inputs; this call discovers tools and does not perform observing analysis. Follow-up: choose a tool from its use/do-not-use guidance; plan_stargazing_session is the primary entry for complete observing decisions.

Returns: Dict with keys "data", "_meta". "data.tools" contains tool metadata objects.

Inputs: no named parameters. Returns: object

get_weather_by_nameA

通过地点名称获取综合天气(当前 + 小时预报 + 日预报)。

Use when: you have a place name and need weather facts for that resolved location. Do not use when: you already have exact coordinates or need a complete observing decision. Requires: an unambiguous place name; use full administrative names for Chinese locations. Provider selection can remain at the server's default aggregation policy. Follow-up: get_weather_by_position for precise coordinates; plan_stargazing_session to combine weather with darkness, targets, and alternative observing sites.

Geocoding uses offline China gazetteer (CJK) → Photon → Nominatim cascade. Weather data is aggregated from multiple providers with graceful fallback. Open-Meteo needs no API key; network/provider failures can still occur. Atmospheric fields: summary.current.atmosphere and summary.hourly[*].atmosphere contain optional model estimates with their own valid time and per-field provenance. Inspect summary.atmosphere_sources for source failures and resolution. Missing/null means unknown. CAMS global is approximately 45 km and natively 3-hourly; hourly output may be interpolated. AOD is column extinction, not surface visibility. Boundary-layer height is above local model ground, not a pollution ceiling. No AQI or pollution attribution is inferred. Interpretation: summary.current is current weather, summary.daily is calendar-day aggregation, and summary.hourly contains timestamped forecasts. For a future observing night select the actual hourly timestamps across local midnight and inspect providers and source for failures/provenance. Missing/null or out-of-horizon hours are unknown, not clear weather. Forecasts are predictions, not observations of future conditions; do not assume all providers or fields cover the same dates.

中文地名提示:建议使用完整行政区划名称,如 "浙江安吉"、"杭州西湖区"。 内置离线行政区划数据会正确解析到对应的行政区(如安吉县),而非 POI 商铺。 需要精确定位时优先使用 get_weather_by_position(lat, lon)。

Args: place_name: 地点名称。中文请使用完整行政区划(如 "浙江省安吉县"),避免仅用2-3字短名。 provider: provider 模式,可选 all/qweather/open-meteo/wttr。

Returns: Dict,包含 keys: "data", "_meta"(成功时)或 "error", "_meta"(失败时)。

Inputs: place_name (required), provider.

get_weather_by_positionA

通过经纬度获取综合天气(当前 + 小时预报 + 日预报)。

Use when: you have precise coordinates and need current and forecast weather facts. Do not use when: you only have a place name or need ranked observing sites or night targets. Requires: latitude and longitude; provider selection can remain at the default policy. Follow-up: get_weather_by_name for place-name input; plan_stargazing_session to compare observing places and nights using weather and other evidence.

Weather data is aggregated from multiple providers with graceful fallback. Open-Meteo needs no API key; network/provider failures can still occur. Atmospheric fields: summary.current.atmosphere and summary.hourly[*].atmosphere contain optional model estimates with their own valid time and per-field provenance. Inspect summary.atmosphere_sources for source failures and resolution. Missing/null means unknown. CAMS global is approximately 45 km and natively 3-hourly; hourly output may be interpolated. AOD is column extinction, not surface visibility. Boundary-layer height is above local model ground, not a pollution ceiling. No AQI or pollution attribution is inferred. Interpretation: summary.current is current weather, summary.daily is calendar-day aggregation, and summary.hourly contains timestamped forecasts. For a future observing night select the actual hourly timestamps across local midnight and inspect providers and source for failures/provenance. Missing/null or out-of-horizon hours are unknown, not clear weather. Forecasts are predictions, not observations of future conditions; do not assume all providers or fields cover the same dates.

Args: lat: 纬度 lon: 经度 provider: provider 模式,可选 all/qweather/open-meteo/wttr。

Returns: Dict,包含 keys: "data", "_meta"(成功时)或 "error", "_meta"(失败时)。

Inputs: lat (required), lon (required), provider.

light_pollution_mapA

Get light pollution data for a specific area.

Use when: you need a bounding-box grid of light pollution measurements for a map or analysis. Do not use when: you need ranked places or a complete observing decision. Requires: south/west/north/east bounds and optional grid zoom. Returns: data.grid points with brightness, Bortle class, and SQM, plus bounds and zoom. Follow-up: analysis_area for synchronous place candidates; submit_area_analysis for background place analysis; plan_stargazing_session for an observing decision.

Returns a grid of light pollution data points including brightness, Bortle class, and SQM.

Args: south, west, north, east: Bounding box coordinates. zoom: Grid resolution zoom level (default: 10). Higher = more detailed.

Inputs: east (required), west (required), north (required), south (required), +1 more. Returns: object

list_visible_planetsA

Get a list of solar system planets currently visible (above horizon).

Use when: you need planets above the observer's horizon at a specified instant. Do not use when: you need all-night visibility, darkness guarantees, or equipment ranking. Requires: observer coordinates, time, and timezone; above-horizon visibility alone does not establish dark-sky or telescope observing conditions. Follow-up: get_celestial_pos or get_celestial_rise_set for a selected planet; plan_stargazing_session for a planetary observing decision.

Args: lon: Observer longitude in degrees lat: Observer latitude in degrees time: Observation time string "YYYY-MM-DD HH:MM:SS" time_zone: IANA timezone string

Returns: Dict with keys "data", "_meta". "data" is a list of planet dicts (name, altitude, azimuth).

Inputs: lat (required), lon (required), time (required), time_zone (required). Returns: object

plan_stargazing_sessionPlan Stargazing SessionA
Read-onlyIdempotent

Preferred end-to-end planning entry point for choosing when, where, and what to observe across one to seven nights.

Use when: you need a complete observing decision or comparisons of places and nights. Do not use when: you only need raw weather, celestial facts, or task status. Requires: request.location (place name, center/radius, or exact bounds) and start_date; timezone, one-to-seven nights, observing goal, equipment preset/overrides, and supported preference fields have explicit defaults or are optional. A center/radius is a regional search, not a plan locked to the center point. The radius becomes an approximate search box, not a strict circular distance filter. Quietness/popularity adjustments require the corresponding preference flags. Pass request as a JSON object, not a JSON string; inspect resolved_location before describing a candidate as the exact user-specified site. Returns: normalized request, decision, alternatives, evidence, uncertainties, missing inputs, ranking-change conditions, and next actions in the standard envelope. Weather evidence uses dated night-hour forecasts. Missing weather or no usable window excludes a candidate from decision and alternatives; unranked_planning_reference evidence retains known location/sky facts with weather_unknown or no_usable_window status. If none qualify, decision=null. Partial coverage remains provisional. The night_window remains civil darkness. For deep_sky, observation windows require at least two continuous astronomical-dark hours, cloud <=25%, rain probability <=20%, and wind <=20 km/h, with known rain/wind fields. These are heuristic screening limits, not verified imaging success probabilities. Interpretation: recommendation_score is a relative ranking, not a probability or an absolute go/no-go threshold. _meta.status=success means execution succeeded; decision=null means no selected session. A null observation_window means no usable window was established, not an all-night opening. Inspect evidence, uncertainties, missing_inputs and next_actions even on success. nightly_weather_unavailable and no_usable_observation_window are high-uncertainty warnings; long_range_forecast requires a forecast recheck near departure. Never replace missing night hours with summary.current or summary.daily, or infer a provider from weather wording. Civil darkness means Sun below -6 degrees, not astronomical darkness at -18 degrees; its duration is not guaranteed exposure time. Popularity/quiet scores are heuristics, not measured noise or calibrated crowd probabilities. When equipment is supplied, decision.targets already contains equipment-matched targets; use that list to answer the selected session's target question without a second lookup. Read selected_target_window_check evidence before claiming shootability: complete equipment curves with no 25-degree, 30-minute model slot in the selected weather window are excluded. Missing or partial curves and generic targets remain unknown references. Altitude-only checks have unknown Moon constraints; independent slots may overlap and do not verify per-slot Moon separation, tracking or actual exposure. Keep the returned target order; do not compare scores across generic and equipment rankings. This is a synchronous call and can exceed a client default deadline; a timeout does not establish that a background planning task exists. Follow-up: get_shooting_plan for an imaging schedule at the selected place/night; get_weather_by_position for updated weather facts. Inspect missing inputs and next actions before treating a degraded decision as final.

Inputs: request (required). Returns: object

submit_area_analysisA

Submit bounded background place analysis and return its task identifier.

Use when: a geographic place search may outlive one tool call and needs background control. Do not use when: you need a complete observing decision or only want to poll an existing task. Requires: request.bounds and optional place-search preferences; max_locations must be from 1 to 100. Returns: task snapshot with task_id, resource_id, state, and normalized request. Active duplicate queries share a task. Completed retries may use cached data. Follow-up: get_area_analysis_task to poll; get_area_analysis_result after success; cancel_area_analysis_task if no longer needed; plan_stargazing_session for decisions.

Inputs: request (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 21 tools

    Disambiguation3/5

    Most low-level tools are clearly separated, but the planning surface has notable overlap: plan_stargazing_session, get_best_stargazing_plan, and get_multiday_stargazing_plan all produce observing recommendations with only legacy/preferred wording distinguishing them. Similarly, analysis_area versus submit_area_analysis is understandable from descriptions, but the set still asks the agent to choose among several closely related workflows.

    Naming Consistency4/5

    The names are overwhelmingly snake_case and follow predictable patterns such as get_*, list_*, submit_*, cancel_*, and plan_*. A few names break the verb_noun convention, notably analysis_area and light_pollution_map, but the overall convention remains readable and stable.

    Tool Count3/5

    At 21 tools, the server is somewhat heavy for the domain, and the count is inflated by legacy bbox-first planning endpoints and full background-task lifecycle tools. The breadth is justified by real subdomains such as weather, celestial facts, site search, equipment planning, and scheduling, but the total is borderline for easy tool selection.

    Completeness5/5

    The surface covers the apparent domain thoroughly: planning, weather by name and coordinates, celestial positions and rise/set events, moon and planet facts, constellation lookup, light pollution, synchronous and background site analysis, task polling/cancellation/result paging, equipment-specific targets, and shooting schedules. Background area-analysis lifecycle is complete enough to avoid obvious dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Provides altitude-azimuth coordinates for celestial objects including planets, over 117,000 stars, and 14,000 deep sky objects based on system time and configurable location.
      3
      1
      -
    • A
      license
      A
      quality
      F
      maintenance
      Provides authoritative astronomical data including moon phases, solar eclipses, and sun/moon rise and set times using the US Navy API or offline Skyfield calculations. It enables users to query Earth's seasons and celestial events for any location and date.
      8
      1
      Apache 2.0