Skip to main content
Glama

CMB Data MCP Server

MCP server for public CMB data: Planck PR3 component-separated CMB maps and your own power spectrum measured from them; Planck PR3 / ACT DR6 / SPT-3G bandpowers with covariances and lensing bandpowers; and published chains / best-fit theory (published results, for comparison only). It covers data access, honest chi2 checks against LCDM, publication-style plots, and cross-experiment comparisons. It is part of the cosmo-*-mcp-server family (see docs/CONVENTIONS.md).

No compiled likelihoods yet (see the TODO list below).

map TT from map

Data products

Maps & catalogs = component-separated CMB maps; summary statistics = power spectra / bandpowers with covariance (including those you measure from the maps); published results = published inference (chains, best fits), comparison only: never used as a measurement or prior. Every tool declares its kind of data (@data_kind), results carry metadata["data_kind"], and published-result tools are prefixed "[Published result - for comparison only]" and get metadata["comparison_only"].

dataset

Maps & catalogs

Summary statistics

Published results (comparison only)

access

planck_pr3_maps

SMICA-noSZ T, SMICA I/Q/U, Commander I/Q/U (full, hm1, hm2); common T/P masks

pseudo-C_ell TT (EE/TE/BB) measured by measure_cmb_power_spectrum

–

download on demand from IRSA (resumable parallel ranges; 201 MB–2.0 GB at nside 2048), ud_graded to nside 128–1024 and cached

planck_pr3

–

binned/unbinned TT, TE, EE, low-ell BB

PLA best-fit (minimum) theory spectra

bundled binned + theory; unbinned downloaded

act_dr6

–

ACT-lite TT/TE/EE, 135×135 covariance, windows

–

download (287 kB)

spt3g_d1

–

MV TT/TE/EE

–

bundled

spt3g_2018

–

TT/TE/EE

–

bundled

planck_pr3_lensing

–

PP bandpowers, 9×9 covariance

–

bundled

act_dr6_lensing

–

C_L^kk, 18×18 covariance

–

bundled

spt3g_d1_lensing

–

C_L^kk, 17×17 covariance, windows

–

bundled

planck_pr3_chains

–

–

posterior chains, margestats

download (65 MB)

act_dr6_chains

–

–

ACT-lite / P-ACT chains

download (5–7 MB)

compute_lcdm_theory_spectrum(params=...) with camb is a model computation from your parameters (a summary-statistic tool); without camb it falls back to the published Planck best fit and flags it model_source: published_result (comparison only).

Related MCP server: spectra-mcp-server

Tools (16 science/meta + 4 dispatch)

tool

what it does

list_cmb_datasets / describe_cmb_dataset

dataset registry: products, units, verified URLs, citations

list_cmb_skills / load_cmb_skill

server-side recipes (also exposed as MCP prompts)

Maps

fetch_cmb_map (heavy)

Planck PR3 SMICA-noSZ / SMICA / Commander map (full or half-mission) + common mask, downloaded once and ud_graded to nside 128–1024 (cached, muK, RING, Galactic). Dispatch kernel prepare_cmb_map

plot_cmb_map

Mollweide PNG with the mask greyed out, rms in the mask

measure_cmb_power_spectrum (heavy)

from map to power spectrum: masked pseudo-C_ell (healpy anafast; method="namaster" if pymaster is installed) with apodisation, fsky=<w²>, 5′ beam and pixel-window deconvolution, Δℓ=30 PLA binning, Knox errors; auto or hm1×hm2 cross; plots and compares against the released Planck TT. Dispatchable

Summary statistics

fetch_cmb_spectrum(dataset, spectrum, binned)

TT/TE/EE/BB/PP bandpowers written to a tidy CSV (+ covariance .npy when released)

plot_cmb_spectra

D_ell with errors, multi-experiment overlay, best-fit LCDM, residual panel

compute_cmb_residuals

chi2 / PTE against a theory spectrum. Uses the full covariance and windows for ACT and lensing; diagonal (indicative) for Planck/SPT plotting products

compute_lcdm_theory_spectrum (heavy)

camb LCDM spectra from your parameters (optional dependency, lazy import, dispatchable). Falls back to the bundled Planck 2018 best-fit file (published result, flagged)

