Skip to main content

Production-grade MCP server for CERN ROOT file analysis

Project description

ROOT-MCP: LLM 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.4.tar.gz (65.1 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.4-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: root_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 65.1 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.4.tar.gz
Algorithm Hash digest
SHA256 c78dbee06584f00af62ed120d718685581fcc87a6e8f80bc45ab7c265c86fe32
MD5 a44f7c9b02e0b1acf4512a3570ae41b4
BLAKE2b-256 fa6762b4d50477b9890a0a29528185f5f7ad85d39c4fcc08db437e3e2163246f

See more details on using hashes here.

Provenance

The following attestation bundles were made for root_mcp-0.1.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: root_mcp-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 73.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a330d99186ffa18953515bfa7f38667e9724b6ad3ee88e177567304349424c
MD5 41697f64cd89e712bca825eace961ec6
BLAKE2b-256 b8f1e5546b1368e835a2fa4778aa083d047857ed0484504964d54aa113a38784

See more details on using hashes here.

Provenance

The following attestation bundles were made for root_mcp-0.1.4-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