CFAST MCP
# CFAST MCP
[](https://github.com/bewygs/cfast-mcp/actions/workflows/test.yml)
[](https://results.pre-commit.ci/latest/github/bewygs/cfast-mcp/main)
[](https://github.com/astral-sh/uv)
[](https://github.com/astral-sh/ruff)
[](https://github.com/python/mypy)
[](https://pypi.org/project/cfast-mcp/)
[](https://pypi.org/project/cfast-mcp/)
[](https://codecov.io/gh/bewygs/cfast-mcp)
[](https://github.com/bewygs/cfast-mcp/blob/main/LICENSE)
[](https://huggingface.co/spaces/bewygs/fire-simulation-assistant)
**CFAST MCP** is an [MCP](https://modelcontextprotocol.io/) server that lets an AI assistant build, run, and analyze [**CFAST**](https://pages.nist.gov/cfast/) (Consolidated Fire and Smoke Transport, NIST) fire simulations through conversation. It is built on top of [**PyCFAST**](https://github.com/bewygs/pycfast) and exposes the **CFAST** model as a set of tools. The AI assistant is able to create a model, add compartments, materials, vents, fires and devices step by step, run CFAST, and make summaries of the results.
## Live demo
A live demo using the MCP server is available on Hugging Face Spaces. You can try it out without any installation:
[](https://huggingface.co/spaces/bewygs/fire-simulation-assistant)
## Example
Ask your assistant something like:
> Create a 4 m × 3 m × 2.5 m room with a door (0.9 × 2 m) to the outside and a fire
> growing to 1 MW in 300 s. Run it and give me the peak upper-layer temperature then
> show me the folder where you create the file, so I can inspect it.
Results will probably look like this:
<img width="1920" height="944" alt="image" src="https://github.com/user-attachments/assets/9f4c87b3-c722-4153-b75b-53c75f9cb70e" />
## Tools
| Group | Tools |
|---|---|
| Create & configure | `create_model`, `update_simulation` |
| Components | `add_*` / `update_*` for materials, compartments, wall vents, ceiling/floor vents, mechanical vents, fires, devices (targets & detectors), surface connections |
| Inspect | `inspect_model` (summary, optional `.in` file), `get_model_files` |
| Run & results | `run_model`, `get_results` (bounded previews and per-column min/max/final stats) |
Results are returned to the AI assistant as small text summaries. The generated files (`.in`, output `.csv`, logs) are written in a temporary directory while the session is active. Use `get_model_files` to locate them if you want to open them directly.
> **Note:** models live in memory for the lifetime of the server process. Restarting the server (or your MCP client) will delete them.
## Installation
Requires **Python 3.10+** and **CFAST 7.7.0+**.
### uvx (Recommended)
Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then add `cfast-mcp` directly in your client configuration:
```json
{
"mcpServers": {
"cfast": {
"command": "uvx",
"args": ["cfast-mcp"],
"env": { "CFAST": "/path/to/your/cfast/executable" }
}
}
}
```
### Claude Code
If you use [Claude Code](https://claude.ai/code), a single command registers the server:
```bash
claude mcp add cfast -e CFAST=/path/to/your/cfast/executable -- cfast-mcp
```
### Pip
Create a virtual environment and install from PyPI:
```bash
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
pip install cfast-mcp
```
Then add `cfast-mcp` to your client configuration:
```json
{
"mcpServers": {
"cfast": {
"command": "cfast-mcp",
"env": { "CFAST": "/path/to/your/cfast/executable" }
}
}
}
```
### CFAST Installation
Download and install CFAST from the [NIST CFAST website](https://pages.nist.gov/cfast/) or the [CFAST GitHub repository](https://github.com/firemodels/cfast). Follow the installation instructions for your operating system and ensure `cfast` is available in your `PATH`. If CFAST is installed in a non-standard location, you can manually specify the path by setting the `CFAST` environment variable to point to the CFAST executable.
```bash
export CFAST="/path/to/your/cfast/executable" # Linux/macOS
set CFAST="C:\path\to\cfast.exe" # Windows (cmd)
$env:CFAST="C:\path\to\cfast.exe" # Windows (PowerShell)
```
## Development
```bash
git clone https://github.com/bewygs/cfast-mcp.git
cd cfast-mcp
uv sync --extra dev # install dev dependencies
uv run pytest # run tests
uv run ruff check --fix . # lint
uv run mypy src/ # type-check
```
TDQS
Scored across 22 tools
Each tool targets a distinct entity (compartment, vent type, fire, material, device, simulation parameters, etc.) with clear descriptions. The three vent types are differentiated by their mechanics (wall, ceiling/floor, mechanical) and purposes.
All tools follow a consistent verb_noun pattern using snake_case. Add/update pairs are uniform, and lifecycle tools like create_model, inspect_model, run_model maintain the pattern without mixing conventions.
22 tools cover the full range of operations for creating, configuring, and running CFAST fire simulations. The count is well-scoped for the domain's complexity without being excessive or insufficient.
The tool surface includes create, read (via inspect/get_results), and update operations for all major components, but notably lacks delete/remove tools for compartments, vents, fires, etc. This is a significant gap for model management.