WinCC OA MCP Server

WinCC OA MCP Server

A Model Context Protocol server that bridges AI assistants with WinCC OA projects, enabling natural language queries for datapoint search, manager management, and CTL script execution.

Category
访问服务器

README

WinCC OA MCP Server

<div align="center">

Version License VS Code

Model Context Protocol server for WinCC OA - enables AI assistants to interact with WinCC OA projects

FeaturesInstallationUsageKnown Issues

</div>


⚠️ EXPERIMENTAL - Preview Release

This extension is in experimental/preview state. Features may change, break, or be incomplete.

Known Limitations:

  • Not all MCP Server features are available when using the npm package installation method
  • Some tools (e.g., Modbus, advanced datapoint operations) require the Git installation method
  • If you encounter missing tools or errors, switch to Git installation in settings: "winccoa.mcp.installMethod": "git"

Tip: If the extension doesn't work as expected, try Ctrl+Shift+PReload Window to refresh.


🎯 Motivation

This extension provides a Model Context Protocol (MCP) Server for WinCC OA, acting as a bridge between AI assistants (like GitHub Copilot) and your WinCC OA projects.

Note: This extension uses the officially provided WinCC OA MCP Webserver interface developed by Siemens. The extension automates the installation, configuration, and integration of this official webserver into your VS Code workflow.

The goal is to enable developers to use natural language commands to:

  • 🔍 Search and query datapoints
  • 📊 List and monitor managers
  • 📈 Get datapoint values and types
  • ✅ Check manager status
  • 🗂️ Analyze WinCC OA project structure
  • ⚡ Execute CTL scripts

🎬 See It In Action

WinCC OA MCP Server Demo


✨ Features

🧙 Auto-Setup Wizard

  • One-Click Installation: Automatically clones, installs, and configures MCP Server
  • Smart Manager Installation: Post-setup dialog for WinCC OA manager configuration
    • Automatic Mode: Writes manager to config/progs file with auto-assigned number
    • Manual Mode: Shows comprehensive setup instructions
  • Auto-Number Assignment: Finds next free -num X number automatically
  • Restart Reminder: Clear instructions about project restart requirements

🔌 Persistent Client Architecture

  • Auto-Detection: Reads MCP configuration from project's .env file
  • Auto-Connect: Connects to MCP Server on extension activation
  • Auto-Reconnect: Monitors connection with configurable heartbeat
  • Project Integration: Seamless switching between WinCC OA projects

🤖 Language Model Tools

This extension no longer registers Copilot-specific Language Model Tools.

Instead, it installs/configures an MCP server and writes/updates VS Code's native MCP configuration (mcp.servers) so Copilot can call the server's tools directly.

⚙️ User Settings

Configurable options in VS Code Settings:

  • Log Level: Filter log output (debug, info, warn, error)
  • Auto-Reconnect: Enable/disable automatic reconnection (default: true)
  • Reconnect Retries: Configure retry attempts 0-10 (default: 3)
  • Heartbeat Interval: Configure heartbeat check frequency 5s-5min (default: 30s)
  • Show Notifications: Toggle reconnect notifications (default: true)

📊 Status Bar UI

  • Connection Status: Live indicator (🪄 Connected / ⚠️ Disconnected)
  • QuickPick Menu: Click status bar for context-aware actions
    • Connected: Show Server Info, Disconnect, Reconnect, Show Logs
    • Disconnected: Connect, Run Setup, Show Logs

📥 Installation

Prerequisites

  • WinCC OA Project Admin Extension (required for automatic project detection)
  • WinCC OA 3.21+ (officially supported version)
  • Node.js 14+ (for MCP Server runtime)

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "WinCC OA MCP Server"
  4. Click "Install"

🚀 Setup

Automatic Setup (Recommended)

  1. Install Extensions:

    • Install WinCC OA MCP Server extension
    • Install WinCC OA Project Admin extension (dependency)
  2. Select Project:

    • Open WinCC OA Project Admin view
    • Select your project from the list
  3. Run Setup Wizard:

    • If MCP Server not found, extension prompts: "Run Setup Wizard"
    • Click "Install" to start automatic installation
    • Wait for progress: Clone → Install → Generate Token → Configure → Build
  4. Add Manager (v1.1.0):

    • After installation, dialog appears: "Add MCP Server manager?"
    • Choose Automatic or Manual Instructions

    Automatic Mode:

    • Extension writes manager to config/progs file
    • Auto-assigns next free manager number
    • Shows restart reminder

    Manual Mode:

    • Webview panel with comprehensive instructions
    • Two setup options:
      • Option 1 (Recommended): Via PMON Console
      • Option 2: Direct config/progs file editing
    • Copy-ready manager options string
  5. Restart WinCC OA Project:

    • ⚠️ IMPORTANT: Close and reopen your WinCC OA project
    • Manager will appear in PMON Console
    • Manager starts automatically (start mode: always, 3 retries)
  6. Verify Connection:

    • Check status bar: Should show "🪄 WinCC OA Copilot"
    • Click status bar → "Show Server Info" to verify

Manual Setup

If auto-setup fails or you prefer manual installation:

