Skip to main content

dlubal-mcp

dlubal-mcp lets an AI assistant such as Claude, GitHub Copilot or Codex work with RFEM 6, RSTAB 9 and RSECTION 1 running on your PC: inspect and create models, run the calculation and read results. It is an MCP server built on the dlubal.api client.

Step-by-step setup with screenshots for each AI client: MCP Server installation guide.

Before You Start

  • The application is open and its API server is switched on (Starting Server). dlubal-mcp works with the running application; it does not start it.

  • Your Dlubal API key is saved on the PC (Authentication). No key goes into the MCP configuration.

  • API requests count toward your subscription, also those made by the AI.

  • You know your application version, for example from its installation folder C:\Program Files\Dlubal\RFEM 6.16. It decides the dlubal.api version: the second number is the same.

    Application dlubal.api
    RFEM 6.16, RSTAB 9.16, RSECTION 1.16 2.16.*
    RFEM 6.15, RSTAB 9.15, RSECTION 1.15 2.15.*

Setup

  1. Install uv once, then restart your AI client so it finds the uvx command:

    winget install --id=astral-sh.uv -e
    
  2. Add the server to your AI client. Replace 2.16.* with your version from the table above. For Claude Code (.mcp.json), Claude Desktop and Cursor:

    {
      "mcpServers": {
        "dlubal-mcp": {
          "command": "uvx",
          "args": ["--python", "3.12", "--with", "dlubal.api==2.16.*",
                   "dlubal-mcp", "--transport", "stdio"]
        }
      }
    }
    

    GitHub Copilot (.vscode/mcp.json) uses "servers" instead of "mcpServers". In a terminal, Claude Code can add it for all folders:

    claude mcp add --scope user dlubal-mcp -- uvx --python 3.12 --with "dlubal.api==2.16.*" dlubal-mcp --transport stdio
    
  3. Check the connection. Ask the assistant: "Check the connection to RFEM with dlubal-mcp." It calls get_rfem_application_info, which answers "status": "ok" and the RFEM version.

uvx keeps Python and the packages in its own cache, apart from the application's Python and your project environments. The first start downloads them and can exceed the client's startup timeout; running the command once in a terminal with --help instead of --transport stdio avoids that.

Updates. After an application update, change the dlubal.api version in the configuration and restart the client. For a new dlubal-mcp release, close the client and run uv cache clean dlubal-mcp.

Without uv

Install into a virtual environment of its own, with Python 3.11–3.13. In a Command Prompt (%USERPROFILE% does not work in PowerShell):

py -3.12 -m venv %USERPROFILE%\dlubal-mcp
%USERPROFILE%\dlubal-mcp\Scripts\python.exe -m pip install dlubal-mcp "dlubal.api==2.16.*"

dlubal-mcp does not install dlubal.api itself, because it must be your application's version, not the newest. In the configuration, use this python.exe as the command, with backslashes doubled in JSON:

"command": "C:\\Users\\<username>\\dlubal-mcp\\Scripts\\python.exe",
"args": ["-m", "dlubal_mcp", "--transport", "stdio"]

Tools

Tool What it does
health_check Lists installed and running applications, client version and available tools
get_rfem_application_info Checks the connection to RFEM and reads its version
inspect_rfem_api Looks up exact RFEM API names: objects, fields, enum values, methods
write_rfem_model Creates a new RFEM model from typed objects, without Python
calculate_rfem_model Runs the calculation
read_rfem_results Reads selected results without changing the model (see below)
run_rfem_script Runs a Python script against the open RFEM model
get_rfem_execution Shows the status and output of an earlier script or model operation
get_rstab_application_info, inspect_rstab_api, run_rstab_script, get_rstab_execution The same for RSTAB 9
get_rsection_application_info, inspect_rsection_api, run_rsection_script, get_rsection_execution The same for RSECTION 1

For AI assistants:

  • Check the connection first with get_<product>_application_info.
  • Prefer the typed tools (write_rfem_model, calculate_rfem_model, read_rfem_results) to scripts.
  • Before writing a script, look up names with inspect_<product>_api and follow the Dlubal API documentation. The server runs the script as given; its correctness is the caller's responsibility.
  • If an operation fails or times out, read its outcome with get_<product>_execution and inspect the model. Never re-run it blindly.

Reading results

read_rfem_results reads five result types: calculation status, member internal forces, node deformations, stability critical load factors and steel member design ratios. It takes object numbers and loadings (e.g. LC1, CO2), checks every returned row against them, and returns at most 100 rows of numbers with units. It never calculates, writes, opens, saves or switches a model.

Each answer carries the model GUID, the RFEM version, a fingerprint of the model input and a hash of the result. The model is fingerprinted before and after the read; if it changed in between, the answer is unavailable. no_results and unavailable are not successful checks. Model paths, object names and free-form messages are never returned.

When a script fails

  • After a write in a script fails, the script can only read. Catching the exception does not change that, and the tool reports the original failure.
  • Changes made before the failure are not rolled back. Check the model before continuing.
  • If the outcome is uncertain, for example the connection broke during a write, the operation is recorded as unknown and new scripts are refused. Reading still works. Check the model, then close RFEM: the block is released once the RFEM session that ran the operation has ended.

Configuration

Set these as environment variables, for example in an env block next to args in the client configuration.

Variable Default Purpose
RFEM_API_PORT, RSTAB_API_PORT, RSECTION_API_PORT 9000, 9001, 9002 API server port of the application
RFEM_URL, RSTAB_URL, RSECTION_URL 127.0.0.1 API server address
DLUBAL_MCP_PRODUCTS rfem,rstab,rsection Applications this server offers
DLUBAL_MCP_ALLOW_SCRIPTS true on stdio, false on HTTP false withholds the script tools
RFEM_API_KEY, RSTAB_API_KEY, RSECTION_API_KEY from config.ini API key, only if it is not saved on the PC

Applications of different versions. One server uses one dlubal.api, and a client of the wrong version can return wrong values without an error. With, for example, RFEM 6.16 and RSTAB 9.15, add two servers: one with dlubal.api==2.16.* and DLUBAL_MCP_PRODUCTS=rfem, one with dlubal.api==2.15.* and DLUBAL_MCP_PRODUCTS=rstab.

HTTP Transport and Dlubal CALC

AI clients start dlubal-mcp themselves over stdio: no port, no access token. The server's default transport is HTTP, so the configuration must pass --transport stdio.

The HTTP transport serves clients that cannot start a process, such as Dlubal CALC in the browser. CALC reaches your PC through the Dlubal Connector (DlubalConnect.exe), which installs, starts and updates its own copy of dlubal-mcp in %LOCALAPPDATA%\Dlubal\Connector\mcp-runtimes. That copy is independent of the one you configure for your AI client.

  • Both at once. Both servers share the execution journal in %LOCALAPPDATA%\DlubalMCP. While one runs a script or model operation, the other refuses new ones with busy, and RFEM accepts only one API client at a time. Retry, or use one at a time. Do not point RFEM_EXECUTION_STATE_FILE (or its RSTAB/RSECTION equivalents) at another file, or this protection is lost.
  • Access protection. An HTTP server binds to a numeric loopback address and requires a bearer token (DLUBAL_MCP_ALLOWED_API_KEYS, sent as Authorization: Bearer <token>), separate from the Dlubal API key. The Connector sets this up for its own server. Details are in docs/http-authentication.md in the source distribution.

Metadata

Release files for dlubal-mcp 1.0.27

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.27
File Size Uploaded Provenance Actions
dlubal_mcp-1.0.27.tar.gz 126.9 kB Without provenance Details for dlubal_mcp-1.0.27.tar.gz

Built distribution (wheel)

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

Total release size: 216.5 kB

Release files / dlubal_mcp-1.0.27.tar.gz

Download URL dlubal_mcp-1.0.27.tar.gz
Size 126.9 kB
Tags Source
SHA-256 checksum
How to use checksums
27b4176016c7b259a7f316de7db365df266eab070bbe0252672ff827f251b78b
BLAKE2b-256 checksum
How to use checksums
ee0a3ab04717f179ecd584aa63d17b250bb940c35ced682efc51d744677c6b6d
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.27-py3-none-any.whl

Download URL dlubal_mcp-1.0.27-py3-none-any.whl
Size 89.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
297fed5b3dcd3195611f4ca3eb337110f7627ffc05b449048b3e4ad8e100716f
BLAKE2b-256 checksum
How to use checksums
56c581aab91f7f0bcd7a79cc6beebd552b0447ebc2874d87f3a983aa614658c0
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.27

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