xraylarch-mcp
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., "@xraylarch-mcpLoad fe_foil.xdi and show normalized XANES"
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.
xraylarch-mcp
MCP (Model Context Protocol) server that wraps xraylarch for X-ray spectroscopy analysis. Load, process, analyze, and plot XAS/XAFS spectra through Claude Desktop or Claude Code with natural language tool calls. Supports XANES normalization, EXAFS extraction, Fourier transforms, linear combination fitting, PCA, FEFFIT shell fitting, and publication-quality plotting.
Installation
pip install xraylarch-mcpRelated MCP server: fdmnes-mcp
Configuration
Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"xraylarch": {
"command": "python",
"args": ["-m", "xraylarch_mcp"]
}
}
}Claude Code
claude mcp add xraylarch -- python -m xraylarch_mcpQuick Start
Ask Claude:
"Load the spectrum at ~/data/fe_foil.xdi and show me the normalized XANES"
Claude will:
Call
larch_load_spectrumto read your dataCall
larch_normalizeto perform pre-edge subtraction and normalizationCall
larch_plotwithplot_type="norm"to generate a publication-quality plot
Tool Reference
I/O Tools
Tool | Description |
| Load a spectrum from file (.xdi, .dat, .csv, .prj, etc.) |
| Read/inspect Athena project files |
| List all loaded spectrum groups |
| Detailed view of a group's arrays and scalars |
| Remove a group to free memory |
XAFS Analysis Tools
Tool | Description |
| Pre-edge subtraction and normalization (wraps |
| EXAFS background removal (AUTOBK algorithm) |
| Forward Fourier transform: chi(k) -> chi(R) |
| Back Fourier transform: chi(R) -> chi(q) |
| Fluorescence self-absorption correction |
| MBACK normalization (alternative for problematic data) |
| Noise estimation in chi(k) and chi(R) |
| Cauchy wavelet transform for simultaneous k- and R-resolution |
| Rebin to standard 3-region XAFS energy grid |
Plot Tools
Tool | Description |
| Publication-quality plots (mu, norm, flat, dmude, chi_k, chi_r, chi_q, cauchy_wavelet) |
Math Tools
Tool | Description |
| Smooth arrays with Lorentzian/Gaussian/Voigt kernel |
| Numerical derivative |
| Interpolate onto new energy grid |
| Merge/average multiple spectra |
| Remove glitch points |
Fitting Tools
Tool | Description |
| Linear combination fitting against standards |
| Principal Component Analysis |
| FEFFIT EXAFS shell fitting |
| Peak fitting (Gaussian, Voigt, etc.) |
Interactive Tools
Tool | Description |
| Open an interactive HTML page to tune normalization parameters |
| Apply normalization parameters from a saved JSON file |
Interactive normalization workflow
Ask Claude to interactively normalize your spectrum
An HTML page opens in your browser with Plotly.js plots and sliders
Adjust E0, pre-edge range, post-edge range, and polynomial degree — plots update in real time
Click Save Parameters to download a JSON file, or Copy to Clipboard
Tell Claude to apply the saved parameters
"Load Pdfoil.prj and let me interactively choose the normalization parameters"
Advanced
Tool | Description |
| Execute arbitrary Python code in the larch session |
Resources
The server exposes documentation resources that Claude can read on demand:
larch://docs/xafs— XAFS analysis referencelarch://docs/io— I/O functions referencelarch://docs/fitting— Fitting referencelarch://docs/feff— FEFF interface referencelarch://docs/interactive— Interactive tools referencelarch://docs/examples/xanes— XANES workflow examplelarch://docs/examples/exafs— EXAFS workflow example
Links
License
BSD-3-Clause (matching xraylarch)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/Joint-Photon-Sciences-Institute/xraylarch-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server