Production-grade MCP server for CERN ROOT file analysis
Project description
ROOT-MCP: LLM Powered HEP Analysis
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 statisticsmode: "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
- Full Documentation: The complete guide.
- Tool Reference: Detailed API definition for all tools.
- LLM Integration Guide: How to prompt and work with the agent.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c78dbee06584f00af62ed120d718685581fcc87a6e8f80bc45ab7c265c86fe32
|
|
| MD5 |
a44f7c9b02e0b1acf4512a3570ae41b4
|
|
| BLAKE2b-256 |
fa6762b4d50477b9890a0a29528185f5f7ad85d39c4fcc08db437e3e2163246f
|
Provenance
The following attestation bundles were made for root_mcp-0.1.4.tar.gz:
Publisher:
release.yml on MohamedElashri/root-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
root_mcp-0.1.4.tar.gz -
Subject digest:
c78dbee06584f00af62ed120d718685581fcc87a6e8f80bc45ab7c265c86fe32 - Sigstore transparency entry: 832928976
- Sigstore integration time:
-
Permalink:
MohamedElashri/root-mcp@ab832c30b5ebae42561c36a4d11f31dd9dccac71 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MohamedElashri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab832c30b5ebae42561c36a4d11f31dd9dccac71 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5a330d99186ffa18953515bfa7f38667e9724b6ad3ee88e177567304349424c
|
|
| MD5 |
41697f64cd89e712bca825eace961ec6
|
|
| BLAKE2b-256 |
b8f1e5546b1368e835a2fa4778aa083d047857ed0484504964d54aa113a38784
|
Provenance
The following attestation bundles were made for root_mcp-0.1.4-py3-none-any.whl:
Publisher:
release.yml on MohamedElashri/root-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
root_mcp-0.1.4-py3-none-any.whl -
Subject digest:
f5a330d99186ffa18953515bfa7f38667e9724b6ad3ee88e177567304349424c - Sigstore transparency entry: 832928982
- Sigstore integration time:
-
Permalink:
MohamedElashri/root-mcp@ab832c30b5ebae42561c36a4d11f31dd9dccac71 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MohamedElashri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab832c30b5ebae42561c36a4d11f31dd9dccac71 -
Trigger Event:
workflow_dispatch
-
Statement type: