Skip to main content

dlubal-mcp

Model Context Protocol (MCP) server that enables AI tools and large language models (LLMs) to interact with running Dlubal structural analysis applications.

Built on top of the dlubal.api gRPC client library, dlubal-mcp exposes tools that AI assistants can call directly to do modelling, analysis or reading results through the API scripts.

Supported Applications

Application Script Tool
RFEM 6 — Finite Element Analysis run_rfem_script
RSTAB 9 — Frame and Truss Analysis run_rstab_script
RSECTION 1 — Cross-Section Analysis run_rsection_script

How It Works

Choosing a transport

dlubal-mcp speaks two MCP transports. Pick by how the client reaches it.

stdio streamable-http (default)
How it starts your client launches it as a subprocess you start it; it listens on a port
Who can reach it only the client that launched it anything on the machine
Access token not needed required (DLUBAL_MCP_ALLOWED_API_KEYS)
Script tools enabled by default withheld unless the operator enables them
Typical user an engineer in VS Code, Claude Code, Cursor Dlubal CALC via the Connector; multi-client setups

Use stdio unless something prevents it. It is what the MCP specification asks clients to prefer, and it needs no port and no token: the client owns the process, so there is no anonymous caller to authenticate. Browsers cannot launch a subprocess, which is why Dlubal CALC uses the HTTP door instead.

{
  "mcpServers": {
    "dlubal-mcp": {
      "command": "C:\\Program Files\\Dlubal\\RFEM 6.15\\bin\\python.exe",
      "args": ["-m", "dlubal_mcp", "--transport", "stdio"]
    }
  }
}

Running the Dlubal-bundled python.exe lets the server find the API key the Dlubal application already wrote, so no key configuration is needed. Set DLUBAL_MCP_ALLOW_SCRIPTS=false to withhold the script tools on stdio as well.

Running a stdio server next to the Connector. Both use the same execution journal in %LOCALAPPDATA%\DlubalMCP, so while one of them runs a script or a model operation, the other refuses new ones with busy. RFEM also accepts only one API client at a time, so read tools on the second server report RFEM as unavailable until the first finishes. Either retry, or keep one server in use. The exclusion holds only while both use the default journal: do not point RFEM_EXECUTION_STATE_FILE (or the RSTAB/RSECTION equivalents) at a different file on a machine that runs both.

Serving only some products

DLUBAL_MCP_PRODUCTS limits which products a server registers, as a comma-separated subset of rfem,rstab,rsection (default: all). Products outside the set register no tools and appear in health_check as {"disabled": true}; an unknown name stops the server at startup.

Use it to run one server per Dlubal API build. A product must be driven by a dlubal.api client of its own build: protobuf matches fields by number, the numbers move between builds, and a mismatched client returns wrong values without an error. Every Dlubal-bundled python.exe carries all three product clients, so a server started from RSTAB 9.14's Python would otherwise also offer RFEM and RSECTION tools on a 2.14 client.

HTTP access protection

Starting with 1.0.13, HTTP access always requires a separate bearer token and a numeric loopback bind address. The matching Dlubal Connector provisions this automatically. Standalone clients must configure DLUBAL_MCP_ALLOWED_API_KEYS and send Authorization: Bearer <access-token>; the Dlubal application API key is a separate credential. Anonymous operation and query-string tokens are not supported. See HTTP authentication and upgrade notes.

dlubal-mcp acts as a bridge between an AI assistant and a running Dlubal application. The application must already be open and its API service active — the MCP server connects to the live session, it does not launch applications itself.

  1. Start RFEM 6, RSTAB 9, or RSECTION 1 on your machine
  2. Launch the MCP server with proper settings (urls, API ports)
  3. An AI tool calls e.g. run_rfem_script with Python code
  4. The code executes against the live application and returns the output

LLM Responsibility for API Scripts

The run_rfem_script, run_rstab_script, and run_rsection_script tools execute arbitrary Python code against the live application. The LLM is responsible for composing correct and valid API scripts — the MCP server simply runs whatever code it receives and returns the output or any errors.

To write correct scripts, the LLM should consult the Dlubal API Documentation, which covers all available objects, methods, and usage patterns for the gRPC-based API.

After a script write fails

