{
  "markdown": "# xraylib MCP Server\n\n<!-- mcp-name: io.github.tschoonj/xraylib-mcp-server -->\n\n[![CI](https://github.com/tschoonj/xraylib-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/tschoonj/xraylib-mcp-server/actions/workflows/ci.yml)\n[![Docker Image](https://img.shields.io/badge/docker-ghcr.io%2Ftschoonj%2Fxraylib--mcp--server-blue)](https://github.com/tschoonj/xraylib-mcp-server/pkgs/container/xraylib-mcp-server)\n[![PyPI](https://img.shields.io/pypi/v/xraylib-mcp-server)](https://pypi.org/project/xraylib-mcp-server/)\n[![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD--3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nA [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that provides access to [xraylib](https://github.com/tschoonj/xraylib) X-ray interaction data through a standardized interface. Query cross-sections, fluorescence lines, edge energies, and more from any MCP-compatible client.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [As a standalone server](#as-a-standalone-server)\n  - [With Claude Desktop](#with-claude-desktop)\n  - [With VS Code](#with-vs-code)\n  - [With Claude Code](#with-claude-code)\n  - [As a development server](#as-a-development-server)\n  - [Using Docker](#using-docker)\n- [Development](#development)\n- [License](#license)\n- [Contributing](#contributing)\n\n## Features\n\nThis server exposes 104 tools organized into the following categories:\n\n### Utility tools\n- **AtomicNumberToSymbol** / **SymbolToAtomicNumber** -- convert between atomic numbers and element symbols\n- **AtomicWeight** -- atomic weight (g/mol)\n- **ElementDensity** -- element density (g/cm3)\n- **ElectronConfig** -- electron configuration for a given shell\n- **CompoundParser** -- parse chemical formulas (e.g. `SiO2`, `Ca5(PO4)3F`)\n- **Atomic_Factors** -- atomic scattering factors f0, f', f''\n\n### Line, edge, and shell properties\n- **LineEnergy** / **EdgeEnergy** -- fluorescence line and absorption edge energies (keV)\n- **FluorYield** / **JumpFactor** / **RadRate** -- fluorescence yields, jump factors, radiative rates\n- **AtomicLevelWidth** -- natural widths of atomic levels (keV)\n\n### Cross-sections (element)\n- **CS_Total**, **CS_Photo**, **CS_Rayl**, **CS_Compt**, **CS_Energy**, **CS_KN** -- mass cross-sections (cm2/g)\n- **CSb_Total**, **CSb_Photo**, **CSb_Rayl**, **CSb_Compt** -- atomic cross-sections (barn/atom)\n\n### Fluorescence cross-sections\n- **CS_FluorLine** / **CSb_FluorLine** -- line fluorescence cross-sections\n- **CS_FluorShell** / **CSb_FluorShell** -- shell fluorescence cross-sections\n- Kissel photoionization variants with full, radiative, nonradiative, and no cascade options\n\n### Differential cross-sections\n- **DCS_Rayl** / **DCS_Compt** and barn/atom variants -- unpolarized differential cross-sections\n- **DCSP_Rayl** / **DCSP_Compt** and barn/atom variants -- polarized differential cross-sections\n\n### Scattering factors\n- **FF_Rayl** / **SF_Compt** -- Rayleigh form factor and Compton scattering function\n- **MomentTransf** / **ComptonEnergy** -- momentum transfer and Compton-scattered photon energy\n- **Fi** / **Fii** -- anomalous scattering factors\n- **ComptonProfile** / **ComptonProfile_Partial** -- Compton profiles (total and per-shell)\n\n### Auger and Coster-Kronig transitions\n- **AugerRate** / **AugerYield** -- Auger transition rates and yields\n- **CosKronTransProb** -- Coster-Kronig transition probabilities\n\n### Compound cross-sections\n- All CS/CSb, DCS/DCSb, and DCSP/DCSPb variants for compounds (by chemical formula)\n- Kissel photoionization variants for compounds\n\n### Refractive index\n- **Refractive_Index_Re** / **Refractive_Index_Im** -- real and imaginary parts of the refractive index\n\n### NIST compounds\n- **GetCompoundDataNISTByName** / **GetCompoundDataNISTByIndex** / **GetCompoundDataNISTList** -- access the built-in NIST compound database\n\n### Radionuclide data\n- **GetRadioNuclideDataByName** / **GetRadioNuclideDataByIndex** / **GetRadioNuclideDataList** -- access the built-in radionuclide database (X-ray lines, intensities, gamma energies)\n\n### Constant listings\n- **ListLineConstants** / **ListShellConstants** / **ListTransitionConstants** / **ListAugerConstants** / **ListNISTCompoundConstants** -- enumerate valid constant names\n\n## Installation\n\n### Using uv (recommended)\n\n```bash\nuv tool install xraylib-mcp-server\n```\n\n### Using pip\n\n```bash\npip install xraylib-mcp-server\n```\n\n## Usage\n\n### As a standalone server\n\n```bash\n# Run with stdio transport (for Claude Desktop, etc.)\nxraylib-mcp-server\n\n# Run with HTTP transport\nxraylib-mcp-server --transport http --port 8000\n\n# Run with SSE transport\nxraylib-mcp-server --transport sse --port 8000\n```\n\n### With Claude Desktop\n\nAdd to your Claude Desktop configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"xraylib\": {\n      \"command\": \"uvx\",\n      \"args\": [\"xraylib-mcp-server\"]\n    }\n  }\n}\n```\n\nOr using the pre-built Docker image:\n\n```json\n{\n  \"mcpServers\": {\n    \"xraylib\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/tschoonj/xraylib-mcp-server:latest\"]\n    }\n  }\n}\n```\n\n### With VS Code\n\nAdd to your VS Code settings (`.vscode/settings.json` or user settings):\n\n```json\n{\n  \"mcp.servers\": {\n    \"xraylib\": {\n      \"command\": \"uvx\",\n      \"args\": [\"xraylib-mcp-server\"]\n    }\n  }\n}\n```\n\nOr using the pre-built Docker image:\n\n```json\n{\n  \"mcp.servers\": {\n    \"xraylib\": {\n      \"command\": \"docker\",\n      \"args\": [\"run\", \"-i\", \"--rm\", \"ghcr.io/tschoonj/xraylib-mcp-server:latest\"]\n    }\n  }\n}\n```\n\n### With Claude Code\n\nAdd the server using the CLI:\n\n```bash\nclaude mcp add xraylib -- uvx xraylib-mcp-server\n```\n\nOr using the pre-built Docker image:\n\n```bash\nclaude mcp add xraylib -- docker run -i --rm ghcr.io/tschoonj/xraylib-mcp-server:latest\n```\n\n### As a development server\n\n```bash\n# Run in development mode with MCP inspector\nuv run mcp dev src/xraylib_mcp_server/server.py\n```\n\n### Using Docker\n\n#### Pre-built images from GitHub Container Registry\n\n```bash\n# Pull the latest image\ndocker pull ghcr.io/tschoonj/xraylib-mcp-server:latest\n\n# Run with stdio transport\ndocker run -i --rm ghcr.io/tschoonj/xraylib-mcp-server:latest\n\n# Run with HTTP transport on port 8000\ndocker run --rm -p 8000:8000 ghcr.io/tschoonj/xraylib-mcp-server:latest xraylib-mcp-server --transport http --port 8000\n\n# Use a specific version\ndocker pull ghcr.io/tschoonj/xraylib-mcp-server:0.1.0\ndocker run -i --rm ghcr.io/tschoonj/xraylib-mcp-server:0.1.0\n```\n\n#### Local development with Docker\n\n```bash\n# Build the Docker image locally\ndocker build -t xraylib-mcp-server .\n\n# Run with stdio transport\ndocker run -i --rm xraylib-mcp-server\n\n# Run with HTTP transport on port 8000\ndocker run --rm -p 8000:8000 xraylib-mcp-server xraylib-mcp-server --transport http --port 8000\n```\n\n## Development\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/tschoonj/xraylib-mcp-server.git\ncd xraylib-mcp-server\n\n# Install development dependencies\nuv sync --dev\n```\n\n### Running tests\n\n```bash\n# Run all tests\nuv run pytest\n\n# Run with coverage\nuv run pytest --cov=src/xraylib_mcp_server --cov-report=html\n```\n\n### Code quality\n\n```bash\n# Lint\nuv run ruff check .\n\n# Format\nuv run ruff format .\n\n# Type check\nuv run mypy src/ --ignore-missing-imports\n```\n\n## License\n\nBSD 3-Clause License -- see [LICENSE](LICENSE) for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Run the test suite\n6. Submit a pull request\n",
  "bytes": 7580,
  "sha": "37c611bc85fa572a197165922ad4e91baaf76656316cbd6d9a02a86117e8cf33",
  "repo_slug": "tschoonj/xraylib-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_tschoonj_xraylib_mcp_server_dd6ec6d9/readme"
}