Expand description
.env discovery + loader.
Walks upward from a start directory looking for a .env file and
loads the first one found into the process environment. Mirrors
the Python mcp_methods._utils.load_env semantics exactly so the
same .env file behaves identically whether the server boots
via Rust or Python:
- Skip blank lines and lines starting with
#. KEY=VALUEonly (lines without=are skipped).- Values may be quoted with single or double quotes; the outer quotes are stripped.
- Existing env vars are NOT overwritten.
Operators who want a non-implicit pick can declare env_file: path
at the top level of the manifest YAML; that wins over the walk-up.
Functionsยง
- load_
env_ explicit - Load a specific
.envpath. Errors if the file does not exist โ the explicitenv_file:manifest key promises that path. - load_
env_ walk - Walk upward from
startlooking for.env. Returns the path loaded, orNoneif nothing was found before reaching the root. Silent on parse errors per-line โ a single bad line should not stop the rest of the file from loading.