XRootD MCP Server
A Model Context Protocol server that lets LLMs browse, search, and analyze files on XRootD file systems, including ROOT file and dataset analysis.
List configured XRootD servers and browse directory hierarchies with pagination
Retrieve file/directory metadata, check existence, and calculate recursive directory sizes
Read file contents with optional byte-range support (up to 1 MB per call)
Search files by glob or regex pattern, with recursive search and filtering by size, date, extension, or name
Find recently modified files and summarize recent changes with detailed statistics
Compute comprehensive directory statistics (file counts, sizes, types)
Discover production campaigns and datasets
Analyze ROOT files: inspect structure, trees, and branches; extract podio metadata; get event statistics; aggregate event stats across datasets; fill branch histograms with optional cuts
Fall back to xrdcp file copies for ROOT analysis when HTTP access is unavailable
Cache directory listings with configurable TTL and size limits; enforce per-tool timeouts and result truncation
Serve over stdio or HTTP (streamable HTTP or legacy SSE) transports
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@XRootD MCP Server list the available production campaigns and recent datasets"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
XRootD MCP Server
A Model Context Protocol (MCP) server that provides access to XRootD file systems. This server allows LLMs to interact with XRootD servers to list directories, read file metadata, access file contents, and more.
Features
List directories: Browse XRootD file system hierarchy
File metadata: Get detailed information about files (size, modification time, permissions)
Read file contents: Access file data from XRootD servers with byte-range support
File operations: Check file existence, calculate directory sizes
Search & filtering: Find files by pattern (glob/regex), filter by size/date
Statistics & analytics: Comprehensive directory statistics and usage reports
Campaign discovery: List available production campaigns and datasets
Recent changes: Track newly added files and monitor production progress
ROOT file analysis: Inspect ROOT file structure, extract metadata, analyze events and collections
Dataset aggregation: Aggregate event statistics across multiple ROOT files
Protocol support: Connect to XRootD servers via root:// protocol
Related MCP server: rucio-mcp
Installation
Using Docker (Recommended)
docker pull ghcr.io/eic/xrootd-mcp-server:latest
docker run -i --rm \
-e XROOTD_SERVER="root://dtn2304.jlab.org:8443" \
-e XROOTD_BASE_DIR="/jlab-osdf-ro/eic/EPIC/volatile" \
ghcr.io/eic/xrootd-mcp-server:latestSee Docker Usage Guide for detailed instructions.
From Source
npm install
npm run buildConfiguration
Set the XRootD server URL using the XROOTD_SERVER environment variable:
export XROOTD_SERVER="root://dtn2304.jlab.org:8443"Optionally, set a base directory to restrict access and simplify paths:
export XROOTD_BASE_DIR="/jlab-osdf-ro/eic/EPIC/volatile"When XROOTD_BASE_DIR is set:
Relative paths are resolved relative to the base directory
Absolute paths must be within the base directory (access control)
For example, with base
/jlab-osdf-ro/eic/EPIC/volatile, the pathEVGENrefers to/jlab-osdf-ro/eic/EPIC/volatile/EVGEN
Transports
The server speaks stdio by default (for clients that spawn it
themselves). Two HTTP transports are available via MCP_TRANSPORT:
# Streamable HTTP: MCP endpoint at http://127.0.0.1:9102/mcp
MCP_TRANSPORT=http XROOTD_SERVER="root://dtn2304.jlab.org:8443" node build/src/index.js
# Legacy SSE: endpoints at /sse and /messages
MCP_TRANSPORT=sse XROOTD_SERVER="root://dtn2304.jlab.org:8443" node build/src/index.jsMCP_HOST (default 127.0.0.1) and MCP_PORT (default 9102) control the
bind address. The server binds loopback by default; binding any other
address prints a warning because the tools carry no authentication.
An HTTP client config then looks like:
{
"mcpServers": {
"xrootd": {
"type": "http",
"url": "http://127.0.0.1:9102/mcp"
}
}
}Caching
Directory listing results are cached for improved performance:
export XROOTD_CACHE_ENABLED=true # default: true
export XROOTD_CACHE_TTL=60 # minutes, default: 60
export XROOTD_CACHE_MAX_SIZE=1000 # max entries, default: 1000The cache uses a time-based expiration strategy (TTL):
Directory listings are cached in memory
Cache entries expire after the configured TTL
Automatic cleanup removes expired entries every 15 minutes
LRU eviction when cache size exceeds 1000 entries
Note: Cached data may be up to TTL minutes old. For production data that changes infrequently, a 60-minute TTL provides good performance with acceptable staleness.
Usage
With MCP Client
Add to your MCP client configuration:
{
"mcpServers": {
"xrootd": {
"command": "node",
"args": ["/path/to/xrootd-mcp-server/build/index.js"],
"env": {
"XROOTD_SERVER": "root://dtn2304.jlab.org:8443",
"XROOTD_BASE_DIR": "/jlab-osdf-ro/eic/EPIC/volatile",
"XROOTD_CACHE_ENABLED": "true",
"XROOTD_CACHE_TTL": "60"
}
}
}
}Available Tools
Basic File Operations:
list_directory: List contents of an XRootD directoryget_file_info: Get detailed metadata about a fileread_file: Read contents of a file (with optional byte range)check_file_exists: Check if a file or directory existsget_directory_size: Calculate total size of a directory
Advanced Search & Analysis:
search_files: Search for files by glob pattern or regexlist_directory_filtered: List directory with advanced filtering (size, date, extension, pattern)find_recent_files: Find files modified within a time periodget_statistics: Get comprehensive statistics about files in a directory
Campaign & Dataset Discovery:
list_campaigns: List available production campaignslist_datasets: List datasets within a specific campaignsummarize_recent_changes: Summarize files added in a time period with detailed statistics
Timeouts and truncation
Every tool except list_servers takes timeout (seconds; default 120, or XROOTD_TOOL_TIMEOUT).
On expiry the tool returns Error: <tool> did not finish within N s. ... with
what to try (deeper path, recursive: false, smaller range, or retry once
later: the xrootd command keeps running until it finishes). Any list in a
result stops at 1000 entries and a sibling <key>Truncated field reads
truncated: N of M entries; <how to narrow the call>; read_file returns at
most 1 MB per call and appends [truncated: N of M bytes; ...]. Expected
failures (unknown path, unknown server, HTTP access needing allow_copy)
come back as Error: ... text with isError set, not as protocol errors.
Development
# Build
npm run build
# Watch mode
npm run watchRequirements
Node.js 18 or higher
Access to an XRootD server
xrdfs command-line tool installed (from xrootd-client package)
License
MIT
Available Tools
18 toolsanalyze_root_fileA
Analyze ROOT file structure, trees, and branches. Prefers HTTP-based access; if unavailable, set allow_copy: true to fall back to xrdcp.
Inputs: path (required), server, allow_copy.
check_file_existsB
Check if a file or directory exists on an XRootD server
Inputs: path (required), server.
extract_podio_metadataA
Extract metadata from podio_metadata tree in ROOT file. Prefers HTTP-based access; if unavailable, set allow_copy: true to fall back to xrdcp.
Inputs: path (required), server, allow_copy.
find_recent_filesB
Find files modified within a time period
Inputs: path (required), hours, server, recursive.
get_branch_histogramA
Fill a histogram of a TTree branch and return bin edges and counts. Prefers HTTP-based access; if unavailable, set allow_copy: true to fall back to xrdcp.
Inputs: path (required), branch (required), cut, bins, +5 more.
get_dataset_event_statisticsA
Aggregate event statistics across all ROOT files in a dataset. Prefers HTTP-based access; if unavailable, set allow_copy: true to fall back to xrdcp.
Inputs: path (required), server, allow_copy.
get_directory_sizeA
Calculate total size of a directory (recursively)
Inputs: path (required), server.
get_event_statisticsB
Get event statistics and collection info from ROOT file. Prefers HTTP-based access; if unavailable, set allow_copy: true to fall back to xrdcp.
Inputs: path (required), server, allow_copy.
get_file_infoC
Get detailed metadata about a file or directory
Inputs: path (required), server.
get_statisticsC
Get comprehensive statistics about files in a directory
Inputs: path (required), server, recursive.
list_campaignsC
List available production campaigns
Inputs: server, recoPath.
list_datasetsB
List datasets within a campaign
Inputs: campaign (required), server, recoPath.
list_directoryC
List contents of a directory on an XRootD server
Inputs: path (required), limit, offset, server.
list_directory_filteredC
List directory with advanced filtering options
Inputs: path (required), server, maxSize, minSize, +4 more.
list_serversA
List all configured XRootD servers
Inputs: no named parameters.
read_fileB
Read contents of a file from an XRootD server (supports byte ranges)
Inputs: path (required), end, start, server.
search_filesB
Search for files by pattern (glob or regex)
Inputs: pattern (required), server, basePath, useRegex, +1 more.
summarize_recent_changesC
Summarize files added in a time period with statistics
Inputs: path (required), hours, server.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool has a distinct purpose, covering file operations, ROOT file analysis, and dataset management. Overlap is minimal or non-existent.
All tool names follow a consistent verb_noun pattern in snake_case, making them predictable and easy to navigate.
18 tools is well-scoped for XRootD file access and ROOT analysis, covering all essential operations without being excessive.
The tool set covers core CRUD-like operations (read, list, search) and ROOT analysis. Minor gaps like file creation or advanced queries are acceptable given the focus on access and analysis.
Maintenance
Related MCP Connectors
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Browse and manage files in your Moxt AI workspace from any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that connects LLMs to CERN GitLab to discover and analyze High Energy Physics code, documentation, and analysis examples. It provides 14 tools for repository browsing, dependency parsing, and CI/CD configuration analysis.1554 PyPI4AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that exposes Rucio distributed data management operations as tools for LLMs. Designed for ATLAS physicists working with grid data on analysis facilities, but usable with any Rucio instance.6Apache 2.0
- AlicenseAqualityBmaintenanceAn MCP server and CLI tool that allow LLMs to interact with CERN ROOT files.944 PyPI4MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides file and directory tools for LLMs, including project structure analysis, file reading, and project context resources, with support for .gitignore patterns.MIT