ol-dwsim-mcp-server
Model Context Protocol server for DWSIM chemical process simulation
Ask AI about ol-dwsim-mcp-server
Powered by Claude Β· Grounded in docs
I know everything about ol-dwsim-mcp-server. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
OntoLedgy DWSIM Interop Services
Windows only. Runs DWSIM in-process via pythonnet, so it requires a DWSIM build with the full Windows desktop runtime (Windows 10/11 or Windows Server with Desktop Experience). macOS support is being explored. Linux is not currently supported.
Exposes DWSIM as a Model Context Protocol (MCP) server. AI assistants and other MCP clients can call canonical thermodynamics operations β flash calculations, phase properties, compound lookups β against a live DWSIM engine. Licensed under AGPL-3.0-or-later.
Implements the SimulatorAdapter protocol defined by ol-simulator-interop-services, making this one adapter among several planned for the same protocol (DWSIM now; Rust thermo kernel, HYSYS, UniSim planned).
Install
From PyPI (recommended for end users)
For a full non-developer setup, run the one-command installer. It installs the Python tool, downloads and configures the tested DWSIM v9.0.5-mcp binaries unless you pass -DwsimPath, and configures detected MCP clients. Supports default Windows PowerShell 5.1 and PowerShell 7+.
irm https://raw.githubusercontent.com/OntoLedgy/ol_dwsim_interop_services/develop/install.ps1 | iex
To pass installer parameters, download the script first:
irm https://raw.githubusercontent.com/OntoLedgy/ol_dwsim_interop_services/develop/install.ps1 -OutFile install.ps1
.\install.ps1 -DwsimPath "C:\Program Files\DWSIM"
Installer parameters:
| Parameter | Use |
|---|---|
-DwsimPath <path> | Use an existing local DWSIM directory instead of downloading the tested build. The directory must directly contain DWSIM.Interfaces.dll, DWSIM.Thermodynamics.dll, and DWSIM.SharedClasses.dll; version differences from v9.0.5-mcp may cause runtime issues. |
-SkipUvInstall | Skip uv installation when uv is already available. |
-UsePipx | Install or uninstall ol-dwsim-mcp-server with pipx instead of uv tool. |
-SkipMcpConfig | Skip automatic Claude Code, Codex CLI, and VS Code Copilot MCP configuration. |
-McpClients <Claude|Codex|Copilot|All> | Limit automatic MCP configuration to selected clients. Defaults to All. |
-Uninstall | Remove the installed tool and DWSIM MCP client configuration. |
Install via pipx or uv tool so the dwsim-mcp command lands on the system PATH β MCP clients like Claude Desktop need to be able to launch it without inheriting a venv:
pipx install ol-dwsim-mcp-server
# or
uv tool install ol-dwsim-mcp-server
Plain pip install ol-dwsim-mcp-server into a venv also works, but you'll need to reference the venv's dwsim-mcp.exe by absolute path when configuring MCP clients (see Connecting to AI assistants).
All three install modes pull the prebuilt DwsimWorker.dll bundled in the wheel. DWSIM's own engine binaries can't be redistributed β you supply those yourself:
- Use an existing DWSIM install. Set
DWSIM_PATHto your DWSIM directory (e.g.C:\Program Files\DWSIM9) and rundwsim-mcp run. - Build DWSIM from source. Clone DanWBR/dwsim, build, and point
DWSIM_PATHat the build output.
Full setup in mcp_service/dwsim_worker/SETUP.md.
From a GitHub Release
Each tag publishes three assets on the Releases page:
| Asset | Use when |
|---|---|
ol_dwsim_mcp_server-<version>-py3-none-any.whl | Standard install β pip install <wheel-path> |
ol-dwsim-mcp-server-<version>-source.zip | Inspecting or redistributing source (AGPL Β§13) |
DwsimWorker-<version>.zip | Standalone .NET worker payload without the Python wrapper |
The DWSIM version each release links against is listed in the release notes as a compatibility row.
From a cloned checkout (development)
Run from a local clone if you're modifying the server, stress-testing before a release, or can't use pipx/uv tool. The server depends on the sibling ol_simulator_interop_services package; uv installs it as an editable local dependency via [tool.uv.sources] pointing at a sibling checkout.
1. Clone both repos side-by-side. The relative path ../../../ol_simulator_interop_services from mcp_service/server/pyproject.toml must resolve to the interop package's repo root:
# A parent directory for both
mkdir C:\dev\ontoledgy ; cd C:\dev\ontoledgy
git clone https://github.com/OntoLedgy/ol_simulator_interop_services.git
git clone https://github.com/OntoLedgy/ol_dwsim_interop_services.git
This gives you C:\dev\ontoledgy\ol_simulator_interop_services and C:\dev\ontoledgy\ol_dwsim_interop_services β the uv source path resolves correctly.
2. Set up the Python environment:
cd ol_dwsim_interop_services\mcp_service\server
uv sync
uv sync installs all runtime deps plus an editable install of the local ol-simulator-interop-services. It also registers the dwsim-mcp entry point in .venv\Scripts\.
3. Build the .NET worker (full .NET prerequisites listed under Development):
cd ..\dwsim_worker
.\build.bat
4. Configure DWSIM. Copy mcp_service/dwsim_worker/dwsim.config.json.sample to dwsim.config.json (gitignored) and set dwsim_path to your DWSIM install or build folder β see mcp_service/dwsim_worker/SETUP.md for detail.
5. Verify and run:
cd ..\server
.\.venv\Scripts\dwsim-mcp.exe doctor
.\.venv\Scripts\dwsim-mcp.exe run
6. Point an MCP client at the checkout. Use the absolute-path variant in Connecting to AI assistants, with command set to C:\dev\ontoledgy\ol_dwsim_interop_services\mcp_service\server\.venv\Scripts\dwsim-mcp.exe.
Edits to Python source are picked up immediately (editable install). Edits to shared/property_packages.toml or C# code require build.bat again so the new artifacts land in DwsimWorker/bin/Debug/.
For deeper contributor workflow (tests, linting, release flow), see the Development section below.
Uninstall
For a non-developer uninstall from PowerShell:
irm https://raw.githubusercontent.com/OntoLedgy/ol_dwsim_interop_services/develop/install.ps1 -OutFile install.ps1; .\install.ps1 -Uninstall
If you originally installed with -UsePipx, add -UsePipx to the uninstall command.
Quick start
Verify the install
dwsim-mcp doctor
Reports Python version, pythonnet status, DWSIM discovery, and missing prerequisites.
Run the MCP server
dwsim-mcp run
Defaults to stdio transport β the shape Claude Desktop, VS Code Copilot, and Codex CLI expect. For HTTP/SSE, pass --transport http or --transport sse.
See the release info
dwsim-mcp version
Prints package name, version, commit SHA, source URL, and license β the AGPL Β§13 source offer, also exposed at runtime via the release://info MCP resource.
Connecting to AI assistants
| Platform | Configuration file | Format |
|---|---|---|
| Claude Desktop | %APPDATA%\Claude\claude_desktop_config.json | JSON |
| VS Code Copilot | settings.json or mcp.json | JSON |
| OpenAI Codex CLI | %USERPROFILE%\.codex\config.toml (or ~/.codex/config.toml) | TOML |
The config form depends on how you installed the server. Codex CLI uses TOML; Claude Desktop and VS Code use JSON.
If installed with pipx or uv tool install β dwsim-mcp is on PATH and the host can launch it by name.
Claude Desktop / VS Code Copilot (JSON):
{
"mcpServers": {
"dwsim": {
"command": "dwsim-mcp",
"args": ["run"]
}
}
}
OpenAI Codex CLI (TOML, append to ~/.codex/config.toml):
[mcp_servers.dwsim]
command = "dwsim-mcp"
args = ["run"]
If installed with pip install into a venv, or running from a cloned checkout β use the absolute path to the venv's dwsim-mcp.exe so the host's subprocess doesn't need a PATH entry or venv activation.
Claude Desktop / VS Code Copilot (JSON):
{
"mcpServers": {
"dwsim": {
"command": "C:\\path\\to\\your\\.venv\\Scripts\\dwsim-mcp.exe",
"args": ["run"]
}
}
}
OpenAI Codex CLI (TOML):
[mcp_servers.dwsim]
command = "C:\\path\\to\\your\\.venv\\Scripts\\dwsim-mcp.exe"
args = ["run"]
Detailed per-platform setup in docs/resources/getting-started.md.
Architecture
This adapter is the concrete DWSIM implementation of the canonical SimulatorAdapter protocol. DWSIM's .NET Framework engine is loaded in-process via pythonnet β no separate worker process, no HTTP hop.
LLM agent / MCP client
|
v
+--[ ol_thermodynamics_agent_services ]--+
| MCP tools, routing, provenance |
+----------------------------------------+
|
v
+--[ ol_simulator_interop_services ]-----+
| canonical domain model + protocol |
+----------------------------------------+
|
+----+----+----------+---------+
v v v v
[Rust] [DWSIM] [HYSYS] [UniSim]
kernel adapter adapter adapter
^
|
this repo
Polyglot layout:
mcp_service/server/β Python MCP server (FastMCP + pythonnet CLR loader).mcp_service/dwsim_worker/β .NET Framework 4.8 worker hosting the DWSIM engine.shared/property_packages.tomlβ single source of truth for the property-package inventory consumed by both Python and .NET sides.
Project structure
ol_dwsim_interop_services/
βββ shared/ # Cross-language configuration
β βββ property_packages.toml # Canonical property-package inventory
βββ mcp_service/
β βββ server/ # Python MCP server (ol-dwsim-mcp-server wheel)
β β βββ dwsim_mcp_server/ # Main Python package
β β βββ tests/ # unit / integration / smoke / cli tests
β βββ dwsim_worker/ # .NET Framework 4.8 worker
β βββ DwsimWorker/ # C# class library (DwsimWorker.dll)
β βββ DwsimWorker.Tests/ # xUnit test project
βββ prebuilt/ # Beta-tester setup script + bundled binaries
βββ docs/ # MCP tool reference, architecture, deployment
βββ scripts/ # Build + packaging helpers
Key features
- Model Context Protocol β standard stdio, HTTP, and SSE transports via FastMCP.
- CAPE-OPEN β phase properties surfaced with the same semantics other chemical-engineering tools expect.
- In-process DWSIM β pythonnet loads DwsimWorker.dll into the server process; sub-millisecond overhead per call.
- Session-based β each MCP session gets an isolated DWSIM flowsheet; sessions are cleanly torn down on disconnect.
- Capability-gated tool surface β adapter declares
SUPPORTED_TOOLS; the agent layer only advertises what's actually wired (no lying aboutcreate_sessionorget_diagnostics). - Single source of truth for property packages β edit
shared/property_packages.toml, rebuild; Python and .NET both pick up the change. - AGPL Β§13 source offer β every running instance self-identifies commit SHA, source URL, and license via CLI, startup log, and
release://infoMCP resource. - Observability β structured logs, OpenTelemetry traces at every tool boundary, Prometheus-style metrics.
Development
Prerequisites
- Windows 10/11 or Windows Server with Desktop Experience (DWSIM depends on Eto.Forms/WinForms β Server Core is not supported).
- Python 3.11 or 3.12 +
uv. - .NET Framework 4.8 Developer Pack + Visual Studio Build Tools with the ".NET desktop development" workload.
- .NET Framework 4.8 download: https://dotnet.microsoft.com/download/dotnet-framework/net48
- VS Build Tools: https://visualstudio.microsoft.com/downloads/ (scroll to "Build Tools for Visual Studio")
- A DWSIM build (x64 Debug or Release) β either a user install or a local clone of DanWBR/dwsim you've built.
Install uv (Windows, PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
If execution policy blocks the pipe:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
$uv = "$env:TEMP\uv-install.ps1"
irm https://astral.sh/uv/install.ps1 -OutFile $uv
Unblock-File $uv
& $uv
Verify: uv --version.
Build from source
git clone https://github.com/OntoLedgy/ol_dwsim_interop_services.git
cd ol_dwsim_interop_services
# Python environment
cd mcp_service\server
uv sync
.\.venv\Scripts\Activate.ps1
# .NET worker
cd ..\dwsim_worker
.\build.bat
build.bat handles framework/SDK versioning β use it instead of dotnet build directly to avoid mismatch errors.
DWSIM binaries setup
The worker needs DWSIM's compiled engine DLLs next to it. Copy from a local DWSIM build:
$src = "..\..\dwsim\DWSIM\bin\x64\Debug" # adjust to your DWSIM clone
$dest = "mcp_service\dwsim_worker\dwsim_binaries\x64\Debug"
New-Item -ItemType Directory -Path $dest -Force | Out-Null
Copy-Item "$src\*.dll" $dest -Force
Copy-Item "$src\data" "$dest\data" -Recurse -Force
Copy-Item "$src\ThermoCS" "$dest\ThermoCS" -Recurse -Force
Or copy mcp_service/dwsim_worker/dwsim.config.json.sample to dwsim.config.json (gitignored) and set dwsim_path to your DWSIM build folder.
Full step-by-step in mcp_service/dwsim_worker/SETUP.md.
Running tests
# Python
cd mcp_service\server
.\.venv\Scripts\python.exe -m pytest tests/unit tests/cli -q
# Live-DWSIM integration (requires DwsimWorker.dll built + DWSIM binaries)
.\.venv\Scripts\python.exe -m pytest tests/integration -q -m live_dwsim
# C# (from mcp_service\dwsim_worker after build.bat)
# Always use vstest via build.bat's output β never `dotnet test` directly.
Adding a property package
Edit shared/property_packages.toml, then .\build.bat. Both the Python adapter (tomllib at import time) and the .NET worker (Tomlyn in a static constructor) pick the change up at next startup. A live-DWSIM alignment test asserts the canonical, worker, and runtime inventories agree.
Related repositories
| Repository | Layer | Role |
|---|---|---|
ol_thermodynamics_agent_services | Agent (top) | MCP tool schemas, backend routing, provenance |
ol_simulator_interop_services | Interop (middle) | Canonical domain model, SimulatorAdapter protocol, registries |
ol_thermodynamics_kernel (planned) | Adapter | Native Rust thermo kernel via PyO3 |
Architecture reference
docs/mcp/mcp-tools.mdβ MCP tool reference and API specifications.docs/resources/β quickstart, configuration, troubleshooting.docs/architecture/β system design, security, observability.
AGPL-3.0 source offer
Every running ol-dwsim-mcp-server instance exposes the exact source metadata for that deployment: package name, version, commit SHA, source repository URL, and license. Three surfaces advertise this to satisfy AGPL Β§13:
- MCP resource
release://infoβ any connected client can fetch it. - CLI
dwsim-mcp versionβ operator-facing. - Stderr startup event β a single JSON line emitted at server boot, event name
dwsim_mcp_server_started.
See LICENSE for the full AGPL-3.0-or-later text.
License
OntoLedgy's contributions in this repository are dual-licensed:
- Open source β AGPL-3.0-or-later. See LICENSE for the full text and NOTICE for copyright and attribution.
- Commercial β a separate proprietary license is available from OntoLedgy Ltd. for OntoLedgy's contributions only. See COMMERCIAL.md for scope, exclusions, and terms.
Copyright (c) 2018-2026 OntoLedgy Ltd.
Important β DWSIM scope. This repository links to DWSIM, an upstream chemical process simulator licensed under GPL-3.0 by its maintainers. DWSIM is not owned by OntoLedgy and cannot be relicensed by us. The commercial license offered here covers OntoLedgy's own code (the MCP server, the DwsimWorker glue source, and OntoLedgy-authored build/test/doc material) but does not relicense DWSIM or any compiled artifact (e.g. DwsimWorker.dll) to the extent it embeds or links DWSIM .NET assemblies. See COMMERCIAL.md for the three practical paths to a fully proprietary deployment.
Why AGPL? MCP servers are reachable by network clients (HTTP/SSE transports), and even stdio servers are often proxied over the network by their MCP hosts. AGPL Β§13 ensures that modifications to a network-reachable instance have their source made available to those users β closing the "SaaS loophole" in plain GPL. GPLv3 Β§13 explicitly permits combining GPLv3 code (DWSIM) with AGPLv3 code.
DWSIM is licensed under GPLv3. See the DWSIM repository for more information.
Contributing
See CONTRIBUTING.md for development guidelines, code standards, and PR flow.
Acknowledgments
- DWSIM β open-source chemical process simulation by Daniel Medeiros.
- CAPE-OPEN β industry interoperability standards for process simulators.
- Model Context Protocol β by Anthropic.
- FastMCP β by Jeremiah Lowin.
- pythonnet β Python β .NET CLR bridge.
