GraceDB

io.github.izabelamaria24由 GitHub 账号 izabelamaria24 发布v0.4.0更新于 Nov 3, 2026

LIGO/Virgo/KAGRA引力波警报(GraceDB)、开放数据(GWOSC)以及GCN后续观测。

AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。

原文描述

LIGO/Virgo/KAGRA gravitational-wave alerts (GraceDB), open data (GWOSC) and GCN follow-up.

已验证STDIO仅桌面数据与分析AI 与机器学习

概览

GraceDB 的本地 MCP 服务;无需登录;STDIO。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

安装

在 SourceWeft 中

  1. 打开 控制台中的 GraceDB,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

GraceDB MCP Server

[PyPI] [CI] [License] [DOI] [GraceDB MCP on mcprush]

An open-source Model Context Protocol (MCP) server that exposes LIGO/Virgo/KAGRA gravitational-wave alerts from GraceDB to LLM agents. It bridges the official ligo-gracedb client with the MCP standard so an agent can query, classify, and fetch data for gravitational-wave candidate events.

Intended as the data-ingestion layer for a downstream signal-processing / anomaly-detection pipeline (e.g. isolating astrophysical "chirps" from instrumental glitches).

Tools

ToolWhat it does
search_supereventsSearch recent superevents by time window and significance (FAR / astrophysical probability).
get_event_metadataFull superevent record + source classification (BBH / BNS / NSBH / Terrestrial).
download_event_filesDownload GraceDB artifacts: skymaps, p_astro.json, PE results, logs.
download_strain_dataFetch public strain time series from GWOSC around the event GPS time.
utc_to_gpsConvert an ISO-8601 UTC timestamp to GPS seconds.
search_catalog_eventsSearch published GWOSC catalogue events (GWTC-1 to GWTC-5) by masses, distance, SNR, p_astro.
get_catalog_eventSource parameters with 90% intervals for one event, by GW name or GraceDB id.
get_event_labelsGraceDB labels (data quality, review, retraction, products ready) explained in plain English.
audit_alertsThe alerts of a period in one call: superevents, significant and low-significance alerts, retractions with hours to retraction, alerts by detector network and pipeline.
check_data_availabilityWhich detectors have public GWOSC strain for an event or GPS span, before you download.
check_data_qualityPer detector: which data-quality vetoes (CBC, Burst, CW, stochastic) the data passes, and any hardware injections.
list_observing_runsReleased observing runs with dates, detectors and DOIs; which run (if any) covers a given time.
analyze_skymap50%/90% credible areas, distance and peak position from a sky map; probability that given positions (galaxies, transients) or telescope fields contain the source.
search_gcn_circularsNASA GCN Circulars: what telescopes, satellites and neutrino detectors reported about an event (GW, GRB, IceCube...), or any Lucene query with date filters.
get_gcn_circularFull text of one GCN Circular, with links to cite it via ADS.

Resources

Every file the server downloads (up to 50 MB) is also an MCP resource, so an agent can read it without filesystem access, which is useful when the server runs in Docker or on another machine:

text
gracedb://files/S190814bv/p_astro.json                       (application/json)gracedb://files/S190814bv/bayestar.png                       (image/png)gracedb://files/GW150914/strain/H1-1126259458-8.hdf5         (application/x-hdf5)

The download tools return these URIs, clients are notified when new files appear, and files already in the data directory are listed at startup. Larger files, such as full parameter-estimation posteriors, stay on disk only.

Prompts

Ready-made workflows that chain the tools. Most clients show them as slash commands.

PromptArgumentsWhat you get
alert_briefinghours (24), max_far (3.8e-7 Hz, about one false alarm per month), category (Production, or MDC for the simulated alerts GraceDB creates about hourly)New alerts triaged: retractions and data-quality flags first, then class, significance and sky map.
event_dossierevent (S190814bv or GW190814), audience (scientist, student, public)One event end to end: significance, review history, alert vs. final parameters, sky map, public data.
alert_vs_catalogevent, or catalog + max_events (15)How well the low-latency classification matched the final published masses.
alert_auditstart, end (now), categoryA period's alerts: how many, how many retracted, why (from the LVK retraction circulars) and how fast, plus the detectors and pipelines involved.

Skills

Agent skills cover workflows that need more than this server, such as running Python locally. They live in skills/ and are not part of the PyPI package. To use one, copy its folder to your agent's skills directory:

  • Claude Code: ~/.claude/skills/
  • GitHub Copilot: .github/skills/ in a project, or ~/.copilot/skills/
bash
cp -r skills/gw-open-data-analysis ~/.claude/skills/
SkillWhat it does
gw-open-data-analysisFrom an event name to plots: checks which detectors have open data, downloads the strain and whitens it. It then plots each detector's Q-transform (the chirp), the whitened strain and the noise spectrum. It also matched-filters the data with a waveform for the catalogue masses, which reproduces the published SNRs to within a few percent. It reports what is and is not seen. A targeted search takes a gamma-ray burst or neutrino alert from GCN and searches the data around it for a neutron-star merger, giving a false-alarm probability; it recovers GW170817 from GRB 170817A's time alone. Needs local Python with gwpy, plus lalsuite for the matched filter and targeted search.

⚠️ Important: where strain data actually comes from

GraceDB does not host raw strain data. It stores event artifacts (skymaps, classifications, parameter-estimation results). The public strain time series lives at GWOSC and is fetched by GPS time via gwpy. Public strain is only available for released observing runs — fresh low-latency alerts will not have public strain yet. download_strain_data reflects this: it reads t_0 from GraceDB, then pulls open data from GWOSC (and cleanly reports when data isn't public).

Requirements

  • Python 3.10+
  • mcp, ligo-gracedb, gwosc, python-dotenv
  • Optional: gwpy (for download_strain_data) — installed via the strain extra.

Install

Run straight from PyPI with uv:

bash
uvx --from "gracedb-mcp[strain]" gracedb-mcp

Or from source:

bash
git clone https://github.com/izabelamaria24/gracedb-mcp.gitcd gracedb-mcppython -m venv .venv && source .venv/bin/activatepip install -e ".[strain]"     # omit [strain] if you don't need strain download

Configuration

Copy .env.example to .env and adjust. Anonymous access is enough for public superevents:

bash
cp .env.example .env
VariablePurpose
GRACEDB_SERVICE_URLAPI base URL (production or playground).
GRACEDB_FORCE_NOAUTHtrue for anonymous public access.
GRACEDB_PROXY / GRACEDB_CERT + GRACEDB_KEYLVK member authentication (X.509).
GRACEDB_MCP_DATA_DIRWhere downloaded files are written (default ~/.cache/gracedb-mcp; /data in Docker).

Run locally

bash
gracedb-mcp          # speaks MCP JSON-RPC over stdio

Development

Requires Python 3.11+ (the mcp 2.x SDK needs 3.10+).

bash
pip install -e ".[dev]"pytest -q            # tests mock the GraceDB client, no network needed

Run with Docker

A prebuilt image (linux/amd64 and arm64) is published to GHCR:

bash
docker run --rm -i -v gracedb-data:/data ghcr.io/izabelamaria24/gracedb-mcp:latest
TagDownloadContents
latest, X.Y.Z~165 MBEverything, including strain download (gwpy).
latest-slim, X.Y.Z-slim~60 MBAll tools except download_strain_data.

Or build it yourself (add --build-arg EXTRAS= for the slim variant):

bash
docker build -t gracedb-mcp .docker run --rm -i -v gracedb-data:/data gracedb-mcp

Connect to an MCP client

Claude Desktop / VS Code (mcp.json)

Add to your MCP client configuration:

json
{  "mcpServers": {    "gracedb": {      "command": "gracedb-mcp",      "env": {        "GRACEDB_FORCE_NOAUTH": "true",        "GRACEDB_MCP_DATA_DIR": "./data"      }    }  }}

Or run the container directly:

json
{  "mcpServers": {    "gracedb": {      "command": "docker",      "args": ["run", "--rm", "-i", "-v", "gracedb-data:/data", "ghcr.io/izabelamaria24/gracedb-mcp:latest"]    }  }}

Example agent prompts

  • "Search for superevents from 2023-05-01 to 2023-06-01 with a FAR below 1e-8."
  • "What's the source classification for S230518h? Is it more likely a BBH or an NSBH?"
  • "Download the skymap and p_astro file for S230518h."
  • "Fetch H1 and L1 strain around GW150914."
  • "What are the masses of GW190814, and how certain are they?"
  • "List GWTC-3 events with total mass under 10 solar masses."
  • "Was S190814bv checked by a human? What do its labels mean?"
  • "Is there public strain for GW190814 from every detector?"

Demo

A real session (tool results trimmed to the key fields).

You: Tell me about S190814bv. Was it real, what was it, and can I get its data?

Tool callResult
get_event_metadata("S190814bv")FAR 2.0e-33 Hz; alert classification NSBH 0.998, MassGap 0.002; 63 files
get_event_labels("S190814bv")DQOK, SKYMAP_READY, PASTRO_READY, ADVOK (human advocate approved), PE_READY; not retracted
download_event_files("S190814bv", ["bayestar.png"])gracedb://files/S190814bv/bayestar.png (sky map, viewable as an image)
get_catalog_event("S190814bv")GW190814 in GWTC-2.1: 23.3 (21.9–24.7) and 2.6 (2.5–2.7) solar masses, 230 (180–270) Mpc, SNR 25.3
check_data_availability(event="S190814bv")Public strain from H1, L1 and Virgo (H1 only via the event's own file)
download_strain_data("S190814bv", ["H1", "L1", "V1"], duration=30)gracedb://files/S190814bv/strain/L1-1249852242-30.hdf5, and the same for H1 and V1

Agent: Yes, it's real and extremely significant (false-alarm rate about 2×10⁻³³ Hz). It passed data-quality checks, a human advocate approved it, and it was never retracted. The alert called it a neutron star–black hole merger (99.8%). The final analysis (GW190814) found a 23-solar-mass black hole and a 2.6-solar-mass companion, which is too heavy for most neutron-star models and too light for known black holes, so its nature is still open. It was 230 Mpc away. Here's the sky map, and I've saved 30 s of data from both LIGO detectors and Virgo around the merger.

RL environment (experimental)

gw_rl is a Gymnasium environment built on strain fetched by this server. Each episode shows the agent a 1 s spectrogram and it answers noise, chirp or glitch (+1 correct, -1 wrong).

Real chirps are scarce, so training injects synthetic chirps into real detector noise; the real catalogue events are kept for evaluation. Chirps are IMRPhenomD waveforms from LALSimulation (--chirp imr, default) or a simple analytic sweep (--chirp toy). Glitches are real LIGO glitches labelled by Gravity Spy (--glitch real, default) or sine-Gaussian bursts (--glitch synthetic).

It is not part of the PyPI package; run it from a clone of this repository (needs pip 25.1+):

bash
pip install -e . --group rlpython scripts/fetch_training_strain.py --catalog GWTC-3-confident  # small files, a few MBpython scripts/fetch_glitches.py --files 30  # ~3 GB of GWOSC hour files, cached by gwpypython scripts/train_agent.py --algo ppo mlp cnn --verbose

Roadmap

  • Streamable-HTTP transport (in addition to stdio) for remote deployments.

Disclaimer

Unofficial; not affiliated with or endorsed by LIGO, Virgo, KAGRA, GraceDB or NASA GCN. Respect the GWOSC, GraceDB and GCN data-use policies.

If you publish results using data fetched by this server, cite the data sources: GWOSC (CC BY 4.0), GCN Circulars by number (each has an ADS record), and, for glitch labels, Gravity Spy.

Citing

If this server helped your work, please cite it: doi:10.5281/zenodo.23810872 (all versions; Zenodo also lists a DOI per release). GitHub's Cite this repository button (from CITATION.cff) gives APA and BibTeX.

License

GPL-3.0-or-later, matching its core dependencies ligo-gracedb and gwpy.

来源:README.md,提交 9f8b83f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

5
  1. v0.4.0最新Nov 3, 2026
  2. v0.3.0Oct 31, 2026
  3. v0.2.2Oct 30, 2026
  4. v0.2.0Oct 29, 2026
  5. v0.1.0Oct 26, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分