
Xraylib Mcp Server
io.github.tschoonj由 GitHub 账号 tschoonj 发布v0.1.6更新于 Oct 24, 2026
MCP server providing X-ray interaction data via xraylib
概览
本地 MCP 服务器,通过 xraylib 提供 X 射线相互作用数据,让助手计算截面、荧光谱线、吸收边能量等物理量。
- 可以做什么
- 在原子序数与元素符号之间转换,并查询原子量、密度、电子排布和解析化学式
- 计算荧光谱线与吸收边能量、荧光产额、跃迁因子、辐射速率和原子能级宽度
- 计算元素与化合物的质量截面和原子截面,包括荧光截面与 Kissel 光电离变体
- 计算微分截面、瑞利与康普顿散射因子、反常散射因子和康普顿分布
- 查询俄歇与 Coster-Kronig 跃迁速率和概率、折射率实部与虚部,以及内置 NIST 化合物与放射性核素数据
- 列出有效的谱线、壳层、跃迁、俄歇和 NIST 化合物常量名称
- 适用场景
- 适用于 X 射线物理、光谱学、材料分析或探测器建模等工作,希望助手直接查询或计算 xraylib 数值而不必自己写脚本时。适合能启动本地进程的桌面客户端。
- 运行要求
- 以本地进程运行,仅限桌面端,无网页版。可通过 PyPI 包用 uvx 或 pip 安装,或运行已发布的 Docker 镜像;未声明认证、环境变量或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 Xraylib Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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
来源:README.md,提交 caee27b
工具
0版本历史
1- v0.1.6最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分