Metadata-Version: 2.4
Name: dlubal-mcp
Version: 1.0.1
Summary: MCP server enabling AI tools to interact with running Dlubal structural analysis applications (RFEM 6, RSTAB 9, RSECTION 1)
Requires-Python: >=3.11
Requires-Dist: fastmcp>=2.0
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: starlette>=0.40
Requires-Dist: uvicorn[standard]>=0.30
Provides-Extra: all
Requires-Dist: dlubal[rfem]; extra == 'all'
Requires-Dist: dlubal[rsection]; extra == 'all'
Requires-Dist: dlubal[rstab]; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: rfem
Requires-Dist: dlubal[rfem]; extra == 'rfem'
Provides-Extra: rsection
Requires-Dist: dlubal[rsection]; extra == 'rsection'
Provides-Extra: rstab
Requires-Dist: dlubal[rstab]; extra == 'rstab'
Description-Content-Type: text/markdown

# dlubal-mcp

**Model Context Protocol (MCP) server** that enables AI tools and large language models (LLMs) to interact with running [Dlubal](https://www.dlubal.com) structural analysis applications.

Built on top of the [dlubal.api](https://pypi.org/project/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

`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](https://www.dlubal.com/en/products/dlubal-api/api-documentation/index), which covers all available objects, methods, and usage patterns for the gRPC-based API.

## Requirements

- Python 3.11 or higher
- A running Dlubal application (RFEM 6, RSTAB 9, or RSECTION 1)
- Active API Service subscription — see [dlubal.api](https://pypi.org/project/dlubal.api/) for details

## Installation

```bash
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 |
| `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 |

## Related

- [dlubal.api](https://pypi.org/project/dlubal.api/) — the underlying gRPC client library
- [Dlubal API Documentation](https://www.dlubal.com/en/products/dlubal-api/api-documentation/index) — reference for all API objects and methods used in scripts
- [Dlubal Software](https://www.dlubal.com)