<details> <summary>Click to expand manual setup steps</summary>

  1. Clone MCP Server repository:

    cd <your-project>/javascript
    git clone https://github.com/winccoa/winccoa-ae-js-mcpserver.git mcpServer
    
  2. Install dependencies and build:

    cd mcpServer/mcpWinCCOA
    npm install
    npm run build
    
  3. Create .env file in mcpWinCCOA/build/.env:

    MCP_API_TOKEN=your-secure-token-here
    MCP_MODE=http
    MCP_HTTP_PORT=3001
    MCP_HTTP_HOST=0.0.0.0
    MCP_AUTH_TYPE=bearer
    RATE_LIMIT_ENABLED=true
    MCP_CORS_ENABLED=true
    MCP_CORS_ORIGINS=*
    WINCCOA_FIELD=default
    TOOLS=datapoints/dp_basic,datapoints/dp_create,datapoints/dp_set,manager/manager_list,archive/archive_query
    
  4. Add manager to PMON:

    Option 1 - Via PMON Console (Recommended):

    • Open PMON Console
    • Click "Add Manager"
    • Configure:
      • Component: node
      • Start Mode: always
      • Seconds to Kill: 30
      • Restart Count: 3
      • Reset Min: 1
      • Options: -num 2 mcpServer /path/to/mcpWinCCOA/build/index_http.js

    Option 2 - Edit config/progs:

    • Open <project>/config/progs
    • Add this line (before comments):
      node             | always |      30 |        3 |        1 |-num 2 mcpServer /path/to/mcpWinCCOA/build/index_http.js
      
    • Save file and restart WinCC OA project
  5. Restart WinCC OA Project

</details>


💡 Usage

With GitHub Copilot

Use natural language to interact with your WinCC OA project:

"Show me all datapoints with 'pump' in the name"
"What's the current value of System1:Tank.level?"
"List all running managers"
"Get the type information for ExampleDP_Arg1"
"Execute the test script in scripts/tests/myTest.ctl"

Status Bar Menu

Click "🪄 WinCC OA Copilot" in the status bar to access:

When Connected:

  • 📊 Show Server Info: View project, URL, and available tools
  • 🔌 Disconnect: Close connection to MCP Server
  • 🔄 Reconnect: Reconnect to server
  • 📋 Show Logs: Open extension output channel

When Disconnected:

  • 🔌 Connect: Connect to MCP Server
  • 🛠️ Run Setup: Start MCP Server installation wizard
  • 📋 Show Logs: Open extension output channel

Commands

Available via Command Palette (Ctrl+Shift+P):

  • WinCC OA: Connect to MCP Server
  • WinCC OA: Disconnect from MCP Server
  • WinCC OA: Reconnect to MCP Server
  • WinCC OA: Show Server Info
  • WinCC OA: Run Setup Wizard
  • WinCC OA: Show Logs

⚙️ Configuration

Essential Settings

Setting Default Description
winccoa.mcp.logLevel info Log verbosity: debug, info, warn, error
winccoa.mcp.autoReconnect true Enable automatic reconnection on connection loss
winccoa.mcp.reconnectRetries 3 Number of retry attempts (0-10)
winccoa.mcp.heartbeatInterval 30000 Heartbeat check interval in ms (5000-300000)
winccoa.mcp.showNotifications true Show notifications for reconnect events

💡 Tip: Set log level to debug when reporting bugs for detailed diagnostics.


🐛 Known Issues

Manager Installation

  1. Project Restart Required:

    • After adding MCP Server manager, the WinCC OA project must be restarted
    • Manager will not appear in PMON until restart
    • This is a WinCC OA limitation - config/progs is only read at startup
  2. WinCC OA Complete Restart Sometimes Needed:

    • ⚠️ Known Issue: Sometimes a simple project restart is not enough
    • Symptom: Manager does not appear in PMON Console even after project restart
    • Workaround: Close WinCC OA completely and reopen it
    • Root Cause: WinCC OA caching issue with PMON configuration
    • Recommendation: If manager doesn't appear after first restart, close and reopen WinCC OA

Connection & Auto-Reconnect

  1. Initial Connection Delay:

    • First connection after project start may take 2-3 seconds
    • MCP Server needs time to initialize Node.js manager
  2. Auto-Reconnect Notifications:

    • Can be disabled in settings: winccoa.mcp.showNotifications
    • Notifications appear during temporary connection loss (e.g., server restart)

🔧 Troubleshooting

Manager Not Appearing

Symptom: Manager not visible in PMON Console after restart

Solution:

  1. Restart WinCC OA project again
  2. If still not visible: Close WinCC OA completely and reopen
  3. Verify entry in <project>/config/progs file
  4. Check manager number is unique (no conflicts with existing managers)

Connection Failed

Symptom: Status bar shows "⚠️ WinCC OA Copilot" (red/yellow)

Solution:

  1. Check MCP Server manager is running in PMON
  2. Verify .env file exists: <project>/javascript/mcpServer/mcpWinCCOA/build/.env
  3. Check port 3001 is not blocked by firewall
  4. Check logs: Click status bar → "Show Logs"

Setup Wizard Fails

Symptom: Installation errors during setup wizard

Solution:

  1. Check Node.js is installed: node --version
  2. Check Git is installed: git --version
  3. Check internet connection (for git clone and npm install)
  4. Try manual setup (see Manual Setup)

📚 Requirements

  • VS Code: 1.110.0 or higher
  • WinCC OA: 3.21 or higher (officially supported)
  • Node.js: 14 or higher (for MCP Server runtime)
  • WinCC OA Project Admin Extension: Required for automatic project detection

License

MIT © Richard Janisch - See LICENSE file for details


🙏 Acknowledgments

  • WinCC OA development team for the MCP Server implementation
  • GitHub Copilot / VS Code team for MCP integration
  • VS Code extension development community

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选