Configuration
The server and the worker read their settings from environment variables prefixed MCOPENFOAM_. List and dict values are JSON, such as MCOPENFOAM_MPI_ARGS='["--use-hwthread-cpus"]'. This table is generated from the settings model in the code.
Defaults that depend on the machine, such as host, uid and gid, show the value on the machine that built these docs.
| Environment variable | Default | What it does |
|---|---|---|
MCOPENFOAM_JOBS_DIR | ~/mcopenfoam/jobs | durable job directories (job.json, events.jsonl, the case copy); keep on a large volume, a fine sweep is about 18 GB |
MCOPENFOAM_JOBS_HOST_DIR | None | jobs_dir as the docker host sees it, when the server runs in a container |
MCOPENFOAM_CASES_DIR | ~/mcopenfoam/cases | staged cases for submit_case(case_name=); default <jobs_dir>/../cases |
MCOPENFOAM_CASES_HOST_DIR | None | cases_dir as the docker host sees it, when the server runs in a container |
MCOPENFOAM_HOST | rpm-bullet | this host's name: the queue jobs run on and the label in every event |
MCOPENFOAM_EXECUTOR | docker | how steps run; only docker is implemented |
MCOPENFOAM_IMAGE | opencfd/openfoam-default:2406 | OpenFOAM image each job container runs |
MCOPENFOAM_PARAVIEW_IMAGE | mcopenfoam-paraview:5.13.3 | headless ParaView image for figure rendering (deploy/paraview) |
MCOPENFOAM_RANK_BUDGET | 20 | max MPI ranks one job may take on this host |
MCOPENFOAM_MPI_ARGS | [] | extra mpirun flags, e.g. --use-hwthread-cpus when cores < ranks |
MCOPENFOAM_AXIS_LABELS | None | figure orientation-marker words per body axis, keys +X -X +Y -Y +Z -Z, e.g. {"+X": "+X = CFD port"}; a case.json "axis_labels" entry overrides |
MCOPENFOAM_QUEUE_URL | None | Procrastinate Postgres DSN; None uses the in-memory connector |
MCOPENFOAM_WORKER_INPROCESS | true | run the job worker inside the server (local stdio); false when a separate mcopenfoam-worker process serves the queue |
MCOPENFOAM_TASKS_URL | memory:// | Docket backend for MCP Tasks |
MCOPENFOAM_TRANSPORT | stdio | MCP transport |
MCOPENFOAM_HTTP_HOST | 127.0.0.1 | bind address for the http transport |
MCOPENFOAM_HTTP_PORT | 8372 | port for the http transport |
MCOPENFOAM_UID | 1000 | user id job containers run as |
MCOPENFOAM_GID | 1000 | group id job containers run as |
MCOPENFOAM_WATCHER_INTERVAL_S | 5 | seconds between watcher samples while a solver runs |
MCOPENFOAM_MESH_WATCHER_INTERVAL_S | 10 | seconds between watcher samples while meshing |
MCOPENFOAM_PROGRESS_EVERY | 100 | solver iterations per progress event |
MCOPENFOAM_WAIT_CAP_S | 85 | hard cap for wait_for and any blocking tool |
MCOPENFOAM_INSTRUMENTATION | true | record tool calls and job events with fastmcp-feedback |
MCOPENFOAM_INSTRUMENTATION_URL | None | SQLAlchemy async DSN for fastmcp-feedback (postgresql+asyncpg://...); None keeps SQLite at <jobs_dir>/calls.db |
MCOPENFOAM_EMBEDDINGS_URL | None | OpenAI-compatible /v1 base URL; set to embed failure text for similar_failures (needs a Postgres instrumentation_url with pgvector) |
MCOPENFOAM_EMBEDDINGS_API_KEY | None | bearer token for embeddings_url |
MCOPENFOAM_EMBEDDINGS_MODEL | mxbai-embed-large | embedding model name |
MCOPENFOAM_EMBEDDINGS_DIM | 1024 | vector size the model returns |
MCOPENFOAM_FOREIGN_GUARD | true | hold a job while an OpenFOAM container this server did not start is running |
MCOPENFOAM_FOREIGN_POLL_S | 30 | seconds between checks while a queued job is held |
MCOPENFOAM_MIN_FREE_GB | 5 | hold a queued job while the jobs disk has less free space than this, and warn at submit; a solver that hits a full disk dies mid-write |
The compose stack in deploy/ sets the container-specific ones (JOBS_DIR, JOBS_HOST_DIR, QUEUE_URL, INSTRUMENTATION_URL, WORKER_INPROCESS=false) from its own .env; see Run your own server.