
Xraylib Mcp Server
io.github.tschoonjPublished by GitHub account tschoonjv0.1.6Updated Oct 24, 2026
MCP server providing X-ray interaction data via xraylib
Overview
Local MCP server exposing xraylib X-ray interaction data, letting an assistant compute cross-sections, fluorescence lines, edge energies and related physics…
- What you can do
- Convert between atomic numbers and element symbols, and look up atomic weights, densities, electron configurations and parsed chemical formulas
- Compute fluorescence line and absorption edge energies, fluorescence yields, jump factors, radiative rates and atomic level widths
- Calculate element and compound mass and atomic cross-sections, including fluorescence and Kissel photoionization variants
- Compute differential cross-sections, Rayleigh and Compton scattering factors, anomalous scattering factors and Compton profiles
- Look up Auger and Coster-Kronig rates and probabilities, refractive index parts, and built-in NIST compound and radionuclide data
- List valid line, shell, transition, Auger…
- When to use it
- Useful when working on X-ray physics, spectroscopy, materials analysis or detector modelling and you want an assistant to look up or compute xraylib values instead of writing scripts. It suits desktop clients that can launch a local process.
- Requirements
- Runs as a local process on the user's machine (desktop only, no web executable). Install via uvx or pip from the PyPI package, or run the published Docker image; no authentication, environment variables or headers are declared.
Installation
In SourceWeft
- Open Xraylib Mcp Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
xraylib MCP Server
[CI] [Docker Image] [PyPI] [License: BSD-3-Clause]
A Model Context Protocol (MCP) server that provides access to xraylib X-ray interaction data through a standardized interface. Query cross-sections, fluorescence lines, edge energies, and more from any MCP-compatible client.
Table of Contents
Features
This server exposes 104 tools organized into the following categories:
Utility tools
- AtomicNumberToSymbol / SymbolToAtomicNumber -- convert between atomic numbers and element symbols
- AtomicWeight -- atomic weight (g/mol)
- ElementDensity -- element density (g/cm3)
- ElectronConfig -- electron configuration for a given shell
- CompoundParser -- parse chemical formulas (e.g.
SiO2,Ca5(PO4)3F) - Atomic_Factors -- atomic scattering factors f0, f', f''
Line, edge, and shell properties
- LineEnergy / EdgeEnergy -- fluorescence line and absorption edge energies (keV)
- FluorYield / JumpFactor / RadRate -- fluorescence yields, jump factors, radiative rates
- AtomicLevelWidth -- natural widths of atomic levels (keV)
Cross-sections (element)
- CS_Total, CS_Photo, CS_Rayl, CS_Compt, CS_Energy, CS_KN -- mass cross-sections (cm2/g)
- CSb_Total, CSb_Photo, CSb_Rayl, CSb_Compt -- atomic cross-sections (barn/atom)
Fluorescence cross-sections
- CS_FluorLine / CSb_FluorLine -- line fluorescence cross-sections
- CS_FluorShell / CSb_FluorShell -- shell fluorescence cross-sections
- Kissel photoionization variants with full, radiative, nonradiative, and no cascade options
Differential cross-sections
- DCS_Rayl / DCS_Compt and barn/atom variants -- unpolarized differential cross-sections
- DCSP_Rayl / DCSP_Compt and barn/atom variants -- polarized differential cross-sections
Scattering factors
- FF_Rayl / SF_Compt -- Rayleigh form factor and Compton scattering function
- MomentTransf / ComptonEnergy -- momentum transfer and Compton-scattered photon energy
- Fi / Fii -- anomalous scattering factors
- ComptonProfile / ComptonProfile_Partial -- Compton profiles (total and per-shell)
Auger and Coster-Kronig transitions
- AugerRate / AugerYield -- Auger transition rates and yields
- CosKronTransProb -- Coster-Kronig transition probabilities
Compound cross-sections
- All CS/CSb, DCS/DCSb, and DCSP/DCSPb variants for compounds (by chemical formula)
- Kissel photoionization variants for compounds
Refractive index
- Refractive_Index_Re / Refractive_Index_Im -- real and imaginary parts of the refractive index
NIST compounds
- GetCompoundDataNISTByName / GetCompoundDataNISTByIndex / GetCompoundDataNISTList -- access the built-in NIST compound database
Radionuclide data
- GetRadioNuclideDataByName / GetRadioNuclideDataByIndex / GetRadioNuclideDataList -- access the built-in radionuclide database (X-ray lines, intensities, gamma energies)
Constant listings
- ListLineConstants / ListShellConstants / ListTransitionConstants / ListAugerConstants / ListNISTCompoundConstants -- enumerate valid constant names
Installation
Using uv (recommended)
Using pip
Usage
As a standalone server
With Claude Desktop
Add to your Claude Desktop configuration:
Or using the pre-built Docker image:
With VS Code
Add to your VS Code settings (.vscode/settings.json or user settings):
Or using the pre-built Docker image:
With Claude Code
Add the server using the CLI:
Or using the pre-built Docker image:
As a development server
Using Docker
Pre-built images from GitHub Container Registry
Local development with Docker
Development
Setup
Running tests
Code quality
License
BSD 3-Clause License -- see LICENSE for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
Source: README.md at commit caee27b
Tools
0Version history
1- v0.1.6LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts