ROOT MCP Server logo

ROOT MCP Server

Executes Python with PyROOT and C++ through ROOT’s Cling interpreter over stdio.

Install ROOT MCP Server

Run the project’s own setup commands, in order.

Setup steps from the project

ROOT MCP Server installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    pip install -e .
    

Overview

ROOT MCP Server MCP server lets MCP clients execute Python and C++ code inside an in-process ROOT runtime. It provides `root_python` with PyROOT available and `root_cpp` through ROOT’s Cling interpreter, returning stdout, stderr, and error metadata. ROOT graphics objects such as canvases are supported, with optional interactive access through ROOT’s embedded HTTP server. Reach for it when an agent needs ROOT-based data analysis, histogram work, C++ snippets, or interactive plots.

Use cases

  • Run ROOT data analysis with Python
  • Execute C++ snippets through Cling
  • Create and inspect ROOT histograms
  • Generate interactive ROOT canvases
  • Diagnose C++ interpreter errors

Key features

  • PyROOT-enabled Python execution
  • ROOT Cling C++ execution
  • Structured stdout and error results
  • In-process execution
  • ROOT canvas and graphics support
  • MCP console logging

Tools1

What ROOT MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~1 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 84d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit1y agoMost recent push to the default branch.
Tools exposed1Callable tools this server registers over MCP.

How ROOT MCP Server works

What ROOT MCP Server MCP server does

ROOT MCP Server MCP server connects MCP clients to CERN ROOT through PyROOT and ROOT’s Cling interpreter. It accepts code execution requests over stdio and runs them in the server’s process rather than through HTTP endpoints or external APIs.

The Python path makes ROOT available to executed Python code. The C++ path sends code to Cling, ROOT’s interactive C++ interpreter. Both tools return a structured result containing an ok status, standard output, standard error, and optional error text and error type.

This fits workflows involving ROOT data analysis, histogram creation, statistical calculations, C++ experiments, and ROOT visualization. It also supports TCanvas and other graphics objects, including an event loop for interactive graphics.

How it works

A FastMCP server receives tool calls from an MCP client and dispatches them to an in-process executor. The executor keeps the ROOT runtime in the same process while running either Python or C++ code. This avoids a separate subprocess for each request, but it also means executed code is not isolated from the server process.

For C++ execution, the server checks ROOT interpreter return codes and scans standard error for common compilation-error indicators. Failed calls are reported with ok=false and diagnostic details. Execution activity is written to the MCP console, including numbered code, status, and captured output.

When graphics are enabled, ROOT canvases can remain available through ROOT’s graphics handling. The project describes an embedded THttpServer and JSROOT-based web path for opening interactive canvases at an HTTP endpoint.

Setup and configuration

The server requires ROOT 6.x or later with PyROOT enabled, plus Python 3.10 or newer. Install the package from a checkout with:

Terminal
pip install -e .

Start it from the command line with root_mcp_server. For programmatic use, an MCP stdio client can launch python3 -m root_mcp_server.cli after sourcing ROOT’s thisroot.sh script. The documented VS Code configuration uses a stdio server entry with root_mcp_server as the command. The ROOT installation path must be replaced with the path appropriate to the local installation when using the shell-based launch method.

Tools and capabilities

  • root_python: Executes a supplied Python string with ROOT available through PyROOT.
  • root_cpp: Executes a supplied C++ string through ROOT’s Cling interpreter.
  • Structured execution results: Reports success, stdout, stderr, error text, and error type.
  • C++ error reporting: Uses interpreter return codes and stderr inspection to identify compilation failures.
  • ROOT graphics: Supports canvases, histograms, event-loop behavior, and interactive canvas access through the documented web path.
  • Console diagnostics: Logs the executed code and its result to the MCP console.

Limitations and notes

ROOT MCP Server MCP server runs submitted code in-process and does not provide subprocess isolation. The material does not describe authentication, access control, sandboxing, or a remote deployment mode. It expects a local ROOT installation with PyROOT enabled; installing the Python package alone does not supply ROOT.

The repository’s examples and configuration use the tool names root_python and root_cpp.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about ROOT MCP Server

ROOT MCP Server is an MCP server that connects clients to CERN ROOT through PyROOT and ROOT’s Cling interpreter. Its main tools are `root_python` for Python execution and `root_cpp` for C++ execution. Both return stdout, stderr, status, and error metadata, while ROOT graphics can support interactive canvases.

Install it with `pip install -e .` from a repository checkout. You must already have ROOT 6.x or later with PyROOT enabled and Python 3.10 or newer. Start the installed command with `root_mcp_server`.

Add a stdio MCP entry whose command is `root_mcp_server` to VS Code settings. The documented workflow uses GitHub Copilot Chat and invokes `root_python` or `root_cpp` from chat. Ensure the configuration references the correct ROOT installation setup.

Yes, it executes C++ through ROOT’s Cling interpreter using the `root_cpp` tool. The tool accepts a code string and returns execution status, output, and diagnostic fields. Compilation failures are detected from interpreter return codes and stderr.

Yes, it supports ROOT graphics objects including `TCanvas`, histogram plotting, and event-loop behavior. When graphics are enabled, the documented architecture can expose canvases through an embedded ROOT HTTP server for interactive inspection.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewROOT MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/root-mcp-server?style=directory)](https://allmcps.com/mcp/root-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/root-mcp-server"><img src="https://allmcps.com/api/badge/root-mcp-server?style=directory" alt="ROOT MCP Server on AllMCPs" /></a>