# ROOT MCP Server [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/omazapa/root_mcp_server  
**GitHub Stars:** 1  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/root-mcp-server

## Description
ROOT-based MCP server exposing root_python and root_cpp tools (stdio transport).

## Tools
Capabilities this server exposes over MCP:

- **code**

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/omazapa/root_mcp_server), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
pip install -e .
```

## Documentation

## 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:

```bash
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`.

_Full upstream README: https://allmcps.com/mcp/root-mcp-server/readme_

