Skip to main content

Production-grade MCP server for CERN ROOT file analysis

Project description

ROOT-MCP: AI-Powered HEP Analysis

CI PyPI License Language

ROOT-MCP empowers Large Language Models (LLMs) to natively understand and analyze CERN ROOT files.

By exposing a set of specialized tools via the Model Context Protocol (MCP), it turns Claude (and other MCP-compliant agents) into capable physics research assistants that can:

  • Inspect ROOT file structures (Trees, Branches, Histograms)
  • Analyze data distributions (Compute Histograms, Statistics)
  • Compute kinematic quantities (invariant masses, angular correlations for Dalitz plots)
  • Visualize results directly in the chat
  • Filter data using physics cuts ("selections")

Why this matters: Instead of asking an LLM to "write a script" that you have to debug and run, you can ask the LLM to "Check the muon pT distribution in this file" and it will just do it.


Architecture

ROOT-MCP features a dual-mode architecture:

  • Core Mode: File I/O, data reading, and basic statistics
  • Extended Mode: Full analysis capabilities including fitting, kinematics, and correlations

The mode is controlled via configuration, and the server automatically loads only the components you need. Runtime mode switching is also available.

Quick Start

1. Install

pip install root-mcp

Optional: For remote file access via XRootD protocol:

pip install "root-mcp[xrootd]"

2. Configure

Create a config.yaml and set your preferred mode:

# Server settings
server:
  name: "root-mcp"
  mode: "extended"  # Options: "core" or "extended"

# Data resources
resources:
  - name: "my_analysis"
    uri: "file:///Users/me/data"
    allowed_patterns: ["*.root"]

# Security
security:
  allowed_roots:
    - "/Users/me/data"

# Output directory for exports
output:
  export_base_path: "/Users/me/exports"

Mode Selection:

  • mode: "core" - Lightweight mode for file operations and basic statistics
  • mode: "extended" - Full analysis features (histograms, fitting, kinematics, correlations)

You can switch modes at runtime using the switch_mode tool without restarting the server.

3. Run with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "root-mcp": {
      "command": "root-mcp",
      "env": {
        "ROOT_MCP_CONFIG": "/path/to/config.yaml"
      }
    }
  }
}

Documentation

Citation

If you use ROOT-MCP in your research, please cite:

@software{root_mcp,
  title = {ROOT-MCP: Production-Grade MCP Server for CERN ROOT Files},
  author = {Mohamed Elashri},
  year = {2025},
  url = {https://github.com/MohamedElashri/root-mcp}
}

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

root_mcp-0.1.3.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

root_mcp-0.1.3-py3-none-any.whl (63.4 kB view details)

Uploaded Python 3

File details

Details for the file root_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: root_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for root_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fddce14b117b273013c3b125021495528d0efd384f2fde1365d7aa6198b33280
MD5 e50a9d4c57aa9d3a61be444743c0ae84
BLAKE2b-256 c5c3804dcc48fa74916e0c890a7619e1ecc2bc35d20ad5a7912c6d4320a1b79c

See more details on using hashes here.

Provenance

The following attestation bundles were made for root_mcp-0.1.3.tar.gz:

Publisher: release.yml on MohamedElashri/root-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file root_mcp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: root_mcp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 63.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for root_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42a0a601c1153ad9c2e14fbec74ab84e8fa210ab06ab302331f440cc6f6c9a65
MD5 445b9520f3e70fff8def943dfcdc0f68
BLAKE2b-256 8aae92a957a95b83baf07fbc81494b5fd3a2cef7124b790b1c5215a5766b6729

See more details on using hashes here.

Provenance

The following attestation bundles were made for root_mcp-0.1.3-py3-none-any.whl:

Publisher: release.yml on MohamedElashri/root-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page