plot_lensing_spectrum

Planck/ACT/SPT [L(L+1)]^2 C_L^phiphi/2pi with LCDM, plus a fitted A_lens per experiment

Published results (comparison only)

fetch_cmb_chain

downloads and extracts ONE public chain (Planck 2018 plikHM TTTEEE+lowl+lowE+lensing, 65 MB; ACT DR6 ACT-lite / P-ACT, 5–7 MB)

analyze_chain (heavy)

getdist marginal stats (mean, std, 68/95% limits). Dispatch kernel downloads the chain on the node

plot_triangle

getdist triangle plot overlaying up to 3 chains

compare_with_published_constraints (renamed from compare_parameter_constraints)

whisker plot of H0/S8/Om/ns/sigma8 from chains and cited published tables, with n-sigma tensions

set_dispatch / get_dispatch / auth_status / export_dispatch_pack

hep-genesis IRI dispatch (family convention)

Datasets (details)

key

access

content

planck_pr3_maps

on demand (IRSA)

COM_CMB_IQU-{smica-nosz,smica,commander}_2048_R3.00_{full,hm1,hm2}.fits, COM_Mask_CMB-common-Mask-{Int,Pol}_2048_R3.00.fits

planck_pr3

bundled binned spectra + best-fit theory; unbinned spectra downloaded

PLA R3.01/R3.02 TT/TE/EE, low-ell BB, base_plikHM_TTTEEE_lowl_lowE_lensing minimum theory

act_dr6

download (287 kB)

ACT DR6 CMB-only (ACT-lite) sacc: 135 bandpowers, covariance, windows

spt3g_d1

bundled

SPT-3G D1 MV foreground-cleaned TT/TE/EE

spt3g_2018

bundled

SPT-3G 2018 TT/TE/EE MV bandpowers

planck_pr3_lensing

bundled

2018 conservative lensing bandpowers + CMB-marginalised covariance

act_dr6_lensing

bundled (extracted from the 361 MB tarball)

DR6 lensing baseline bins + covariance

spt3g_d1_lensing

bundled

D1 GMV lensing bandpowers, covariance, windows

planck_pr3_chains

download (65 MB)

single-family PLA zip, not the 11 GB grid

act_dr6_chains

download

ACT-lite and P-ACT-lite LCDM Cobaya chains

Provenance for every bundled file is in data/README.md.

Sanity checks (verified by tests)

  • Map → spectrum (real run, 2026-11-04): SMICA-noSZ hm1×hm2 at nside 1024, common mask (1° apodisation, fsky_w2 = 0.752), lmax 2000: first peak at ℓ = 225, D_ℓ = 5706 μK² (Planck released 5793 μK² in that bin). Ratio to the released Planck TT bandpowers over 30 < ℓ < 1500: median 1.023, rms deviation 4.7 %, max 10 %: within ±4 % for 100 < ℓ < 1000; the lowest bin (ℓ ≈ 48) is −6.5 % (cosmic variance plus the fsky approximation) and ℓ ≈ 1000–1500 sits +4–10 % high (unmodelled residual foregrounds/point sources and no mode-coupling inversion). The full-mission auto-spectrum agrees to ≈3 % below ℓ ~ 900, but noise bias then grows to +27 % at ℓ ≈ 1500. Use the half-mission cross. Map rms in the mask is 106.9 μK at nside 1024. Download: 600 MB in ~6 min (0.8–1.2 MB/s).

  • Planck 2018 chain: H0 = 67.36 ± 0.54, Ωm = 0.3153 ± 0.0073, σ8 = 0.8111 ± 0.0060 (getdist output equals the PLA margestats).

  • Planck TT binned vs best fit: χ² ≈ 82.7 for 83 points. Lensing A_lens: Planck 1.01 ± 0.03, ACT 1.02 ± 0.03.

  • SH0ES vs Planck H0: 4.9σ. KiDS S8: −3.1σ. DES Y3 S8: −2.6σ.

Skills

cmb-tour (map → power spectrum → own fit → compare), planck-map-to-power-spectrum (from map to power spectrum, new), reproduce-planck-tt-spectrum, cmb-experiment-comparison, h0-s8-tension-whisker (published results, for comparison only), hpc-dispatch-handoff.

