AI Assistant and CLI for OpenMC simulation workflows
Project description
PromptMC
OpenMC is powerful but can be painful to use: you hand-write XML, manage batch runs, and read results out of HDF5. It would be great if we could safely use AI to reduce that friction.
PromptMC does that by providing infrastructure and tooling that allows both AI LLM assistants and humans to interact with OpenMC through typed, schema-driven workflows.
It works like a grammar checker between an AI LLM assistant and OpenMC: your AI proposes a configuration, PromptMC validates XML structure and supported schema constraints before the simulator runs, and catches malformed inputs early.
Because AI hallucination is a valid concern in reactor physics, the system is designed with deterministic blast walls. Every configuration (from a human, the deterministic local planner, or AI) is validated against the same typed Pydantic schemas before it reaches the simulator.
What you can do
Most planning and schema-validation workflows work without OpenMC installed; execution, geometry-debug checks, and 2D plot rendering require OpenMC.
Without OpenMC installed:
- Describe a simulation in plain English → a validated plan and
settings.xml(the default planner uses no generative AI) - Validate XML structure and PromptMC's supported OpenMC schemas
- Drive planning and schema validation from an AI client via the MCP server
With OpenMC installed:
- Run simulations (subprocess or Python API)
- Run geometry-debug overlap checks and generate 2D slice plots inside your AI chat client
- Parse statepoint and tally outputs without touching HDF5
Installation
Prerequisites:
- Python 3.10 or higher
- Pip
PromptMC can be installed using pip. Use the following commands to install PromptMC:
pip install promptmc # core (includes CLI, MCP server, and Gemini planner)
pip install promptmc[telemetry] # + OpenTelemetry tracing
OpenMC (required for simulation execution, geometry-debug checks, and plot rendering) can be installed via Conda, Spack, Docker, or build from source per docs.openmc.org. Planning and XML/schema validation work without it.
Cross-section data (for running simulations):
pip install openmc-data-downloader
openmc_data_downloader -l TENDL-2019 -i U235 U238 O16 H1 -d cross_sections
export OPENMC_CROSS_SECTIONS=$(pwd)/cross_sections/cross_sections.xml
See installation for more details.
MCP server
PromptMC exposes a Model Context Protocol server so AI assistants can run OpenMC workflows natively — validation, plotting, execution, and result parsing from inside your LLM chat client, such as Claude Desktop, Cursor, and Google Antigravity.
Tools: openmc_validate, openmc_schema_check, openmc_template, openmc_list_templates, openmc_run, openmc_analyze, openmc_plot (2D slice, returned to the chat client), openmc_geometry_debug, openmc_check_installation, openmc_check_cross_sections.
Resources expose the configured cross-sections path, the session's tool-call history, and the bundled examples.
Setup: see the MCP server configuration guide for per-client steps (Claude Desktop/Code, Cursor, Google Antigravity, VS Code).
CLI
By default, plan uses a deterministic local planner, needing no API key, no network, no generative AI. The optional --llm flag calls Google Gemini (set GEMINI_API_KEY), which can interpret more open-ended natural-language requests. Customize the model name with GEMINI_MODEL (defaults to gemini-3.5-flash).
promptmc plan "concrete shielding calculation with 1 million particles"
promptmc plan "pin cell criticality with 50k particles" --write
promptmc template criticality --particles 10000 # generate settings.xml
promptmc validate input.xml --schema
promptmc run input.xml --threads 4 # needs OpenMC
promptmc batch batch_spec.yaml --parallel threads --workers 4
promptmc analyze ./output --json results.json
promptmc info # environment status
Full options in the CLI reference.
Safety
PromptMC is an engineering-assist tool that keeps a human in the loop. It is not a substitute for professional engineering judgment, independent verification and validation, or regulatory review, and is not for safety, licensing, or other regulated decisions. Reproducing a published benchmark is not qualification for safety analysis. Provided as-is (see LICENSE).
The goal is not autonomous reactor design; the goal is safer, faster OpenMC iteration.
Documentation
- Installation — setup paths for PromptMC, OpenMC, and nuclear data
- MCP server — connecting AI assistants (Claude Desktop/Code, Cursor, Antigravity, VS Code)
- CLI reference — commands, flags, environment variables
- Python API — scripting PromptMC
- Templates · Telemetry
- Examples · MCP example
- Roadmap · Changelog · Contributing
About
I studied nuclear engineering at MIT over 20 years ago, running MCNP 4 for my senior thesis. Though I left during my senior year, I eventually went back to university to get a degree in Computer Science, and I have spent the last 11 years working as a software engineer and site reliability engineer at a major FAANG cloud provider.
PromptMC bridges those two worlds. It is also, for me, an exploration of using agentic programming to build software for fun but still holding professional production principles and standards.
Contributions and Support
I welcome contributions! Please ensure all checks pass (pytest, ruff check, mypy src/) before opening a PR.
- License: MIT
- Documentation: GitHub Repository
- Issues and Discussions: GitHub Issues
- Roadmap: ROADMAP.md for planned features and scope.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptmc-0.3.0.tar.gz.
File metadata
- Download URL: promptmc-0.3.0.tar.gz
- Upload date:
- Size: 58.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21df10d961da6436e881e07eb84b9d4cb8f6b2a0a8196c6d2b6ad6763bad861e
|
|
| MD5 |
497b871da21e87cdc6c0ab04c8844bee
|
|
| BLAKE2b-256 |
47c2eebda00e4370747fe7df69ba2b46fdd44319e0edea7aea8eae2024ef148f
|
Provenance
The following attestation bundles were made for promptmc-0.3.0.tar.gz:
Publisher:
publish.yml on rjonace/promptmc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
promptmc-0.3.0.tar.gz -
Subject digest:
21df10d961da6436e881e07eb84b9d4cb8f6b2a0a8196c6d2b6ad6763bad861e - Sigstore transparency entry: 1784750430
- Sigstore integration time:
-
Permalink:
rjonace/promptmc@7962688acbe0d16539e9589d4364a71a964c45bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/rjonace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7962688acbe0d16539e9589d4364a71a964c45bf -
Trigger Event:
release
-
Statement type:
File details
Details for the file promptmc-0.3.0-py3-none-any.whl.
File metadata
- Download URL: promptmc-0.3.0-py3-none-any.whl
- Upload date:
- Size: 71.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a644ea5e80eef7d6e99b072507a98cc785312bf86efd1d5914e1add36f371ff
|
|
| MD5 |
fd226a605855934120aa6432741fc4b4
|
|
| BLAKE2b-256 |
ded227998b0d56c5da8a6ff8cbc69a94e87aff7cbd179c0ab0693b5438583621
|
Provenance
The following attestation bundles were made for promptmc-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on rjonace/promptmc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
promptmc-0.3.0-py3-none-any.whl -
Subject digest:
9a644ea5e80eef7d6e99b072507a98cc785312bf86efd1d5914e1add36f371ff - Sigstore transparency entry: 1784750690
- Sigstore integration time:
-
Permalink:
rjonace/promptmc@7962688acbe0d16539e9589d4364a71a964c45bf -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/rjonace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7962688acbe0d16539e9589d4364a71a964c45bf -
Trigger Event:
release
-
Statement type: