Skip to main content
Glama
Inelastic Dark Matter MCP Server

Inelastic Dark Matter MCP Server

by nesar

Inelastic Dark Matter MCP Server

CI analysis trial particle-physics HPC · part of the HEP-KE MCP server library

Q2C Bridge: Particle physics → Cosmological observables

MCP server that connects WIMP particle physics parameters (mass, mass splitting, cross section) to cosmological observables (recoil spectra, relic density, indirect detection limits, CMB constraints). Motivated by the LZ 248 keV nuclear recoil event (September 2026) and the inelastic higgsino interpretation.

At a glance

Category

analysis, trial

Domain

particle physics

HPC dispatch

yes (IRI + Globus via hep-genesis)

Skill prefix

idm (list_idm_skills, load_idm_skill)

Default port

8008 (streamable-http)

Hosted endpoint

none

Related MCP server: bbn-mcp-server

The science

The server implements the following calculations — all with real formulas from published papers, no fitting functions or placeholders:

Calculation

Reference

Differential recoil rate (SI, inelastic)

Lewin & Smith (1996), Eq. 3.3-3.16

Helm nuclear form factor

Engel (1991), Lewin & Smith Eq. 4.7-4.11

Inelastic kinematics (v_min with mass splitting)

Fan & Reece, arXiv:2609.01504

Thermal relic density (freeze-out)

Kolb & Turner (1990), Eq. 5.26-5.29

Higgsino cross section (Z-exchange)

Fan & Reece, Eq. 8-9

Fermi-LAT dSph indirect detection limits

Ackermann et al. (2015)

CMB energy injection constraint

Planck 2018, Slatyer (2016)

Annual modulation (SHM)

Freese, Frieman, Gould (1988)

Key result

A thermal higgsino at μ ≈ 1.1 TeV with mass splitting δ ≈ 300-380 keV:

  • ✅ Gives correct relic density (Ω h² ≈ 0.12)

  • ✅ Predicts ~1-3 events in LZ extended NR search (consistent with observation)

  • ✅ Evades Fermi-LAT indirect detection (coannihilation frozen at galactic velocities)

  • ✅ Evades Planck CMB energy injection bounds

Observational data used

  • LZ: 248 ± 23 keV nuclear recoil event (arXiv:2609.02608, September 2026)

  • Planck: Ω_DM h² = 0.1200 ± 0.0012

  • Fermi-LAT: dSph 95% CL limits (Ackermann et al. 2015)

  • CMB: p_ann < 3.2×10⁻²⁸ cm³ s⁻¹ GeV⁻¹ (Planck 2018)

Tools

Tools return a JSON string. Units: m_χ in GeV, δ and recoil energies in keV, σ_n in cm², σv in cm³/s (0 = automatic higgsino value).

tool

what it does

list_idm_skills / load_idm_skill

server-side skills (also served as MCP prompts)

describe_tools

Server capabilities and physics references

predict_recoil

Differential recoil spectrum for inelastic DM on xenon (HPC-dispatchable)

compute_relic_density

Thermal freeze-out Ω h² vs Planck

check_all_constraints

All constraints simultaneously (relic + LZ + Fermi + CMB)

scan_mass_splitting

(m_χ, δ) parameter space scan → output/scan_idm.npz (HPC-dispatchable)

predict_annual_modulation

Seasonal rate variation for inelastic DM (HPC-dispatchable)

plot_recoil_spectrum

Generate spectrum plot (PNG)

plot_constraint_summary

Combined exclusion plot from scan (PNG)

set_dispatch / get_dispatch / auth_status / export_dispatch_pack

HPC dispatch (see Run on HPC)

Project structure:

tools/
  nuclear.py      — Recoil rates, form factors, inelastic kinematics (Lewin & Smith)
  cosmology.py    — Relic density, indirect detection, CMB constraints
  idm_tools.py    — science functions combining nuclear + cosmology
  idm/            — the MCP tools (__init__.py) and HPC kernels (kernels.py)
  meta/           — list_idm_skills / load_idm_skill (generic)
mcp_server/       — generic HEP-KE wrapper (server, cli, dispatch) + INSTRUCTIONS.md
skills/           — idm-tour, lz-event-inelastic-higgsino, hpc-dispatch-handoff
tests/
  test_idm.py           — physics benchmarks + tools, with assertions
  test_dispatch_pack.py — HPC pack and kernels
  test_benchmarks.py, test_cosmology.py — print-style benchmark scripts
  test_contract.py, smoke_server.py     — generic contract + live smoke test

Skills

skill

use it to

idm-tour

a guided first run through every tool for the 1.1 TeV / 350 keV benchmark

lz-event-inelastic-higgsino

test whether an inelastic WIMP explains the LZ 248 keV event: relic mass, δ window, plane scan, signatures, caveats

hpc-dispatch-handoff

run the scan / spectrum / modulation kernels on ALCF Polaris or NERSC Perlmutter

Install and run

git clone https://github.com/nesar/inelastic-dm-server.git && cd inelastic-dm-server
uv sync                                  # creates this server's own .venv from uv.lock
./run_server.sh                          # stdio (what agent clients launch)
./run_server.sh --transport streamable-http --port 8008   # URL endpoint at http://127.0.0.1:8008/mcp

The server now runs on the standard MCP SDK v1 (mcp>=1.27,<2, FastMCP) from .venv; the previous .venv2 / MCPServer (SDK v2) setup is no longer used. Scan and plot outputs go to output/ under the directory the server runs in (run_server.sh runs from the repo root).

Connect a client

Claude Code (from the repo directory, .mcp.json is picked up automatically):

claude mcp add idm -- /path/to/inelastic-dm-server/run_server.sh

Hermes:

hermes config set mcp_servers.inelastic_dm.command "$HOME/github-integration/inelastic-dm-server/run_server.sh"
hermes config set mcp_servers.inelastic_dm.timeout 120
hermes mcp test inelastic_dm

Claude Desktop, Codex, ChatGPT, Antigravity and hep-genesis-agent: see the library site.

Run on HPC

Everything is fast locally for the default grids; dispatch is for dense scans and facility campaigns. Kernels are declared in tools/idm/__init__.py (DISPATCH_KERNELS) and implemented in tools/idm/kernels.py (JSON in → JSON out, numpy/scipy physics only):

kernel

backs

dispatched server-side

idm.kernels.scan_mass_splitting

scan_mass_splitting

yes

idm.kernels.recoil_spectrum

predict_recoil

yes

idm.kernels.annual_modulation

predict_annual_modulation

yes

idm.kernels.relic_density

compute_relic_density

pack only

idm.kernels.check_constraints

check_all_constraints

pack only

  • Client-side (hosted, recommended): export_dispatch_pack hands the tools/ package and the kernel manifest to the client's hep-genesis harness, which stages and submits with its own credentials.

  • Server-side (your own machine): auth_status, then set_dispatch("perlmutter" | "polaris"); the three tools above then run their kernel as one facility job (the scan still writes output/scan_idm.npz locally). Needs the hep-genesis backend in this environment (uv pip install -e <hep-genesis-agent>/backend[iri]).

No SSH, no batch scripts, no credentials in the server. Details: the hpc-dispatch-handoff skill.

Development and tests

uv sync --extra dev
uv run ruff check .
uv run pytest -m "not network and not slow"   # contract + science tests (what CI runs)
uv run pytest -m network                       # tests that download public data (none yet)
uv run python tests/smoke_server.py            # live stdio server: lists tools and prompts
python tests/test_benchmarks.py                # print-style benchmark tables

The generic files (mcp_server/, tools/meta/, tests/test_contract.py, tests/smoke_server.py, CI) come from the HEP-KE MCP server standard; do not edit them per server.

Limitations

  • A single LZ event: "consistent" means an expected count within a factor of a few of one; the expected count is extremely steep in δ (at 1.1 TeV: ~745 events at 300 keV, 2 at 350 keV, 0 at 400 keV) and depends on the Standard Halo Model parameters (v_0 = 220, v_esc = 544, v_E = 232 km/s).

  • Relic density is semi-analytic freeze-out with a ~15% theory error; consistent_within_theory_err uses that, tension_sigma uses Planck's 1%.

  • check_all_constraints' verdict covers relic + Fermi-LAT + CMB; read the LZ count from direct_detection.

  • Indirect detection uses tabulated Fermi-LAT dSph limits (no J-factor uncertainty); the CMB bound is a single p_ann limit.

  • The scan and plot tools write to fixed names in output/ (no output_dir argument); a new scan overwrites the previous one.

Citation and license

  • Fan & Reece, "The LZ anomaly as inelastic dark matter", arXiv:2609.01504

  • LZ Collaboration, "Search for new physics with an extended nuclear recoil ROI", arXiv:2609.02608

  • LZ Collaboration, "Effective field theory and inelastic interpretations", arXiv:2609.02823

  • Lewin & Smith, Astropart. Phys. 6 (1996) 87

  • Kolb & Turner, The Early Universe (1990)

  • Helm, Phys. Rev. 104 (1956) 1466

MIT license (see LICENSE).

Available Tools

14 tools
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

check_all_constraintsB

Run all constraints simultaneously: relic density + LZ + Fermi-LAT + Planck CMB.

Parameters:
    m_chi_GeV: DM mass [GeV]
    delta_keV: Mass splitting [keV]
    is_higgsino: If true, use higgsino model

Inputs: delta_keV, m_chi_GeV, is_higgsino. Returns: result

compute_relic_densityB

Compute thermal relic density and compare to Planck measurement.

Parameters:
    m_chi_GeV: DM mass [GeV]
    is_higgsino: If true, use higgsino annihilation channels
    sigma_v_cm3_s: Annihilation cross section [cm^3/s] (0 = auto)

Inputs: m_chi_GeV, is_higgsino, sigma_v_cm3_s. Returns: result

describe_toolsA

Describe this server's capabilities, the physics, and the observational data it uses. Call this first.

Inputs: no named parameters. Returns: result

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.

get_dispatchA

Report where THIS server's heavy tools currently execute.

Inputs: no named parameters. Returns: result

list_idm_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_idm_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.

plot_constraint_summaryA

Plot the combined constraint summary from a parameter space scan. Returns PNG path.

Call scan_mass_splitting first to generate the scan data.

Inputs: scan_file. Returns: result

plot_recoil_spectrumC

Generate a recoil spectrum plot comparing inelastic vs elastic. Returns PNG path.

Parameters:
    m_chi_GeV: WIMP mass [GeV]
    delta_keV: Mass splitting [keV]

Inputs: delta_keV, m_chi_GeV. Returns: result

predict_annual_modulationC

Predict annual modulation signal for inelastic DM at a given recoil energy.

Parameters:
    m_chi_GeV: WIMP mass [GeV]
    delta_keV: Mass splitting [keV]
    E_R_keV: Recoil energy [keV] (default: 248 for LZ event)

Inputs: E_R_keV, delta_keV, m_chi_GeV. Returns: result

predict_recoilA

Predict the differential recoil spectrum for (in)elastic DM on xenon.

Parameters:
    m_chi_GeV: WIMP mass [GeV] (default: 1100 for thermal higgsino)
    delta_keV: Mass splitting [keV] (default: 350, set 0 for elastic)
    sigma_n_cm2: Per-nucleon cross section [cm^2] (0 = auto for higgsino)
    is_higgsino: If true, use Z-exchange couplings and auto sigma_n

Inputs: delta_keV, m_chi_GeV, is_higgsino, sigma_n_cm2. Returns: result

scan_mass_splittingB

Scan the (m_chi, delta) parameter plane checking all constraints.

Parameters:
    m_chi_min/max: WIMP mass range [GeV]
    delta_min/max: Mass splitting range [keV]
    n_points: Grid points per axis (n_points x n_points grid)

Inputs: n_points, delta_max, delta_min, m_chi_max, +1 more. Returns: result

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.7/5.0

    Scored across 14 tools

    Disambiguation4/5

    Physics tools each target a distinct computation (recoil spectrum, relic density, constraint check, parameter scan, modulation), and the dispatch quartet is clearly separated from physics. Minor overlap exists between check_all_constraints and scan_mass_splitting (single point vs. grid) and between predict_recoil and plot_recoil_spectrum, but descriptions and dependencies resolve these. list_idm_skills/load_idm_skill vs. describe_tools are close cousins in the discovery role but still distinguishable.

    Naming Consistency4/5

    Nearly all names follow a clean verb_noun snake_case convention (predict_recoil, compute_relic_density, scan_mass_splitting, get_dispatch, set_dispatch). The only deviation is auth_status, a bare noun phrase, which breaks the verb-first pattern. get/set_dispatch pairs nicely and namespace prefixes (idm_) appear only on the skill tools, which is slightly uneven but readable.

    Tool Count5/5

    14 tools sit comfortably in the well-scoped range, with 10 physics/compute tools covering the domain and 4 justified infrastructure tools for HPC dispatch state and kernel export. Each tool has a distinct job rather than being a thin wrapper variant.

    Completeness4/5

    The surface covers the core lifecycle: predict spectra, compute relic density, check and scan constraints, plot results, plus HPC offload and skill-based recipes. Minor gaps remain — no way to retrieve numeric constraint/likelihood values as structured data (only plots), and no explicit model/parameter listing or export of scan results beyond PNGs.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      An MCP server that interfaces with the Lilith library to analyze Higgs boson phenomenology and LHC experimental data. It enables AI assistants to constrain new physics theories by calculating likelihoods and signal strengths for various particle physics scenarios.
      20
      2
      GPL 3.0
    • F
      license
      Not graded
      quality
      C
      maintenance
      Exposes Big Bang Nucleosynthesis computation and analysis tools to LLM agents, enabling them to scan parameters like baryon density, extra relativistic species, and neutron lifetime, and to fit abundances against observations.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables users to fetch, plot, and analyze public weak-lensing data vectors, redshift distributions, covariances, and published chains across DES, KiDS, and HSC surveys. Supports signal-to-noise calculations, S8 constraint comparisons, contour plots, and reproducible survey-analysis workflows.
      24
      1
      MIT