Skip to main content
Glama
Supernova Cosmology MCP Server

Supernova Cosmology MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Supernova Cosmology MCP Server (Type Ia SNe: Pantheon+, DES-SN5YR, Union3/UNITY1.5, optional DES-Dovekie). Start with list_sn_datasets / describe_sn_dataset; list_sn_skills for recipes (sn-tour first). Conventions: z = zHD (CMB + peculiar-velocity corrected), mu in mag, D_L = (1+z_hel) D_M(z_HD), H0 in km/s/Mpc; the SN absolute magnitude M and H0 are degenerate, so every fit and chi2 marginalises the additive offset analytically with the FULL stat+sys covariance - absolute mu levels and H0 carry no cosmological information here. Pantheon+ fits default to z > 0.01 (Brout+22); 'calibrators' include/exclude/only selects the 77 Cepheid-host rows. Union3 is a 22-node compressed (binned) Hubble diagram, not per-SN. Typical chain: fetch_sn_sample -> plot_hubble_diagram / bin_hubble_diagram -> fit_sn_cosmology (heavy) -> plot_sn_contours -> compare_sn_samples; compute_distance_modulus gives theory curves and compute_sn_chi2 tests a single model. Tools that write files take an output_dir and return ArtifactResult; pass file paths between tools, never raw arrays. Heavy tools (fit_sn_cosmology, compare_sn_samples mode=contours) can run on ALCF/NERSC via the hep-genesis IRI dispatch engine (set_dispatch / export_dispatch_pack); this server holds no facility credentials.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_sn_datasetsA

List the public datasets this server exposes. Call this first.

Products are grouped as catalogs (object-level data), summary statistics (measurements with covariance) and published results (chains / parameter constraints, for comparison only). Build analyses on catalogs and summary statistics. Each entry also gives access (bundled vs downloaded on first use) and which tools read it.

describe_sn_datasetA

Full description of one dataset: products, units, conventions, URLs, citation.

list_sn_skillsA

List this server's skills: named multi-tool recipes.

A skill is procedural know-how - which tools to chain, in which order,
with what parameters, and how to sanity-check and report. When a task
matches one, load it with the load-skill tool and follow it.
load_sn_skillA

Load the full instructions of one of this server's skills and follow them.

fetch_sn_sampleA

Download (first use) and tidy one SN Ia Hubble diagram with its FULL stat+sys covariance.

Use this first: it writes `<dataset>_hd.csv` (cid, survey, z, zhel, mu, mu_err_diag,
is_calibrator) and `<dataset>_cov.npy` (the matching sub-covariance in mag^2, same row
order). Every other tool can take the dataset name directly, but the CSV is what you
hand to plotting or external codes. Union3 is a 22-node binned (compressed) Hubble
diagram - there is no public per-SN Union3 table.
compute_distance_modulusA

Theory distance modulus mu(z) = 5 log10(D_L/10pc) for a given cosmology (w0waCDM, curvature).

Use for theory curves to overlay on a Hubble diagram, or to quantify how much two
cosmologies differ in mu (the CSV includes mu minus flat LCDM Om=0.3, offset-free at
low z). Radiation is neglected (< 1e-4 mag for z < 3). Cross-checked against
astropy.cosmology in the tests.
bin_hubble_diagramA

Compress a Hubble diagram into redshift bins of mu residuals vs a fiducial cosmology.

Use to see trends (e.g. the low-z vs high-z offset that drives Om/w differences between
samples) and to make compact, correlated data vectors. Residuals are mu - mu_fid with the
best-fit offset removed; binning is a full-covariance GLS compression, so the bin
covariance (written as .npy) keeps systematic correlations. Union3 is already binned:
bins with one node are passed through.
plot_hubble_diagramA

Publication-style Hubble diagram: mu(z) with the fiducial curve and a residual panel.

Use to show a sample (cf. Brout+22 Fig. 4, DES 2024 Fig. 1): per-SN points with
diagonal errors (grey), full-covariance binned residuals (colour), the fiducial
model and Pantheon+ calibrators highlighted. Residuals have the best-fit offset removed
(M/H0 are degenerate), so only the SHAPE of mu(z) is meaningful.
compute_sn_chi2A

Offset-marginalised chi2 of ONE cosmology against a sample (full covariance). Fast.

Use to test a specific model (e.g. Planck LCDM Om=0.315, or DESI DR2 w0waCDM) against a SN sample, or to compute Delta-chi2 between two models without a full fit.

fit_sn_cosmologyA

Fit flat LCDM / wCDM / w0waCDM to one SN sample on a grid (+ Nelder-Mead refinement).

Use for SN-only cosmology: full stat+sys covariance, offset M/H0 marginalised
analytically, flat priors over the grid. Writes `<tag>_summary.json` (best fit, chi2,
1D marginal mean/sd/68/95%), `<tag>_1d_<p>.csv` and `<tag>_2d_<a>_<b>.csv` (posterior,
profile chi2 and in_68/in_95 HPD flags) for plot_sn_contours. Heavy: w0wacdm with
the default 41^3 grid on Pantheon+ takes a few minutes locally. When set_dispatch
points at an HPC site it runs as one facility job (kernel sn.kernels.fit_sn_cosmology).
SN alone barely constrain w0wa; expect posteriors hitting prior edges (flagged).
Sanity: Pantheon+ lcdm Om = 0.334 +- 0.018 (Brout+22); DES-SN5YR 0.352 +- 0.017.
plot_sn_contoursA

Plot 68%/95% credible contours (HPD of the gridded marginal posterior) for one parameter pair.

Use after fit_sn_cosmology (wcdm: Om-w; w0wacdm: w0-wa or Om-w0) to reproduce the
familiar SN contour figures (Brout+22 Fig. 9, DES 2024 Fig. 4, Rubin+23 Fig. 9);
pass several CSVs to overlay samples.
compare_sn_samplesA

Compare SN samples: binned residual Hubble diagrams, or cosmology contours + tension.

Use to see whether Pantheon+, DES-SN5YR and Union3 agree. `residuals` overlays each
sample's full-covariance binned mu residuals vs the SAME flat LCDM fiducial (each sample's
offset removed separately - only shapes are comparable). `contours` runs fit_sn_cosmology
per sample, overlays the 2D contours (Om-w for wcdm, w0-wa for w0wacdm, 1D for lcdm) and
reports pairwise Gaussian tensions. CAUTION: the samples share SNe (low-z CfA/CSP/Foundation;
Union3 contains much of Pantheon+), so they are NOT independent. The quoted tension uses
Cov(diff) = C1 + C2, ignoring the positive cross-correlation, so it UNDER-states the
significance of a real difference - treat it as indicative, not a formal test.
plot_sn_covarianceA

Image of the stat+sys correlation matrix (rows sorted by redshift).

Use to show how strongly SNe are correlated by calibration/systematics (off-diagonal structure is what makes diagonal-error fits wrong) and to sanity-check the matrix.

fetch_sn_salt2_paramsA

Fetch per-SN SALT2/SALT3 light-curve fit parameters: x1, c, mB and their errors and covariances, HOST_LOGMASS and bias corrections.

Use this to get the per-SN catalog data needed for Tripp standardisation via
standardize_sn_salt2. Pantheon+ uses SALT2 fits (Brout+22); DES-SN5YR uses SALT3 (Kenworthy+21).
The output CSV has one row per SN and includes the released distance modulus for comparison.
standardize_sn_salt2A

Tripp standardisation: build a Hubble diagram from per-SN SALT2 fits (from catalog to Hubble diagram).

Fits alpha (stretch), beta (colour), gamma (host-mass step at 10^10 Msun) and sigma_int
by maximum likelihood: mu = mB - M + alpha*x1 - beta*c ± gamma/2 - biasCor.
Literature: Pantheon+ alpha~0.15, beta~3.0, gamma~0.05; DES-SN5YR alpha=0.161, beta=3.12, gamma=0.038.
The tool compares the resulting mu with the released Hubble diagram (rms_vs_released_mu should be
~few mmag for Pantheon+ and ~20 mmag for DES, since we use a diagonal approximation).
Uses ONLY per-SN light-curve fit parameters; never published posteriors.
fetch_sn_lightcurveA

Download and parse raw photometric light-curve data for one SN Ia.

Pantheon+ light curves are individual SNANA .dat files from PantheonPlusSH0ES/DataRelease
(downloaded on demand). DES-SN5YR light curves come from the SALT3 fit LCPLOT file (data +
model columns; 7.4 MB download on first use). Returns a CSV with mjd, band, flux, flux_err
(and mag where available). Use plot_sn_lightcurve to visualise.
plot_sn_lightcurveA

Plot a SN Ia multi-band light curve (per-SN photometry).

