MCP Refana Server
Click on "Install 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., "@MCP Refana ServerCount signal and background events in (100,105) MeV/c and (700,1700) ns for electrons"
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.
MCP Refana Server
Model Context Protocol (MCP) server for Mu2e refana analysis workflows. Exposes core analysis functions as MCP tools for integration with agentic frameworks.
Environment Setup
This project requires the Mu2e analysis environment. On Mu2e gpvm's, activate the environment first:
source /cvmfs/mu2e.opensciencegrid.org/env/ana/current/bin/activateThis provides:
pyutils- Python interface to EventNtupleuproot- ROOT file handlingawkward- Ragged array supportnumpy,scipy,scikit-learn,xgboost,matplotlib
Related MCP server: rucio-mcp
Features
Event Counting: Signal/background extraction in kinematic regions
Cut Analysis: Definition and application of analysis cuts
Sensitivity Computation: Discovery significance, CLs limits, Feldman-Cousins intervals
ML Selection: BDT-based signal/background discrimination setup
Analysis Summaries: Dataset-level analysis results
Installation
# Activate Mu2e analysis environment
source /cvmfs/mu2e.opensciencegrid.org/env/ana/current/bin/activate
# Install mcp-refana in development mode
cd mcp-refana
pip install -e .Running the Server
Important: Always activate the Mu2e environment before running.
# Source Mu2e environment
source /cvmfs/mu2e.opensciencegrid.org/env/ana/current/bin/activate
# Start server with stdio transport (default)
mcp-refana-server --transport stdioOr with HTTP transport:
source /cvmfs/mu2e.opensciencegrid.org/env/ana/current/bin/activate
mcp-refana-server --transport streamable-httpAvailable Tools
healthcheck()
Returns server status.
count_signal_background(mom_list, time_list, mc_list, mom_range, time_range, sign)
Extract signal and background event counts in a defined kinematic window.
Parameters:
mom_list: Reconstructed momentum valuestime_list: Reconstructed time valuesmc_list: MC truth labelsmom_range: [min, max] momentum windowtime_range: [min, max] time windowsign: "minus" (electrons) or "plus" (positrons)
Returns: Signal/background counts and statistics
analyze_cuts(cut_definitions, sign)
Initialize analysis cut configuration.
compute_sensitivity(s_expected, b_expected, b_sys_uncertainty, exposure, efficiency)
Compute physics sensitivity metrics:
Asimov significance Z
95% CLs upper limit
90% Feldman-Cousins confidence interval
initialize_ml_selector()
Set up machine learning event selector.
get_cut_efficiency(cuts_applied, n_total, n_surviving)
Calculate efficiency metrics for applied cuts.
summarize_analysis(dataset_name, sign, n_events_processed, signal_count, background_count, ml_score_mean)
Generate analysis summary for a dataset.
Integration with HEP-Multiagent
Register this server in the multiagent's config.py:
"refana": {
"command": ["mcp-refana-server", "--transport", "stdio"],
"description": "Mu2e refana analysis server",
}Then use in worker nodes for agentic analysis workflows.
Architecture
src/mcp_refana/
├── __init__.py
├── server.py # FastMCP server setup
└── mcp_tools/
├── __init__.py
└── refana_wrappers.py # Tool definitions wrapping refana codeThe server wraps the core refana analysis classes (Count, Analyze, MLSelect, SensitivityAnalyzer) as MCP tools, making them accessible to agents via tool calls.
Dependencies
mcp: Model Context Protocol framework
refana: Core analysis code (count, analyze, ML selection, sensitivity)
numpy, scipy: Numerical computing
scikit-learn, xgboost: Machine learning
uproot, awkward: ROOT file handling
matplotlib: Visualization
Development
Run tests:
pytest tests/Format code:
ruff check . --fixContact
Sophie Middleton, Huma Jafree
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceAn 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.154AGPL 3.0
- Alicense-qualityBmaintenanceAn 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.5Apache 2.0
- AlicenseBqualityCmaintenanceAn MCP server and CLI tool that allow LLMs to interact with CERN ROOT files.93MIT
- Flicense-qualityDmaintenanceEnables file system operations, web scraping, and AI-powered search through MCP tools for use by LLM agents.1
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sophiemiddleton/mcp-refana'
If you have feedback or need assistance with the MCP directory API, please join our Discord server