Labsco
MCP SERVER

ADM1 MCP Server

by puran-water

Runs full ADM1 anaerobic digestion simulations from a conversation — describe the feedstock in words, get state variables, simulate up to three reactors, and read back inhibition and yields.

Physical Sciences & Scientific Computing
Summary
The feedstock translation is the part that saves the afternoon.

ADM1 itself is well specified and freely implemented; what stops people using it is that a digester feed has to become a long vector of state variables before anything runs. Turning a written description into that vector, then offering a charge-balance check on the result, is where the time goes. Worth setting up deliberately: three reactor slots means you can run configurations side by side rather than one at a time, and the inhibition analysis is what tells you why a run underperformed instead of just that it did.

What it is

A wastewater process modelling server built on the Anaerobic Digestion Model No. 1, the international standard for anaerobic digester simulation. The hard part of ADM1 is normally translating a real feedstock into dozens of state variables; here you describe the waste in plain language and the server derives them, then runs the simulation and interprets the result.

What you get
  • Feedstock definition from a written description — either state variables alone, or state variables together with kinetic parameters tuned to that feedstock — `describe_feedstock`, `describe_kinetics`
  • Simulation setup as separate, checkable steps: influent flow rate with simulation time and time step, then per-reactor temperature, hydraulic retention time and integration method, for up to three reactor configurations — `set_flow_parameters`, `set_reactor_parameters`
  • The simulation itself, run against whatever parameters are currently set — `run_simulation_tool`
  • Stream analysis for the influent, any of the three effluents, or any of the three biogas streams — `get_stream_properties`
  • Process diagnosis rather than raw output: inhibition factors with optimization recommendations, biomass yields and efficiency, and a nutrient-balance check on the carbon, nitrogen and phosphorus ratios — `get_inhibition_analysis`, `get_biomass_yields`, `check_nutrient_balance`
  • A thermodynamic consistency check on the feedstock you just defined, before you spend a simulation on it — `validate_feedstock_charge_balance`
  • Parameter access and a reset, so a run can be adjusted in place or started clean — `get_parameter`, `set_parameter`, `reset_simulation`
  • Report generation with charts and methodology sections, built from the actual simulation data — `generate_report`
  • A system prompt shipped in the README that walks a model through the correct order of operations, including which of the two feedstock tools to call and never both
Requirements

A Google API key for the language-model step that turns a feedstock description into ADM1 parameters, set as `GOOGLE_API_KEY` in a `.env` file. Python 3.8 or higher. Clone the repository, create a virtual environment and install from requirements — QSDsan, which carries the ADM1 implementation, comes with the dependencies. The client entry points at `server.py` using the virtual environment's own python, and the README sets `MCP_TIMEOUT` to 600000 because simulations are not fast.