Downloads the light curve on demand (same as fetch_sn_lightcurve) and makes a publication-style
plot with one colour per band. Flux space (default) shows the SALT2 flux calibration; magnitude
space inverts the y-axis and uses mag where available.
auth_statusA

Report the facility sign-in state THIS server sees for its own HPC dispatch (ALCF and NERSC).

Call this before set_dispatch to a remote site, or when one of this
server's remote calls fails with an auth error. It says nothing about
the facility servers' own tokens - ask those servers directly. Sign-in
happens outside this server (hep-genesis auth CLIs or the desktop app's
HPC panel); tokens are re-read on every call.
export_dispatch_packA

Hand THIS server's compute kernels to the client for HPC runs.

Returns the ``tools/`` package as in-band text files plus a manifest of
kernel entry points (dotted function path, args shape, node-side
pip_deps, walltime hint). The CLIENT - which holds the facility tokens,
Globus endpoint, project and workdir - stages and submits the kernels
with ITS OWN credentials (e.g. the hep-genesis facility servers'
run_pack_kernel tool). Nothing credential-shaped or project-shaped is
needed on, or returned by, this server.

Clients that recognise the ``dispatch_pack`` key should save the files
locally and NOT echo their contents into the conversation.
get_dispatchA

Report where THIS server's heavy tools currently execute.

set_dispatchA

Set where THIS server's heavy tools execute: 'local' (this machine), 'polaris' (ALCF) or 'perlmutter' (NERSC).

Affects only this server's heavy (dispatchable) tools - never other
servers' dispatch state. Remote sites run each heavy call as one facility
job (staging + queue + walltime: minutes, not seconds) and need facility
sign-in - check with auth_status first. Light tools (listing, plotting,
small reads) always run locally. Optional artifact_dir sets where
produced files are fetched back to. Returns the active configuration.

Prompts

Interactive templates invoked by user choice

NameDescription
hpc-dispatch-handoffRun this server's heavy kernel (sn.kernels.fit_sn_cosmology - w0waCDM / fine wCDM grids on the full SN covariance) on ALCF Polaris or NERSC Perlmutter through the hep-genesis IRI engine - client-side pack export (hosted) or server-side set_dispatch (own machine)
reproduce-pantheon-plus-omReproduce the Pantheon+ SN-only flat-LCDM Om = 0.334 +- 0.018 (Brout+22 Table 3) and wCDM w = -0.90 +- 0.14, with the checks that matter - z > 0.01 cut, calibrators, full vs diagonal covariance, offset marginalisation
salt2-standardizationBuild a Hubble diagram from scratch using SALT2 light-curve fit parameters (from catalog to Hubble diagram) - Tripp formula with alpha, beta, gamma, sigma_int fitted by maximum likelihood
sn-dark-energy-w0waFit wCDM and w0waCDM to Pantheon+, DES-SN5YR and Union3 separately, overlay their contours, and quantify how far each prefers evolving dark energy and how much the samples disagree (residual shapes, Om shifts, pairwise tension) - with the caveats on shared SNe
sn-tourFive-minute all-local tour of the SN Ia server - list datasets, fetch Pantheon+, plot its Hubble diagram, fit flat LCDM to Pantheon+/DES-SN5YR/Union3, overlay residuals of the three samples, and draw a wCDM contour

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 21 tools

Disambiguation4/5

Tools are largely distinct and well-separated by verb (fetch/compute/plot/fit/compare). The only mild overlaps are bin_hubble_diagram vs plot_hubble_diagram (both produce binned residuals) and the two light-curve tools, but descriptions clearly distinguish data-writing from plotting.

Naming Consistency4/5

Mostly consistent verb_noun with a sn_ namespace (fetch_sn_sample, compute_sn_chi2, plot_sn_contours). The dispatch tools deviate slightly (auth_status uses noun_verb order; get/set/export_dispatch lack the sn_ prefix) but remain snake_case and readable.

Tool Count4/5

21 tools is on the heavy side but each targets a distinct scientific operation (data discovery, fetch, fit, plot, compare, dispatch) that earns its place. Slightly over a comfortable count but well-scoped for a rich cosmology workflow.

Completeness4/5

Covers the full lifecycle: dataset discovery, fetching, SALT2 standardisation, chi2/fit, plotting, sample comparison, skills, and HPC dispatch. Minor gaps like retrieving dispatched job results are handled indirectly via artifact_dir but not as an explicit tool.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues