PyMemSim-MCP
This server exposes PyMemSim membrane simulation capabilities through MCP, letting AI agents run physics-based gas hollow-fiber membrane simulations with structured thermodynamic model sources.
Run gas hollow-fiber membrane simulations via
simulate_gas_hfm, including feed/permeate conditions, gas components, flow patterns, heat transfer options, module geometry, and optional solver/thermo settings.Validate PyThermoDB YAML reference content with
check_yaml_referenceto ensure thermodynamic data is correctly formatted before simulation.Analyze recommended feed flow rate bounds for hollow-fiber modules with
hfm_feed_flow_rate_analyzer, using geometry, operating conditions, permeance, viscosity, and pressure-drop limits.Serve over STDIO or HTTP for use by MCP-compatible desktop and agent clients.
Support agentic workflows where LLM agents build model sources from reference data and execute simulations, sensitivity analysis, and optimization.
Decouple data, equations, and solvers by using external YAML model sources, enabling reproducible, unit-safe thermodynamic definitions in membrane separation modeling.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PyMemSim-MCPsimulate CO2/N2 separation in hollow fiber membrane with feed 20% CO2 at 5 bar"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PyMemSim-MCP
PyMemSim-MCP exposes PyMemSim membrane simulation capabilities through an MCP server.
Overview ๐
PyMemSim-MCP is a next-generation framework that brings the Model Context Protocol into chemical engineering modeling and simulation, specifically for membrane-based separation systems.
Built on top of PyMemSim, this package introduces a model-source-driven architecture in which thermodynamic data, transport properties, and governing equations are defined externally in a structured, machine-readable format (e.g., YAML). These model sources are dynamically constructed using tools such as PyThermoLinkDB and PyThermoDB, and then supplied, alongside conventional inputs like temperature, pressure, and composition, to simulation workflows.
Unlike traditional tightly coupled simulation tools, PyMemSim-MCP decouples data, equations, and numerical solvers, enabling:
โ Consistent and unit-safe thermodynamic definitions across simulations
๐ Flexible integration with multiple modeling packages and workflows
โ๏ธ Solver-agnostic execution of mass and heat balance equations
๐ Transparent and interpretable simulation pipelines
A key innovation of PyMemSim-MCP is its compatibility with agentic workflows, where specialized agents can:
๐ง Extract and structure thermodynamic data from unstructured sources into validated model sources
๐ค Interact with MCP-enabled endpoints to perform simulations, sensitivity analysis, and optimization
This approach addresses critical gaps in current LLM-integrated engineering tools, where inconsistencies in data formats, units, and equations often lead to unreliable results. By enforcing a unified scientific contract, PyMemSim-MCP allows LLMs to control both conventional inputs and structured model sources before executing physics-based computations, significantly improving robustness and reproducibility.
PyMemSim-MCP is particularly suited for:
๐งช Membrane process modeling (e.g., hollow fiber modules, gas separation)
๐ค AI-assisted simulation workflows
๐ Rapid prototyping and validation of process models
๐ Educational and research applications in computational chemical engineering
Overall, PyMemSim-MCP represents a step toward trustworthy AI-driven simulation environments, where domain knowledge, data, and numerical methods are seamlessly integrated under a standardized and extensible framework.
Related MCP server: AspenPlus MCP Server
Requirements ๐
Python
>=3.11pip(oruv)
Install the package ๐ฆ
pip install pymemsim-mcpThis installs the CLI entrypoint:
pymemsim-mcp
Start / Activate the MCP Server โถ๏ธ
The server entrypoint is:
module:
python -m pymemsim_mcp.serverscript:
pymemsim-mcp
Both support the same options.
Case A: STDIO transport (recommended for MCP desktop/agent clients) ๐งต
pymemsim-mcp --mode stdioEquivalent:
python -m pymemsim_mcp.server --mode stdioCase B: HTTP transport (for network-accessible clients) ๐
pymemsim-mcp --mode http --host 127.0.0.1 --port 8000 --path /mcpEquivalent:
python -m pymemsim_mcp.server --mode http --host 127.0.0.1 --port 8000 --path /mcpCLI Options โจ๏ธ
--mode:stdioorhttp(default:stdio)--host: HTTP bind host (default:127.0.0.1)--port: HTTP bind port (default:8000)--path: HTTP endpoint path (default:/mcp)
MCP Client Configuration Examples ๐
STDIO client config (generic)
{
"mcpServers": {
"pymemsim": {
"command": "pymemsim-mcp",
"args": ["--mode", "stdio"]
}
}
}HTTP client config (generic)
{
"mcpServers": {
"pymemsim": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}Available Tool ๐งฉ
simulate_gas_hfm: build thermo model source from reference content and run gas hollow-fiber membrane simulation.
Agentic Workflows ๐ค
For AI-assisted and agentic membrane-process simulation, see PyMemSim-Agent.
PyMemSim-Agent provides a harness-neutral instruction and workflow layer designed to orchestrate PyMemSim-MCP through AI agents such as Codex, Claude, Gemini, and other agentic environments.
While PyMemSim-MCP exposes the scientific simulation capabilities through the Model Context Protocol (MCP), PyMemSim-Agent provides the reasoning rules, skills, prompts, examples, and workflows needed for an agent to use those capabilities systematically.
Together, they enable agentic workflows in which an AI agent can:
๐ง Interpret a membrane-separation problem and identify the required simulation inputs
๐ Build structured thermodynamic model sources from reference data
โ Validate required properties, units, equations, and simulation inputs
๐ง Select and invoke the appropriate PyMemSim-MCP tools
โ๏ธ Execute physics-based membrane simulations
๐ Interpret simulation outputs and engineering performance indicators
๐ Perform iterative studies such as sensitivity analysis, operating-condition exploration, and optimization
๐งช Maintain a reproducible workflow connecting scientific references, model inputs, numerical simulation, and engineering interpretation
The overall architecture can therefore be viewed as:
User / Engineering Problem
โ
โผ
Agentic Harness
(Codex / Claude / Gemini / ...)
โ
โผ
PyMemSim-Agent
Instructions โข Skills
Prompts โข Workflows
โ
โผ
PyMemSim-MCP
MCP Tools
โ
โผ
PyMemSim
Physics-Based Simulation
โ
โผ
Engineering Results๐ PyMemSim-Agent repository: https://github.com/sinagilassi/PyMemSim-Agent
Development Quick Check โ
python -m py_compile pymemsim_mcp/server.py
python -m py_compile pymemsim_mcp/interface/gas_hfm.pyTroubleshooting ๐ฉบ
pymemsim-mcp: command not foundRun
pip install -e .in the active environment.Confirm environment is activated.
Port already in use (HTTP mode)
Change port, for example:
--port 8010.
Import errors
Reinstall dependencies:
pip install -e ..
โ FAQ
For any questions, contact me on LinkedIn.
๐ License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
๐จโ๐ป Authors
Available Tools
3 toolscheck_yaml_referenceB
Validate pythermodb YAML reference content for use with pyThermoDB.
Inputs: yaml_content (required). Returns: result
hfm_feed_flow_rate_analyzerB
analyze recommended feed flow rate bounds for a hollow-fiber membrane module from geometry, operating conditions, and permeance inputs.
Inputs: permeance (required), viscosity (required), fiber_length (required), feed_pressure (required), +10 more. Returns: result
simulate_gas_hfmC
run a gas hollow-fiber membrane simulation, using pyThermoDB YAML reference content to build the model source.
Inputs: request (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 3 tools
Each tool targets a clearly distinct operation: validating YAML content, analyzing feed flow rate bounds, and running a membrane simulation. There is no overlap in functionality.
Tool names use snake_case but mix verb-noun patterns: 'check_yaml_reference' and 'simulate_gas_hfm' start with verbs, while 'hfm_feed_flow_rate_analyzer' is a noun phrase without a verb, creating inconsistency.
With only 3 tools, the server is tightly scoped to core membrane simulation tasks. Each tool serves a necessary, non-redundant purpose.
The set covers validation, analysis, and simulation, but lacks tools for user input setup, result visualization, or parameter tuning, leaving notable gaps for a complete workflow.
Maintenance
Related MCP Connectors
Engineering calculation MCP server for oil and gas engineering applications.
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for aerospace calculations: orbital mechanics, ephemeris, DSN operations, ...
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that automates Aspen Custom Modeler (ACM) via COM, enabling steady-state and dynamic simulations and variable manipulation. It allows users to programmatically manage ACM sessions and interact with .acmf files through standardized tools.1GPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Aspen Plus process simulations through a standardized MCP interface, supporting simulation control, data access, and flowsheet manipulation.37MIT
- AlicenseBqualityDmaintenanceMCP Server for COMSOL Multiphysics simulation automation via AI agents.782MIT
- AlicenseNot gradedqualityDmaintenanceMCP server wrapping xGEMS for thermodynamic equilibrium calculations, offering tools to list systems, get system info, and run simulations.MIT