root_mcp package

ROOT-MCP: Production-grade MCP server for CERN ROOT file analysis.

Provides AI models with safe, high-level access to ROOT files through the Model Context Protocol.

class root_mcp.Config(*args, **kwargs)[source]

Bases: BaseModel

Root configuration for ROOT-MCP server.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

get_default_resource()[source]

Get the first configured resource (default).

Return type:

ResourceConfig | None

get_resource(name)[source]

Get resource configuration by name.

Parameters:

name (str)

Return type:

ResourceConfig | None

root_mcp.load_config(config_path=None)[source]

Load configuration from YAML file.

After loading (or using built-in defaults when no file is found), the ROOT_MCP_DATA_PATH environment variable is checked. Any colon-separated directory paths it contains are merged into the config as resources via apply_data_paths(), exactly as if those directories had been passed via --data-path on the CLI. YAML-declared resources always take precedence over env-var paths; CLI --data-path flags (applied in main()) take precedence over both.

Config merge priority (ascending — later wins):

  1. Built-in Pydantic defaults

  2. ROOT_MCP_DATA_PATH environment variable

  3. --data-path CLI flags (applied in main())

  4. YAML config file values

Parameters:

config_path (str | Path | None) – Path to config file. If None, looks for: 1. ROOT_MCP_CONFIG env var 2. ./config.yaml 3. ~/.config/root-mcp/config.yaml

Returns:

Validated Config object

Return type:

Config

Subpackages

Submodules