Skip to main content
Glama

Установка

Нужен установленный uv и своя лицензионная копия Serpent — бинарник и библиотека сечений в репозиторий не входят.

git clone https://github.com/ShuwiOwO/Serpent2-mcp && cd Serpent2-mcp

cp /путь/к/sss2 bin/sss2 && chmod +x bin/sss2    # свой бинарник
cp -R /путь/к/xsdata/* libraries/                # своя библиотека сечений

./setup.sh                                       # установка и настройка

setup.sh проверит окружение, перепривяжет пути внутри библиотеки, поставит Python-окружение и прогонит эталонный расчёт.

В Claude Code сервер нужно один раз одобрить (при запуске в папке или вручную через команду/mcp); OpenCode подхватывает сервер автоматически.


Related MCP server: OpenKer Modeler MCP Server

Инструменты

Инструмент

Что делает

docs_card

точный синтаксис карты или set-опции: блок из мануала, источник, примеры

docs_search

семантический поиск по документации

zaid_check

проверка на наличие нуклида в локальной библиотеке

lint

статическая проверка входа без запуска: карты, типы поверхностей, связки ene/fun/srcrate/gcu

run

запуск расчета в папке runs/ (режимы norun / smoke / full)

results

чтение и разбор _res.m и _det*.m

env_info

выводит версию Serpent2, число нуклидов в библиотеках, состояние индексов

list_cards

список известных карт и set-опций


Устройство

serpent2-mcp/
├── bin/           ← ваш бинарник (sss2)                     
├── libraries/     ← ваша библиотека сечений      
├── projects/      ← рабочие проекты
├── runs/          ← изолированные папки для запусков расчетов
├── examples/      ← эталонные задачи для проверки работоспособности
├── tools/         ← сервер, линтер, парсеры, RAG
├── datasets/      ← индекс карт + документация в markdown
├── rag_store/     ← готовый векторный индекс
├── .mcp.json      ← для Claude Code
└── opencode.json  ← для OpenCode

Документация собрана в двух версиях: wiki 2.1.x для старой версии, docs 2.2.5 — современный мануал. docs_card по умолчанию отдаёт документацию для 2.1.x.


Проверка и возможные ошибки

.venv/bin/python tools/serpent_mcp_server_test.py   # Ручной запуск MCP
.venv/bin/python tools/serpent_lint_test.py         # Проверка работы линтера
.venv/bin/python tools/serpent_results_test.py      # Проверка работы парсера выходных файлов
.venv/bin/python tools/rag_eval.py --top 5          # Проверка работоспособности RAG

Если что-то не так:

Симптом

Причина

Решение

env_info вернул NO_BINARY

нет bin/sss2

cp /путь/к/sss2 bin/sss2 && chmod +x bin/sss2

env_info вернул NO_XSDATA

пусто в libraries/

cp -R /путь/к/xsdata/* libraries/

env_info вернул ACELIB_PATHS_STALE

пути в индексе старые

./setup.sh или python3 tools/fix_library.py

docs_search вернул RAG_DEPS_MISSING

не поставлен --extra rag

uv sync --extra rag

сервер не подключается

нет .venv

./setup.sh


Available Tools

16 tools
download_data_libraryA

Start a background download of a Serpent data library into a local directory (resumable, extracts tar.gz; multi-GB transfers report progress via job_status). The download runs on THIS machine (the one hosting the MCP server). Use name from list_data_libraries, or an explicit url.

Inputs: url, dest, name, extract, +2 more. Returns: result

get_cardA

Get the exact syntax, parameter list, notes and documentation link for a Serpent input card or set option. Examples: 'surf', 'mat', 'src', 'set acelib', 'acelib', 'sb'.

Inputs: name (required). Returns: result

get_environmentA

Show detected Serpent executable, version, CLI flag style, data libraries, server configuration and documentation cache status. Call this first on a new machine or when a run fails with 'sss2 not found'.

Inputs: refresh. Returns: result

get_examplesA

List bundled Serpent input examples (pin cell, shielding, burnup, group constants, minimal sphere). With topic, return the best matching example content.

Inputs: topic. Returns: result

get_referenceA

Return the curated Serpent 2 quick reference (modes, geometry, materials, sources, detectors, burnup, group constants, CLI options, output files, pitfalls). Optionally request one topic (e.g. 'geometry', 'burnup', 'source', 'versions').

Inputs: topic. Returns: result

get_resultsB

Read and summarise Serpent output files. Defaults to the newest _res.m in the workdir; returns k-eff estimates, run parameters, integral rates and optionally detector/depletion summaries. Use variables=[...] to extract specific _res.m variables.

Inputs: file, input, workdir, max_rows, +2 more. Returns: result

job_killA

Terminate a running background job (SIGTERM, then SIGKILL for local jobs).

Inputs: job_id (required). Returns: result

job_outputB

Read more log output from a background job (tail of the run log).

Inputs: job_id (required), tail_chars. Returns: result

job_statusA

Check background job state (running/finished/failed/lost), exit code, progress and recent log output. Without job_id, list the most recent jobs.

Inputs: tail, job_id. Returns: result

list_cardsA

List all known Serpent input cards and set options, optionally filtered by kind (card|set|all). Useful for discovery when the exact name is unknown.

Inputs: kind. Returns: result

list_data_librariesA

List the official VTT Serpent nuclear data libraries that can be downloaded (ENDF/B-VII.1, JEFF-3.2, JENDL-4.0, FENDL-3.0, decay/fission-yield/photon data). Each entry has key, title, size, URL and file name.

Inputs: no named parameters. Returns: result

plot_resultsA

Draw a PNG plot from Serpent output. kind: detector (needs name), keff (k-eff per step), burnup (BU vs DAYS from _dep.m), variables (needs x and y variable names). Returns the path of the written image.

Inputs: kind (required), x, y, file, +5 more. Returns: result

runB

Start a Serpent calculation as a background job and return its job id (long runs must not block). By default the input is statically validated first; pass force=true to skip. options: extra CLI flags, e.g. ['--noplot']. omp/mpi_tasks are convenience shortcuts.

Inputs: input (required), omp, force, backend, +4 more. Returns: result

search_docsA

Full-text search across the indexed official Serpent documentation (syntax manual, user guide, appendices, wiki). kind: all|card|guide|extra|wiki. Returns matching sections with source links.

Inputs: query (required), kind, limit. Returns: result

sync_docsB

Trigger or refresh the download/index of the official Serpent documentation cache (runs in the background). Returns current sync status.

Inputs: force. Returns: result

validate_inputA

Statically validate a Serpent input file (and its includes): known cards/options, duplicate names, undefined surface/material/cell/universe references, material unit mixing, source/neutron-mode consistency and more. level=3 (or run_norun=true) also runs sss2 -noplot -norun when the executable is available and parses its exact input errors.

Inputs: text, input, level, run_norun. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 16 tools

    Disambiguation4/5

    The documentation cluster (get_reference, search_docs, get_card, list_cards, get_examples) has some conceptual proximity, but descriptions clearly differentiate curated reference vs full-text search vs single-card lookup vs discovery vs examples. The job family (job_kill, job_status, job_output) is cleanly separated by purpose, and run/get_results/plot_results target distinct lifecycle stages.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern (get_environment, search_docs, validate_input, list_cards, get_results, plot_results, download_data_library). The job_* family is internally consistent but uses noun_verb ordering, and 'run' is a bare verb, which are minor deviations from the dominant convention.

    Tool Count4/5

    16 tools is reasonable for a complex simulation domain spanning environment detection, documentation, validation, execution, job management, results, plotting and data libraries. Each tool earns its place, though the count sits at the upper edge of comfortable scope.

    Completeness4/5

    The surface covers a full workflow: environment setup, doc lookup, input validation, running, job lifecycle, results extraction, plotting and data library management. A minor gap is the absence of a tool to author/write input files or clean up/delete old jobs, but agents can work around these.

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI agents to traverse SysML v2 model graphs, query requirements, and perform impact analysis for model-based systems engineering. It allows agents to interact with plain-text models to automate documentation and refine system architectures.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to automate COMSOL Multiphysics simulations, including model management, geometry building, physics configuration, meshing, solving, and results visualization via the MCP protocol.
      MIT