Managed scripts stop accepting writes after a write raises an exception, including a rejected model target or invalid arguments before the SDK call, even if the script catches that exception. Read-only inspection remains available, but further writes, model creation, and model opening are refused in that execution. The original failure is returned when the script finishes, so catching it cannot turn a failed or uncertain write into a successful tool result. This applies to RFEM, RSTAB, and RSECTION through their shared managed connection. Pre-SDK validation failures do not mark the journal as having attempted a model mutation; any earlier mutation record is preserved.

Earlier changes are not rolled back. Inspect the model before requesting further work. A new execution still follows the existing admission rules: an unknown outcome remains blocked by the execution journal. This guard does not make arbitrary Python a security sandbox.

If RFEM reports another connected client after a model write was attempted, the error warns about possible partial changes and does not recommend replaying the script. The same caution applies to uncertain execution outcomes. A busy connection before any write remains retryable when its outcome is known.

If an exception's diagnostic text or RPC status cannot be read, the execution remains unknown and blocks further scripts. Diagnostic failures cannot produce a successful result. Captured output and the recorded model GUID remain available for inspection, including after restarting the server.

Requirements

  • Python 3.11 or higher
  • A running Dlubal application (RFEM 6, RSTAB 9, or RSECTION 1)
  • Active API Service subscription — see dlubal.api for details

Installation

pip install "dlubal-mcp[rfem]"      # RFEM 6
pip install "dlubal-mcp[rstab]"     # RSTAB 9
pip install "dlubal-mcp[rsection]"  # RSECTION 1
pip install "dlubal-mcp[all]"       # All products

Available MCP Tools

Tool Description
run_rfem_script Execute Python code against a running RFEM 6 instance
read_rfem_results Read an allowlisted, bounded RFEM result summary without executing caller code or changing the model
run_rstab_script Execute Python code against a running RSTAB 9 instance
run_rsection_script Execute Python code against a running RSECTION 1 instance
health_check Server status: installed products, running state, available tools

Typed RFEM result access

read_rfem_results is the preferred path for read-only agents. It accepts only five fixed result types (calculation_status, member internal forces, node deformations, stability critical load factors, and steel member design ratios). Result queries require bounded integer object numbers (except stability) and validated loading identifiers. Both filters are verified against every returned row. It never calculates, writes, opens, saves or switches a model.

The response is bounded to at most 100 rows and contains only allowlisted numeric fields, units, the active model GUID, the RFEM version, a complete model-input state_fingerprint and a canonical result_hash. The fingerprint is produced from RFEM's Python-gRPC model export before and after the result query. The export is canonicalised and hashed locally, then deleted; its model contents never leave the machine. If the model changes during the read or RFEM cannot produce the complete snapshot, the tool returns unavailable fail-closed. Model paths, object names, arbitrary RFEM warning text and exception messages are not returned. no_results and unavailable are explicit states, not successful checks.

Metadata

Release files for dlubal-mcp 1.0.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dlubal-mcp 1.0.25
File Size Uploaded Provenance Actions
dlubal_mcp-1.0.25.tar.gz 119.9 kB Without provenance Details for dlubal_mcp-1.0.25.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dlubal-mcp 1.0.25
File Interpreter ABI Platform Actions
dlubal_mcp-1.0.25-py3-none-any.whl Python 3 none any Details for dlubal_mcp-1.0.25-py3-none-any.whl

Total release size: 205.2 kB

Release files / dlubal_mcp-1.0.25.tar.gz

Download URL dlubal_mcp-1.0.25.tar.gz
Size 119.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0a669e5ae8594e07355d3abb71dadd61cbc69094b1ee9fae0725ed9816f0a6b9
BLAKE2b-256 checksum
How to use checksums
776ac9975b3ba4c579575ef1c7e8337c9738e3316792c985a572d71b13dd526e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / dlubal_mcp-1.0.25-py3-none-any.whl

Download URL dlubal_mcp-1.0.25-py3-none-any.whl
Size 85.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7873cd4989328a0e5f1eee73085c332ffe407556d8d3b0a794c8144e0e9014f9
BLAKE2b-256 checksum
How to use checksums
d62f39794dadfd37f7d4094ef7fe878559691c504d4635c889b0c9f236424455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for dlubal-mcp 1.0.25

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page