Xraylib Mcp Server

io.github.tschoonj由 GitHub 账号 tschoonj 发布v0.1.6更新于 Oct 24, 2026

MCP server providing X-ray interaction data via xraylib

已验证STDIO仅桌面数据与分析AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器,通过 xraylib 提供 X 射线相互作用数据,让助手计算截面、荧光谱线、吸收边能量等物理量。

可以做什么
  • 在原子序数与元素符号之间转换,并查询原子量、密度、电子排布和解析化学式
  • 计算荧光谱线与吸收边能量、荧光产额、跃迁因子、辐射速率和原子能级宽度
  • 计算元素与化合物的质量截面和原子截面,包括荧光截面与 Kissel 光电离变体
  • 计算微分截面、瑞利与康普顿散射因子、反常散射因子和康普顿分布
  • 查询俄歇与 Coster-Kronig 跃迁速率和概率、折射率实部与虚部,以及内置 NIST 化合物与放射性核素数据
  • 列出有效的谱线、壳层、跃迁、俄歇和 NIST 化合物常量名称
适用场景
适用于 X 射线物理、光谱学、材料分析或探测器建模等工作,希望助手直接查询或计算 xraylib 数值而不必自己写脚本时。适合能启动本地进程的桌面客户端。
运行要求
以本地进程运行,仅限桌面端,无网页版。可通过 PyPI 包用 uvx 或 pip 安装,或运行已发布的 Docker 镜像;未声明认证、环境变量或请求头。
安装前请注意
该服务器只提供只读的参考与计算数据,未声明任何凭据,风险较低;但仅限桌面端,无法在网页客户端使用。结果依赖内置的 xraylib 数据,用于科研时应自行核对。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Xraylib Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

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)

bash
uv tool install xraylib-mcp-server

Using pip

bash
pip install xraylib-mcp-server

Usage

As a standalone server

bash
# Run with stdio transport (for Claude Desktop, etc.)xraylib-mcp-server
# Run with HTTP transportxraylib-mcp-server --transport http --port 8000
# Run with SSE transportxraylib-mcp-server --transport sse --port 8000

With Claude Desktop

Add to your Claude Desktop configuration:

json
{  "mcpServers": {    "xraylib": {      "command": "uvx",      "args": ["xraylib-mcp-server"]    }  }}

Or using the pre-built Docker image:

json
{  "mcpServers": {    "xraylib": {      "command": "docker",      "args": ["run", "-i", "--rm", "ghcr.io/tschoonj/xraylib-mcp-server:latest"]    }  }}

With VS Code

Add to your VS Code settings (.vscode/settings.json or user settings):

json
{  "mcp.servers": {    "xraylib": {      "command": "uvx",      "args": ["xraylib-mcp-server"]    }  }}

Or using the pre-built Docker image:

json
{  "mcp.servers": {    "xraylib": {      "command": "docker",      "args": ["run", "-i", "--rm", "ghcr.io/tschoonj/xraylib-mcp-server:latest"]    }  }}

With Claude Code

Add the server using the CLI:

bash
claude mcp add xraylib -- uvx xraylib-mcp-server

Or using the pre-built Docker image:

bash
claude mcp add xraylib -- docker run -i --rm ghcr.io/tschoonj/xraylib-mcp-server:latest

As a development server

bash
# Run in development mode with MCP inspectoruv run mcp dev src/xraylib_mcp_server/server.py

Using Docker

Pre-built images from GitHub Container Registry
bash
# Pull the latest imagedocker pull ghcr.io/tschoonj/xraylib-mcp-server:latest
# Run with stdio transportdocker run -i --rm ghcr.io/tschoonj/xraylib-mcp-server:latest
# Run with HTTP transport on port 8000docker run --rm -p 8000:8000 ghcr.io/tschoonj/xraylib-mcp-server:latest xraylib-mcp-server --transport http --port 8000
# Use a specific versiondocker pull ghcr.io/tschoonj/xraylib-mcp-server:0.1.0docker run -i --rm ghcr.io/tschoonj/xraylib-mcp-server:0.1.0
Local development with Docker
bash
# Build the Docker image locallydocker build -t xraylib-mcp-server .
# Run with stdio transportdocker run -i --rm xraylib-mcp-server
# Run with HTTP transport on port 8000docker run --rm -p 8000:8000 xraylib-mcp-server xraylib-mcp-server --transport http --port 8000

Development

Setup

bash
# Clone the repositorygit clone https://github.com/tschoonj/xraylib-mcp-server.gitcd xraylib-mcp-server
# Install development dependenciesuv sync --dev

Running tests

bash
# Run all testsuv run pytest
# Run with coverageuv run pytest --cov=src/xraylib_mcp_server --cov-report=html

Code quality

bash
# Lintuv run ruff check .
# Formatuv run ruff format .
# Type checkuv run mypy src/ --ignore-missing-imports

License

BSD 3-Clause License -- see LICENSE for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

来源:README.md,提交 caee27b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.6最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分