Skip to main content

The TIA Portal MCP Server is the bridge that finally lets a large-language-model assistant like Claude, ChatGPT, or Cursor read your real Siemens project, analyze the code, cross-reference tag tables, and propose changes — without screenshots, copy-paste, or manual exports. It exposes TIA Portal’s Openness API over the Model Context Protocol (MCP), so any MCP-capable client can talk to your running TIA Portal instance through a stable, tool-based interface.

This is the biggest workflow change in Siemens engineering since V21 added the Engineering Copilot. If you’re writing PLC code in 2026 and you’re not using an MCP-aware assistant yet, you’re leaving 30-40% productivity on the table.

What is MCP and Why Does it Matter for Automation?

Model Context Protocol is an open standard (started by Anthropic in late 2024, now adopted by OpenAI, Google, and most model vendors) that defines how AI assistants connect to external tools and data sources. Think of it as “USB for AI agents” — a single protocol an LLM client can speak, and any data source (database, CRM, PLC, CAD tool) implements once.

Before MCP, if you wanted Claude to help debug a TIA project, you had to:

  1. Screenshot or export the relevant blocks
  2. Paste them into chat
  3. Describe the tag structure manually
  4. Hope the LLM understood the context

With MCP, the assistant calls tools like tia.read_block("Main") or tia.search_tags("motor") and gets live data directly from your open project. No export, no guessing, no stale copies.

What the TIA Portal MCP Server Exposes

The official Siemens server (released alongside TIA Portal V21 and backported to V20 via Openness update) provides the following tool categories:

Tool groupExample toolsTypical use
Project navigationlist_devices, list_blocks, get_project_tree“Show me all F-blocks in this project”
Code readingread_block, read_block_xml, get_block_interface“Explain what FB_Motor_VFD does”
Tag & data blockslist_tags, read_db, search_symbol“Where is tag OvenTemp used?”
Cross-referencesget_cross_ref, get_callers“What calls FB20?”
Code modificationwrite_block, create_block, update_tag“Add a timeout check to Start method”
Compile & checkcompile_device, get_errors“Compile and fix the first 3 errors”
Safety-aware opsread_f_block, compare_f_signatures“Show F-block hash before and after change”

Critical: code-modification tools require explicit confirmation in the TIA Portal UI — the MCP server never writes blocks silently. Read-only operations are free; writes always trigger a dialog.

Architecture

   ┌──────────────────┐        ┌─────────────────────┐
   │   LLM client     │        │     TIA Portal V21  │
   │ (Claude Desktop, │ MCP    │   + Openness API    │
   │  ChatGPT, Cursor,│ stdio  │                     │
   │  your own agent) │  or    │   MCP Server exe    │
   │                  │ HTTP   │   (ships with V21)  │
   └──────────────────┘        └─────────────────────┘
                                         │
                                         ↓
                                  Your .ap20 project
                                  (open in Engineer)

The server runs as a local process alongside the TIA Portal instance. The LLM client connects via stdio (local) or HTTP+SSE (remote, with authentication). Stdio is simpler and safer for engineering workstations; HTTP is used when you’re running assistants on a build server or in a remote lab.

Installation — Connect Claude Desktop to TIA Portal

The fastest path to “it works on my machine”:

1. Enable MCP in TIA Portal V21

Open TIA Portal → Options → Settings → Openness → Enable MCP Server. Set:

  • Transport: stdio (default, safest)
  • Port (HTTP mode only): 7788
  • Access control: “Ask on every write” (recommended) or “Engineer role auto-approve” (advanced)

2. Register the server with Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "tia-portal": {
      "command": "C:\\Program Files\\Siemens\\Automation\\Portal V21\\Bin\\TiaMcpServer.exe",
      "args": ["--project", "C:\\Projects\\MyMachine.ap20"]
    }
  }
}

Restart Claude Desktop. The hammer icon should show tia-portal with 20-30 tools registered.

3. First prompts to try

Start with read-only queries to verify the connection:

  • *”List all PLCs in this project and their firmware versions.”*
  • *”Find every call to FB_Motor_DOL and summarize where it’s used.”*
  • *”Open Main [OB1] and explain the startup logic.”*

If those return sensible answers, you have a working setup.

Real Use Cases That Actually Save Time

Not hype — concrete workflows we’ve run on live OEM projects:

Code review before commissioning

*”Check every F-block for uncommented outputs, unchecked ranges on analog conversions, and missing timeout handling on network reads. Output a markdown checklist.”*

The assistant reads ~50 blocks in sequence, produces a 30-item checklist in 2 minutes. Same task took 4 hours manually.

Migration audit

*”This project was upgraded from S7-300 to S7-1500 last year. Find every remaining legacy instruction (L/T/SLW), list where they appear, and suggest the STL→SCL or LAD modernization.”*

Useful when you inherit brownfield code. The assistant flags the 5% of blocks that survived the auto-migration with old idioms.

Tag naming consistency

*”Compare tag names across all data blocks. Flag inconsistencies in naming convention — mixed camelCase and underscore_case, abbreviations vs full words, unclear units.”*

A single prompt replaces an afternoon of grep + spreadsheet.

Documentation generation

*”For every FB in the Equipment library, generate a markdown doc with: purpose, input/output parameters, methods (if any), typical invocation pattern, known limitations. Write to docs/.md.”*

You get a full API reference for the library, generated from actual code — no stale Word docs.

Bug triage from fault logs

*”The alarm log says ‘Fault 0x80B7 on F-channel 3.2’. Find the related F-block, identify which input channel that maps to, and list upstream blocks that feed into it.”*

Cuts the “where do I even start looking” step on a 2000-block project.

Security Considerations

Giving an AI write access to PLC code is not a small deal. The server is designed with guardrails, but you still need operational discipline.

  • Stdio transport by default — no network exposure unless you explicitly enable HTTP. HTTP mode requires API keys and TLS.
  • Write confirmations — every write_block / update_tag call pops a dialog in TIA Portal showing the exact change (XML diff). Review before clicking OK.
  • Role-based access — the server inherits your TIA Portal login. Read-only users can’t trigger writes via MCP even if the assistant tries.
  • F-block protection — Safety blocks require an additional password prompt. The server cannot bypass this even with admin role.
  • Audit log — every MCP tool call is written to the Openness audit log with timestamp, user, and parameters. Keep this log when working on validated systems.

What you should not do:

  • Don’t point a remote/cloud LLM at a production project over HTTP unless the connection is over a VPN you control
  • Don’t enable “auto-approve writes” on safety-critical code — the manual confirmation is the last guardrail
  • Don’t store the MCP HTTP API key in the same git repo as the project file

Comparison — MCP vs Engineering Copilot vs Openness

All three let you automate TIA Portal, but they solve different problems:

MCP ServerEngineering CopilotOpenness SDK
Added inV21 (SP2 update)V21V13
InterfaceAny MCP client (LLM agent)Built-in AI chat panel.NET API
Best forCross-project AI workflowsInline hints while typingScripted automation (CI, mass updates)
Access scopeWhat the tools exposeCurrent editor contextFull project model
Code writesWith confirmationWith confirmationSilent (by design)
LLM requiredYes (external or local)Siemens-hostedNo
Learning curveLow (prompt the agent)Very low (built-in)Medium (.NET dev)

Practical take: use Copilot for in-editor suggestions, MCP for multi-step cross-cutting tasks with external agents, Openness SDK for deterministic CI/CD pipelines (automated library version bumps, tag naming lint, etc.).

Writing Your Own MCP Client

Because MCP is an open standard, you aren’t locked into Claude Desktop. Minimal Python client using the official mcp SDK:

import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async def main():
    params = StdioServerParameters(
        command=r"C:\Program Files\Siemens\Automation\Portal V21\Bin\TiaMcpServer.exe",
        args=["--project", r"C:\Projects\MyMachine.ap20"]
    )
    async with stdio_client(params) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            tools = await session.list_tools()
            print([t.name for t in tools.tools])

            result = await session.call_tool(
                "list_blocks", {"device": "PLC_1"}
            )
            print(result.content)

asyncio.run(main())

Drop this into a Jupyter notebook and you have a scriptable, chat-less interface to your project — great for batch analysis, CI hooks, or internal dashboards.

Common Pitfalls

  • MCP server won’t start — TIA Portal must be running and have the project open before the assistant connects. The server attaches to the live process, not to the .ap20 file on disk.
  • Tools return empty lists — you probably connected before the project finished loading. Wait for the “Ready” indicator, then ask the assistant to reconnect.
  • Writes silently fail — check the TIA Portal window; there’s likely a pending confirmation dialog hidden behind another window.
  • Performance on big projectsread_block on a 10,000-line block is slow (~2-5 s). Prefer get_block_interface first, then read full body only if needed.
  • F-block writes blocked — correct behavior. Enter the Safety password once per session to enable.

Where This is Going

The MCP ecosystem for industrial automation is ~6 months old and moving fast. Things on the public roadmap:

  • Rockwell Studio 5000 MCP server (teased at Automation Fair 2025, expected H2 2026)
  • Beckhoff TwinCAT community MCP server (open source, Beta available)
  • Codesys MCP bridge for multi-platform agents
  • ControlByte LOGO! MCP extension — experimental, lets an agent drive LOGO! 9 Soft Comfort V9 for training scenarios

Expect an AI-native engineering workflow within 12 months where the assistant stitches together Siemens + Rockwell + Beckhoff projects in one multi-vendor conversation.

FAQ

Do I need TIA Portal V21 to use the MCP server?

The official Siemens server ships with V21 SP2 and is backported to V20 SP1 via the Openness update package. V19 and older require the community-maintained TiaOpennessMcp project on GitHub, which is feature-limited but functional for read-only analysis.

Can the MCP server work with offline .ap20 files?

No — it attaches to a running TIA Portal process with the project loaded. For offline analysis, use the Openness SDK to export XML, then feed the XML to the assistant through a generic filesystem MCP server.

Does this send my PLC code to a cloud LLM?

Only the tool calls and responses that the assistant chooses to make. If you’re using Claude Desktop with a hosted model, the content of read_block responses goes over the network to Anthropic. For air-gapped projects, run a local model (Ollama + Llama 3, or a local Claude via AWS Bedrock VPC) as the MCP client.

Is this covered by our TIA Portal license?

MCP server itself is free and included with V21 Engineering licenses. What you pay for separately (if anything) is the LLM — Claude Desktop is free with an Anthropic subscription, same for ChatGPT Plus. Corporate deployments usually already have an LLM contract.

Can the assistant break my project?

It can make changes you approve. Every write passes through a TIA Portal confirmation dialog showing the XML diff. As long as you read the diff before clicking OK, and your project is under Git version control (V21 has native Git integration), you can always revert. We recommend working on a dev branch when experimenting.

Want hands-on training on AI-augmented TIA Portal engineering? Our Siemens TIA Portal courses at controlbyte.tech now include a dedicated module on MCP workflows — real projects, real Claude setups, real productivity gains. Instructor-led, with V21 lab environments.

Author

Simon Adamek

Author Simon Adamek

IT Engineer and PLC Specialist Manager at ControlByte "Guiding beginners into the world of PLCs and industrial innovation."

More posts by Simon Adamek