dsh-mcp-tia: Controlling TIA Portal Projects with Natural Language in DSH

Preface

When developing industrial automation projects within DSH (DeepSeek Harness), common practices include manually writing scripts to call the TIA Portal Openness API or repeatedly clicking in the TIA Portal GUI. The former requires familiarity with .NET and the Openness object model, while the latter is difficult to integrate into agent sessions. MCP can encapsulate operations like “listing devices, reading blocks, compiling, and saving” as tools. However, Siemens does not provide an official MCP Server, nor does DSH ship with the TIA Portal runtime.

dsh-mcp-tia (maintainer yh01010) is a bridge plugin found in the “Networking Tools” category of the community directory. It utilizes the @deepseek-ai/dsh-mcp-client bundled with the DSH host to launch a locally configured Openness MCP Server, exposing the tools registered by the backend as mcp__tia__*. This allows users to read and write PLC/HMI content, compile, and perform diagnostics using natural language within the session. Installing the plugin does not guarantee functionality—you must provide the backend executable and configure the path in $DSH_HOME/cordis.patch.yml. If the configuration is incorrect, the symptom is “no tools available,” rather than DSH failing to start (failOnStartupError defaults to false).

What is this?

dsh-mcp-tia is a DSH bridge plugin, not an MCP Server, and it does not include TIA Portal, Openness DLLs, or any Siemens software. The plugin package primarily consists of the cordis.patch.yml configuration snippet; the actual driver for TIA Portal is a third-party Openness MCP Server of your choice, which operates the locally installed TIA Portal via TIA Portal Openness.

Prerequisites

Before installing the plugin, ensure your environment meets the hard requirements listed in the README:

  1. Windows. Openness is only implemented for Windows.
  2. TIA Portal Installed (Community backends cover V15–V21). V21 Openness consists of modular DLLs (e.g., PublicAPI\V21\net48\Siemens.Engineering.Base.dll), while V20 and earlier versions use the monolithic Siemens.Engineering.dll; the backend exe must match the TIA Portal major version.
  3. .NET Framework 4.8.
  4. The current user must be added to the local group Siemens TIA Openness and must log out and log back in; otherwise, you may encounter errors regarding missing tools or permissions. Example for Administrator PowerShell:
net localgroup "Siemens TIA Openness" "%USERNAME%" /add
  1. TIA Portal must allow Openness access (available as a security option since V17); use the backend’s doctor subcommand for a self-check first.
  2. You must provide an Openness MCP Server executable yourself (this repository does not supply one).

Core Functionality

The plugin itself only handles “wiring”: it starts the backend process via stdio according to cordis.patch.yml, with the tool prefix mcp__tia__ (determined by serverName: tia). The specific tools available and whether write operations are supported depend on the backend you choose.

The README summarizes three interchangeable open-source backends (you only need to modify command/args):

Backend Supported Versions Tool Scale (per README) Key Points
heilingbrunner/tiaportal-mcp V21 default, older versions via args 65 read-only + 49 write (write requires --allow-write) TiaMcpServer.exe --doctor self-check
Czarnak/tia-portal-mcp V21 only 7 read-only / 17 read-write Global tool tia-mcp, --access-mode read-write
bulaofen0036-coder/TIA_Portal_Openness_MCP V20 + V21 224 (62 exposed by default) Separate exes for V21/V20

When writing text format blocks like SCL/LAD, the README suggests prioritizing heilingbrunner or bulaofen. If you require a smaller tool surface and only need V21, consider Czarnak (which includes guards like dryRun and audit logs). Writes to the TIA Portal project mostly take effect in memory; you must call a save-type tool to persist changes to disk. Downloading to a PLC still requires manual action.

Installation and Enablement

Installing the Plugin

This package is not published to npm and can only be installed from GitHub. The official command is:

dsh plugin --profile desktop add github:yh01010/dsh-mcp-tia

Replace desktop with your profile name. Restart DSH after installation to activate it. Alternatively, add dsh-mcp-tia to your profile’s package.json → dsh.profile.bundles, run pnpm install, and restart.

Three Steps After Installation

  1. Choose a backend from the table above, compile it or use a Release pre-compiled package, and place the exe in a fixed directory (e.g., %USERPROFILE%\.local\bin\).
  2. Run the backend’s doctor to verify .NET, Openness, group membership, and TIA Portal access settings.
  3. Use an id override in $DSH_HOME/cordis.patch.yml to fill in the real command/args, restart DSH again, and you should see mcp__tia__* in the tool list.

Do not use insert to add a line with the same id mcp-tia if the plugin package is already installed. Doing so will result in two mcp-clients competing for serverName: tia, causing a startup error: serverName "tia" is already in use by another mcp-client instance.

Configuration Example

When the plugin package is installed, override the configuration in the home patch (do not modify cordis.patch.yml inside the plugin package):

# $DSH_HOME/cordis.patch.yml
- id: mcp-tia
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: tia
    transport: stdio
    command: 'C:\Users\<your-username>\.local\bin\TiaMcpServer.exe'
    args:
      - '--tia-major-version'
      - '21'
    toolCallTimeoutMs: 180000
    failOnStartupError: false

Once you confirm read-only tools are working, append write-related parameters according to the backend documentation (e.g., heilingbrunner’s --allow-write). toolCallTimeoutMs defaults to 60000 ms; TIA Portal cold starts and compilation can take longer, so the README recommends increasing this. If the path contains spaces, wrap the entire string in YAML single quotes.

Typical Usage

Completing the Wiring via Session

If you prefer not to edit the YAML manually, the README provides a prompt snippet: instruct the agent that the plugin is installed but the path is still a placeholder, ask it to verify the TIA Portal version and Openness group permissions, run the doctor check, edit $DSH_HOME/cordis.patch.yml using the id override method, and remind it to test read-only operations before writing. This requires the session to have write permissions for $DSH_HOME.

Ladder Diagram (LAD) Text Path

The README explains: do not manually write SimaticML FlgNet XML; the reliable path is S7DCL Ladder Diagram text, imported via a documentation-type tool, followed by CompileSoftware → SaveProject. Example snippet:

{ S7_Optimized := "TRUE"; S7_PreferredLanguage := "LAD"; S7_Version := "0.1" }
FUNCTION "Name" : Void
    VAR_INPUT  Start : Bool; END_VAR
    VAR_OUTPUT Run   : Bool; END_VAR
    { S7_Language := "LAD" }
    NETWORK
        RUNG wire#powerrail
            Contact( #Start )
            Coil( #Run )
        END_RUNG
    END_NETWORK
END_FUNCTION

Refer to your chosen backend’s MCP tool list for specific tool names.

Use Cases and Notes

Suitable for: Developers or automation engineers who have deployed TIA Portal on Windows and wish to integrate Openness capabilities into DSH sessions. It is for those who need AI assistance to create projects/devices, generate blocks and variables, compile and diagnose, and save projects, and who are willing to provide and maintain a third-party MCP Server.

Notes:

  • The plugin and backend process run with the permissions of the current DSH process user; before installation, you should review the GitHub repository source code and the MIT license (package.json version 0.1.0).
  • Siemens has no official MCP Server; security and write operation policies are entirely determined by the chosen backend. Do not enable write mode directly on unbacked-up projects.
  • The community plugin directory SkillHub entry is not officially affiliated with DeepSeek or High-Flyer; it is a third-party extension in the “Everything is a Plugin” ecosystem.

Conclusion

dsh-mcp-tia standardizes the wiring between “DSH + Self-hosted Openness MCP Server”: the installation command is fixed, configuration resides in the home patch, and tools are unified as mcp__tia__*. Its value lies in incorporating TIA Portal Openness into the DSH tool surface, rather than replacing TIA Portal or backend implementations.

  • Directory Page: https://www.skillhub.cn/plugins/yh01010/dsh-mcp-tia
  • GitHub: https://github.com/yh01010/dsh-mcp-tia
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye