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 分