Root Mcp Server — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Root Mcp Server (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<div align="center">
<img src="https://root.cern/img/logos/ROOT_Logo/misc/generic-logo-color-512.png" alt="ROOT Logo" width="200"/>
Model Context Protocol server for executing Python and C++ code with PyROOT
</div>
Minimal MCP (Model Context Protocol) server that allows LLMs and other MCP clients to execute Python and C++ code directly using PyROOT, without HTTP endpoints or external APIs.
Below is the architecture diagram for the root_mcp_server project. The image contains a visual representation of the components and their interactions.
Architecture Diagram
Description:
root_python, root_cpp) and dispatches them to the in-process executor.This architecture keeps ROOT running in-process for low-latency execution while providing a web-backed path for interactive visualization.
pip install -e .The easiest way to use this MCP server is through VS Code with GitHub Copilot Chat.
#### 1. Install GitHub Copilot Chat extension
Make sure you have the GitHub Copilot Chat extension installed in VS Code.
#### 2. Configure MCP server in VS Code
Add the MCP server configuration to your VS Code settings. Open your settings.json (Ctrl/Cmd + Shift + P → "Preferences: Open User Settings (JSON)") and add:
{
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "Use ROOT MCP server for data analysis"
}
],
"mcp.servers": {
"root/mcp-server": {
"type": "stdio",
"command": "root_mcp_server",
"args": []
}
}
}Important: Replace /path/to/ROOT/build/bin/thisroot.sh with the actual path to your ROOT installation's thisroot.sh script.
#### 3. Use in Copilot Chat
Once configured, you can use the MCP tools in GitHub Copilot Chat:
@workspace Use #root_python to execute Python code with PyROOT@workspace Use #root_cpp to execute C++ code with ROOTThe server will automatically log executed code and results to the MCP console (visible in VS Code's Output panel).
Start the MCP server directly:
root_mcp_serverfrom mcp.client.stdio import stdio_client, StdioServerParameters
from mcp.client.session import ClientSession
server_params = StdioServerParameters(
command="bash",
args=["-lc", "source /path/to/thisroot.sh && python3 -m root_mcp_server.cli"],
env=None
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Execute Python code
result = await session.call_tool("root_python", arguments={
"code": "import ROOT; print(ROOT.gROOT.GetVersion())"
})
print(result)The server exposes two MCP tools:
root_pythonExecute Python code with ROOT automatically available in scope.
Arguments:
code (string): Python code to executeReturns:
{
"ok": boolean,
"stdout": string,
"stderr": string,
"error": string | null,
"error_type": string | null
}Example:
code = """
import ROOT
h = ROOT.TH1F("h", "Gaussian", 100, -5, 5)
for i in range(10000):
h.Fill(ROOT.gRandom.Gaus(0, 1))
print(f"Mean: {h.GetMean():.3f}")
"""root_cppExecute C++ code via ROOT's cling interpreter.
Arguments:
code (string): C++ code to executeReturns:
{
"ok": boolean,
"stdout": string,
"stderr": string,
"error": string | null,
"error_type": string | null
}Example:
TH1F* h = new TH1F("h", "Gaussian;X;Y", 100, -5, 5);
for(int i=0; i<10000; i++) h->Fill(gRandom->Gaus(0,1));
TCanvas* c = new TCanvas("c", "Canvas", 900, 600);
h->Draw();
c->Update();
std::cout << "Mean: " << h->GetMean() << std::endl;The server automatically detects C++ compilation errors by:
ROOT.gInterpreter.ProcessLine()error:, Error:, fatal error:)Errors are reported with ok=false and detailed error messages.
All code execution is logged to stderr (MCP console) with:
Example output:
============================================================
EXECUTING PYTHON CODE:
1 | import ROOT
2 | print(ROOT.gROOT.GetVersion())
============================================================
✓ EXECUTION SUCCESS
STDOUT:
6.39/01The server initializes TApplication and supports ROOT graphics:
# Test basic functionality
python test_mcp_client.py
# Test persistent graphics
python test_persistent_window.py
# Test histogram creation
python test_histogram.pyroot_mcp_server/
├── root_mcp_server/
│ ├── __init__.py
│ ├── cli.py # Entry point
│ ├── executor.py # Code execution
│ └── server.py # MCP server definition
├── test_mcp_client.py
├── test_persistent_window.py
├── test_histogram.py
└── README.mdSee LICENSE file.
Contributions are welcome! Please feel free to submit a Pull Request.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.