Install / run

uv venv --python 3.12 .venv && uv pip install --python .venv/bin/python -e ".[dev]"
uv pip install --python .venv/bin/python --only-binary :all: camb   # optional (".[theory]")
uv pip install --python .venv/bin/python --only-binary :all: pymaster  # optional (".[namaster]"; Linux/arm64 wheels)
.venv/bin/python -m mcp_server --transport stdio            # or ./run_server.sh
.venv/bin/python -m mcp_server --transport streamable-http --port 8012
MPLBACKEND=Agg .venv/bin/python -m pytest -q                # -m "not network" offline

Known limitations

  • The Planck and SPT-3G D1 spectra are the release plotting products, which ship no covariance. Their χ² values are diagonal-only and indicative.

  • ACT DR6 χ² fixes A_act = P_act = 1.

  • The SPT-3G D1 lensing A_lens comes out ≈ 0.92. candl's lensing-systematics emulator and M_L response corrections are not applied, so this is a known bias, not a physical result.

  • The bundled theory stops at ℓ = 2508. ACT/SPT bins beyond that need camb (lmax=6600).

  • ACT chain Ωm is derived assuming Σmν = 0.06 eV. ACT burn-in is 0.3, since LAMBDA lists none for the lite chains.

  • Maps: there is no official nside-1024 PR3 SMICA map (PR2 had one), so the 2048 file is always downloaded first and then downgraded. smica_nosz (403 MB, T only) is the default; Q/U needs smica (2.0 GB) or commander (1.6 GB), which are implemented but were only HEAD/range-verified here.

  • measure_cmb_power_spectrum uses pseudo-C_ell/fsky with no mode-coupling inversion (use method="namaster" where pymaster installs) and Knox cosmic-variance errors (no noise term, no foreground model). Polarisation spectra from SMICA are implemented but not validated.

TODO — Phase 2: pip likelihoods (not implemented)

  • Planck: HiLLiPoP (PR4 high-ℓ TT/TE/EE) and LoLLiPoP (PR4 low-ℓ EE/BB), via planck-npipe / cobaya.

  • ACT: act_dr6_lenslike (full lensing likelihood with linear corrections), plus the ACT DR6 multi-frequency MFLike.

  • SPT: candl + spt_candl_data (SPT-lite TT/TE/EE and D1 lensing with its systematics emulator).

  • Tools: evaluate_cmb_likelihood(theory_file, likelihood), plus a profile likelihood in one parameter (heavy, dispatchable).

TODO — more maps

  • Done: Planck PR3 SMICA/Commander maps, masks, and the power spectrum from maps.

  • Not yet: the Planck PR3 lensing κ alm (COM_Lensing_4096_R3.00.tgz, 723 MB, URL HEAD-verified; IRSA served it at <0.1 MB/s during development, so no tool reads it yet), ACT DR6 maps / κ map (pixell), PR4 (NPIPE) maps, SPT-3G D1 maps, cutouts, and cross-correlation with galaxy surveys.

Available Tools

20 tools
analyze_chainA

[Published result - for comparison only] Published result, comparison only: getdist marginal statistics (mean, std, 68/95%) of a PUBLISHED chain.

Use only to compare against your own fit of maps / bandpowers; never feed these numbers into a fit as a measurement or prior.

Heavy: downloads/extracts the chain on first use. With set_dispatch('polaris'| 'perlmutter') it runs as one facility job (the node downloads the archive itself). Sanity check (Planck 2018): H0 67.36+-0.54, omegam 0.3153+-0.0073, sigma8 0.8111+-0.0060.

Inputs: output_dir (required), chain, params, ignore_rows. Returns: Uniform result contract returned by every tool.

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.

Inputs: no named parameters. Returns: result

compare_with_published_constraintsA

[Published result - for comparison only] Published result, comparison only: whisker plot of PUBLISHED H0, S8, Omega_m, n_s (sigma8) constraints.

Every entry is a published inference product (chains or tables) across CMB experiments and late-time probes - for the final "compare with published" step of an analysis.

Every point is either a getdist analysis of a public chain (marked 'chain') or a published table value with its citation. Reports the Gaussian tension of each entry vs the reference: (x - x_ref) / sqrt(s^2 + s_ref^2) - e.g. SH0ES vs Planck H0 ~ 4.9 sigma.

Inputs: output_dir (required), chains, params, reference, +1 more. Returns: Uniform result contract returned by every tool.

compute_cmb_residualsA

chi2 of one experiment's bandpowers against an LCDM theory spectrum, plus residuals.

Uses the full covariance when the release has one (ACT DR6 TT/TE/EE block, all lensing
datasets, with Hartlap factors) and the bandpower windows when available; otherwise the
diagonal errors (Planck/SPT plotting products: chi2 is INDICATIVE, correlations ignored;
Planck unbinned uses the mean of the asymmetric errors). Reports chi2, N, PTE.

Inputs: output_dir (required), binned, dataset, ell_max, +3 more. Returns: Uniform result contract returned by every tool.

compute_lcdm_theory_spectrumA

Compute a lensed LCDM TT/TE/EE/BB + lensing-potential theory spectrum to CSV.

Model computation: with camb and YOUR parameters this is your own model for
fitting the bandpowers. Uses camb (optional dependency, lazily imported; or a facility
node via set_dispatch). Without camb and without params it falls back to the bundled
Planck 2018 published best-fit theory file (ell<=2508) - that is a published result
(comparison only), flagged in metadata.model_source; say so when reporting. Pass the CSV as theory_file to
plot_cmb_spectra / compute_cmb_residuals / plot_lensing_spectrum.

Inputs: output_dir (required), lmax, params. Returns: Uniform result contract returned by every tool.

describe_cmb_datasetB

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

Inputs: name (required). Returns: Uniform result contract returned by every tool.

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.

Inputs: no named parameters.

fetch_cmb_chainA

[Published result - for comparison only] Published result, comparison only: download and extract ONE published MCMC chain (never the 11 GB grid).

Returns the getdist chain root path (pass to analyze_chain / plot_triangle) and the parameter list. First call downloads into the cache; later calls are instant.

Inputs: output_dir (required), chain. Returns: Uniform result contract returned by every tool.

fetch_cmb_mapA

Fetch a Planck PR3 component-separated CMB MAP and its common mask, downgraded.

Use this to start any map-level analysis (own power spectrum, cutouts, cross-correlation).
The nside-2048 FITS is downloaded ONCE from IRSA with resumable parallel range requests
into the data cache, then ud_graded to `nside` (RING, Galactic, muK_CMB); the downgraded
map and mask are cached so later calls are instant. Planck PR3 SMICA/Commander beam: 5'
FWHM Gaussian. Returns the map/mask paths (pass to measure_cmb_power_spectrum /
plot_cmb_map), rms in the mask and fsky. Heavy (first call: minutes of download).

Inputs: output_dir (required), mask, nside, split, +2 more. Returns: Uniform result contract returned by every tool.

fetch_cmb_spectrumA

Fetch one public CMB bandpower spectrum and write it as a tidy CSV.

Use this first for any spectrum task. Columns: ell, D_ell, err_lo, err_hi (+ ell_min,
ell_max when bins are known; + planck_best_fit for Planck binned). Units: D_ell =
ell(ell+1)C_ell/2pi in muK^2; PP is [L(L+1)]^2 C_L^phiphi/2pi (ACT/SPT C^kk converted).
If the dataset ships a covariance (ACT DR6, all lensing) it is saved as <stem>_cov.npy.

Inputs: output_dir (required), binned, dataset, spectrum. Returns: Uniform result contract returned by every tool.

get_dispatchA

Report where THIS server's heavy tools currently execute.

Inputs: no named parameters. Returns: result

list_cmb_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.

Inputs: kind. Returns: Uniform result contract returned by every tool.

list_cmb_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.

Inputs: no named parameters. Returns: Uniform result contract returned by every tool.

load_cmb_skillA

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

Inputs: name (required). Returns: Uniform result contract returned by every tool.

measure_cmb_power_spectrumA

Measure the CMB TT (optionally EE/TE/BB) power spectrum FROM A MAP (from map to power spectrum).

Use this for your own spectrum from Planck maps (instead of the released bandpowers).
Pseudo-C_ell via healpy anafast of the (apodised) masked map, divided by fsky = <w^2>,
the Gaussian beam^2 and the HEALPix pixel window^2; monopole/dipole removed. Binned in
Delta-ell = 30 bins like the PLA TT file; errors are Knox cosmic-variance only (no noise
term). Auto-spectra carry noise bias (SMICA: noticeable above ell ~ 1000), so pass the
hm1/hm2 pair for a cross-spectrum. Heavy, dispatchable (set_dispatch). Sanity: first
peak at ell ~ 220 with D_ell ~ 5700-5800 muK^2; within a few % of Planck TT at 30<ell<1500.

Inputs: map_file (required), mask_file (required), output_dir (required), lmax, +6 more. Returns: Uniform result contract returned by every tool.

plot_cmb_mapA

Mollweide (Galactic) PNG of a HEALPix CMB map, with the mask greyed out.

Use after fetch_cmb_map to show the component-separated CMB map. Reports the pixel rms inside the mask.

Inputs: map_file (required), output_dir (required), vmax, field, +3 more. Returns: Uniform result contract returned by every tool.

plot_cmb_spectraA

Plot D_ell bandpowers with error bars for one or more experiments + LCDM + residuals.

Use to reproduce the Planck 2018 TT/TE/EE figure (datasets=['planck_pr3']) or the
SPT-3G D1 / ACT DR6 / Planck overlay (Camphuis+25 Fig.1: ['planck_pr3','act_dr6','spt3g_d1'],
log_y=True for TT/EE). Residuals are D_ell - theory with the same errors.

Inputs: output_dir (required), log_x, log_y, ell_max, +5 more. Returns: Uniform result contract returned by every tool.

plot_lensing_spectrumA

Plot CMB lensing-potential bandpowers [L(L+1)]^2 C_L^phiphi/2pi for Planck/ACT/SPT.

Shows Planck PR3 (8<=L<=400), ACT DR6 baseline (40<=L<=763) and SPT-3G D1 GMV bandpowers
with the LCDM prediction, and reports each dataset's amplitude A_lens = best-fit scaling of
the theory (full covariance) with its error.

Inputs: output_dir (required), datasets, theory_file. Returns: Uniform result contract returned by every tool.

plot_triangleA

[Published result - for comparison only] Published result, comparison only: getdist triangle plot (68/95% contours) of published CMB chains.

Overlay planck_pr3 with act_dr6_lite to show the Planck-vs-ACT LCDM agreement.

Inputs: output_dir (required), chains, params. Returns: Uniform result contract returned by every tool.

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.

Inputs: site (required), artifact_dir. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 20 tools

    Disambiguation4/5

    Tools are mostly cleanly separated by resource and action (fetch map vs fetch spectrum vs fetch chain; plot_map vs plot_spectra vs plot_lensing_spectrum). The closest pair is fetch_cmb_spectrum vs measure_cmb_power_spectrum (released bandpowers vs own pseudo-C_ell from a map), but the descriptions explicitly distinguish them. Infrastructure tools (dispatch, skills, discovery) are clearly bounded.

    Naming Consistency5/5

    Every tool follows snake_case verb_noun with a coherent cmb/lensing domain namespace (fetch_cmb_map, plot_cmb_spectra, compute_lcdm_theory_spectrum, compute_cmb_residuals). Even the infrastructure tools follow the same pattern (get_dispatch, set_dispatch, auth_status, export_dispatch_pack). No mixed conventions.

    Tool Count4/5

    20 tools is on the heavy side but the domain genuinely spans maps, spectra, lensing, chains, theory, and HPC dispatch, so most tools earn their place. A few infrastructure tools (list/load skills, export_dispatch_pack) inflate the count beyond core science operations. Slightly over-scoped but defensible.

    Completeness4/5

    Covers the full analysis lifecycle: discovery, map fetch, measured/released spectra, theory, residuals, lensing, chain analysis, triangle plots, and published-constraint comparison. Minor gaps exist (no explicit parameter-fitting tool despite references to fitting, no cache/artifact management or deletion), but agents can work around them with external code.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers