@etm-professional-control/winccoa-mcp-server 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +22 -2
- package/README.md +44 -12
- package/build/config/server.config.d.ts +17 -51
- package/build/config/server.config.d.ts.map +1 -1
- package/build/config/server.config.js +20 -6
- package/build/config/server.config.js.map +1 -1
- package/build/helpers/dashboards/DashboardManager.d.ts +112 -0
- package/build/helpers/dashboards/DashboardManager.d.ts.map +1 -0
- package/build/helpers/dashboards/DashboardManager.js +548 -0
- package/build/helpers/dashboards/DashboardManager.js.map +1 -0
- package/build/helpers/dashboards/LayoutHelper.d.ts +94 -0
- package/build/helpers/dashboards/LayoutHelper.d.ts.map +1 -0
- package/build/helpers/dashboards/LayoutHelper.js +196 -0
- package/build/helpers/dashboards/LayoutHelper.js.map +1 -0
- package/build/helpers/dashboards/WidgetFactory.d.ts +72 -0
- package/build/helpers/dashboards/WidgetFactory.d.ts.map +1 -0
- package/build/helpers/dashboards/WidgetFactory.js +577 -0
- package/build/helpers/dashboards/WidgetFactory.js.map +1 -0
- package/build/helpers/drivers/BaseConnection.d.ts +93 -0
- package/build/helpers/drivers/BaseConnection.d.ts.map +1 -0
- package/build/helpers/drivers/BaseConnection.js +336 -0
- package/build/helpers/drivers/BaseConnection.js.map +1 -0
- package/build/helpers/drivers/OpcUaConnection.d.ts +318 -0
- package/build/helpers/drivers/OpcUaConnection.d.ts.map +1 -0
- package/build/helpers/drivers/OpcUaConnection.js +2382 -0
- package/build/helpers/drivers/OpcUaConnection.js.map +1 -0
- package/build/helpers/icons/IconGenerator.d.ts +60 -0
- package/build/helpers/icons/IconGenerator.d.ts.map +1 -0
- package/build/helpers/icons/IconGenerator.js +153 -0
- package/build/helpers/icons/IconGenerator.js.map +1 -0
- package/build/helpers/icons/IconList.d.ts +66 -0
- package/build/helpers/icons/IconList.d.ts.map +1 -0
- package/build/helpers/icons/IconList.js +408 -0
- package/build/helpers/icons/IconList.js.map +1 -0
- package/build/helpers/pmon/PmonClient.d.ts +105 -0
- package/build/helpers/pmon/PmonClient.d.ts.map +1 -0
- package/build/helpers/pmon/PmonClient.js +438 -0
- package/build/helpers/pmon/PmonClient.js.map +1 -0
- package/build/index_http.d.ts +3 -0
- package/build/index_http.d.ts.map +1 -1
- package/build/index_http.js +40 -22
- package/build/index_http.js.map +1 -1
- package/build/index_stdio.d.ts +3 -0
- package/build/index_stdio.d.ts.map +1 -1
- package/build/index_stdio.js +1 -0
- package/build/index_stdio.js.map +1 -1
- package/build/server.d.ts +11 -5
- package/build/server.d.ts.map +1 -1
- package/build/server.js +43 -25
- package/build/server.js.map +1 -1
- package/build/tool_loader.d.ts +14 -7
- package/build/tool_loader.d.ts.map +1 -1
- package/build/tool_loader.js +48 -15
- package/build/tool_loader.js.map +1 -1
- package/build/tools/alarms/alarm_delete.d.ts +14 -0
- package/build/tools/alarms/alarm_delete.d.ts.map +1 -0
- package/build/tools/alarms/alarm_delete.js +103 -0
- package/build/tools/alarms/alarm_delete.js.map +1 -0
- package/build/tools/alarms/alarm_set.d.ts +14 -0
- package/build/tools/alarms/alarm_set.d.ts.map +1 -0
- package/build/tools/alarms/alarm_set.js +331 -0
- package/build/tools/alarms/alarm_set.js.map +1 -0
- package/build/tools/archive/archive_delete.d.ts +14 -0
- package/build/tools/archive/archive_delete.d.ts.map +1 -0
- package/build/tools/archive/archive_delete.js +78 -0
- package/build/tools/archive/archive_delete.js.map +1 -0
- package/build/tools/archive/archive_query.d.ts +14 -0
- package/build/tools/archive/archive_query.d.ts.map +1 -0
- package/build/tools/archive/archive_query.js +155 -0
- package/build/tools/archive/archive_query.js.map +1 -0
- package/build/tools/archive/archive_set.d.ts +14 -0
- package/build/tools/archive/archive_set.d.ts.map +1 -0
- package/build/tools/archive/archive_set.js +133 -0
- package/build/tools/archive/archive_set.js.map +1 -0
- package/build/tools/common/common_delete.d.ts +14 -0
- package/build/tools/common/common_delete.d.ts.map +1 -0
- package/build/tools/common/common_delete.js +146 -0
- package/build/tools/common/common_delete.js.map +1 -0
- package/build/tools/common/common_query.d.ts +14 -0
- package/build/tools/common/common_query.d.ts.map +1 -0
- package/build/tools/common/common_query.js +118 -0
- package/build/tools/common/common_query.js.map +1 -0
- package/build/tools/common/common_set.d.ts +14 -0
- package/build/tools/common/common_set.d.ts.map +1 -0
- package/build/tools/common/common_set.js +149 -0
- package/build/tools/common/common_set.js.map +1 -0
- package/build/tools/dashboards/dashboard.d.ts +14 -0
- package/build/tools/dashboards/dashboard.d.ts.map +1 -0
- package/build/tools/dashboards/dashboard.js +195 -0
- package/build/tools/dashboards/dashboard.js.map +1 -0
- package/build/tools/dashboards/widget.d.ts +14 -0
- package/build/tools/dashboards/widget.d.ts.map +1 -0
- package/build/tools/dashboards/widget.js +779 -0
- package/build/tools/dashboards/widget.js.map +1 -0
- package/build/tools/datapoints/dp_basic.d.ts +10 -4
- package/build/tools/datapoints/dp_basic.d.ts.map +1 -1
- package/build/tools/datapoints/dp_basic.js +65 -41
- package/build/tools/datapoints/dp_basic.js.map +1 -1
- package/build/tools/datapoints/dp_create.d.ts +10 -4
- package/build/tools/datapoints/dp_create.d.ts.map +1 -1
- package/build/tools/datapoints/dp_create.js +30 -21
- package/build/tools/datapoints/dp_create.js.map +1 -1
- package/build/tools/datapoints/dp_set.d.ts +10 -4
- package/build/tools/datapoints/dp_set.d.ts.map +1 -1
- package/build/tools/datapoints/dp_set.js +27 -12
- package/build/tools/datapoints/dp_set.js.map +1 -1
- package/build/tools/datapoints/dp_type_create.d.ts +14 -0
- package/build/tools/datapoints/dp_type_create.d.ts.map +1 -0
- package/build/tools/datapoints/dp_type_create.js +268 -0
- package/build/tools/datapoints/dp_type_create.js.map +1 -0
- package/build/tools/datapoints/dp_types.d.ts +10 -4
- package/build/tools/datapoints/dp_types.d.ts.map +1 -1
- package/build/tools/datapoints/dp_types.js +29 -17
- package/build/tools/datapoints/dp_types.js.map +1 -1
- package/build/tools/icons/icon.d.ts +14 -0
- package/build/tools/icons/icon.d.ts.map +1 -0
- package/build/tools/icons/icon.js +367 -0
- package/build/tools/icons/icon.js.map +1 -0
- package/build/tools/manager/manager_add.d.ts +14 -0
- package/build/tools/manager/manager_add.d.ts.map +1 -0
- package/build/tools/manager/manager_add.js +87 -0
- package/build/tools/manager/manager_add.js.map +1 -0
- package/build/tools/manager/manager_control.d.ts +14 -0
- package/build/tools/manager/manager_control.d.ts.map +1 -0
- package/build/tools/manager/manager_control.js +178 -0
- package/build/tools/manager/manager_control.js.map +1 -0
- package/build/tools/manager/manager_list.d.ts +14 -0
- package/build/tools/manager/manager_list.d.ts.map +1 -0
- package/build/tools/manager/manager_list.js +166 -0
- package/build/tools/manager/manager_list.js.map +1 -0
- package/build/tools/manager/manager_properties.d.ts +14 -0
- package/build/tools/manager/manager_properties.d.ts.map +1 -0
- package/build/tools/manager/manager_properties.js +144 -0
- package/build/tools/manager/manager_properties.js.map +1 -0
- package/build/tools/manager/manager_remove.d.ts +14 -0
- package/build/tools/manager/manager_remove.d.ts.map +1 -0
- package/build/tools/manager/manager_remove.js +72 -0
- package/build/tools/manager/manager_remove.js.map +1 -0
- package/build/tools/opcua/opcua_address.d.ts +14 -0
- package/build/tools/opcua/opcua_address.d.ts.map +1 -0
- package/build/tools/opcua/opcua_address.js +118 -0
- package/build/tools/opcua/opcua_address.js.map +1 -0
- package/build/tools/opcua/opcua_connection.d.ts +14 -0
- package/build/tools/opcua/opcua_connection.d.ts.map +1 -0
- package/build/tools/opcua/opcua_connection.js +368 -0
- package/build/tools/opcua/opcua_connection.js.map +1 -0
- package/build/tools/pv_range/pv_range_delete.d.ts +14 -0
- package/build/tools/pv_range/pv_range_delete.d.ts.map +1 -0
- package/build/tools/pv_range/pv_range_delete.js +78 -0
- package/build/tools/pv_range/pv_range_delete.js.map +1 -0
- package/build/tools/pv_range/pv_range_query.d.ts +14 -0
- package/build/tools/pv_range/pv_range_query.d.ts.map +1 -0
- package/build/tools/pv_range/pv_range_query.js +111 -0
- package/build/tools/pv_range/pv_range_query.js.map +1 -0
- package/build/tools/pv_range/pv_range_set.d.ts +14 -0
- package/build/tools/pv_range/pv_range_set.d.ts.map +1 -0
- package/build/tools/pv_range/pv_range_set.js +188 -0
- package/build/tools/pv_range/pv_range_set.js.map +1 -0
- package/build/types/dashboards/dashboard.d.ts +91 -0
- package/build/types/dashboards/dashboard.d.ts.map +1 -0
- package/build/types/dashboards/dashboard.js +59 -0
- package/build/types/dashboards/dashboard.js.map +1 -0
- package/build/types/dashboards/layout.d.ts +121 -0
- package/build/types/dashboards/layout.d.ts.map +1 -0
- package/build/types/dashboards/layout.js +121 -0
- package/build/types/dashboards/layout.js.map +1 -0
- package/build/types/dashboards/schema.d.ts +143 -0
- package/build/types/dashboards/schema.d.ts.map +1 -0
- package/build/types/dashboards/schema.js +71 -0
- package/build/types/dashboards/schema.js.map +1 -0
- package/build/types/dashboards/widgets.d.ts +284 -0
- package/build/types/dashboards/widgets.d.ts.map +1 -0
- package/build/types/dashboards/widgets.js +61 -0
- package/build/types/dashboards/widgets.js.map +1 -0
- package/build/types/drivers/browse.d.ts +136 -0
- package/build/types/drivers/browse.d.ts.map +1 -0
- package/build/types/drivers/browse.js +18 -0
- package/build/types/drivers/browse.js.map +1 -0
- package/build/types/drivers/connection.d.ts +68 -0
- package/build/types/drivers/connection.d.ts.map +1 -0
- package/build/types/drivers/connection.js +37 -0
- package/build/types/drivers/connection.js.map +1 -0
- package/build/types/index.d.ts +20 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +26 -0
- package/build/types/index.js.map +1 -0
- package/build/types/mcp/responses.d.ts +41 -0
- package/build/types/mcp/responses.d.ts.map +1 -0
- package/build/types/mcp/responses.js +7 -0
- package/build/types/mcp/responses.js.map +1 -0
- package/build/types/pmon/protocol.d.ts +140 -0
- package/build/types/pmon/protocol.d.ts.map +1 -0
- package/build/types/pmon/protocol.js +49 -0
- package/build/types/pmon/protocol.js.map +1 -0
- package/build/types/server/config.d.ts +89 -0
- package/build/types/server/config.d.ts.map +1 -0
- package/build/types/server/config.js +7 -0
- package/build/types/server/config.js.map +1 -0
- package/build/types/server/context.d.ts +23 -0
- package/build/types/server/context.d.ts.map +1 -0
- package/build/types/server/context.js +7 -0
- package/build/types/server/context.js.map +1 -0
- package/build/types/tools/index.d.ts +33 -0
- package/build/types/tools/index.d.ts.map +1 -0
- package/build/types/tools/index.js +7 -0
- package/build/types/tools/index.js.map +1 -0
- package/build/types/winccoa/constants.d.ts +262 -0
- package/build/types/winccoa/constants.d.ts.map +1 -0
- package/build/types/winccoa/constants.js +269 -0
- package/build/types/winccoa/constants.js.map +1 -0
- package/build/types/winccoa/datapoint.d.ts +83 -0
- package/build/types/winccoa/datapoint.d.ts.map +1 -0
- package/build/types/winccoa/datapoint.js +7 -0
- package/build/types/winccoa/datapoint.js.map +1 -0
- package/build/types/winccoa/manager.d.ts +74 -0
- package/build/types/winccoa/manager.d.ts.map +1 -0
- package/build/types/winccoa/manager.js +45 -0
- package/build/types/winccoa/manager.js.map +1 -0
- package/build/utils/helpers.d.ts +40 -19
- package/build/utils/helpers.d.ts.map +1 -1
- package/build/utils/helpers.js +67 -23
- package/build/utils/helpers.js.map +1 -1
- package/build/utils/managerInfo.d.ts +23 -0
- package/build/utils/managerInfo.d.ts.map +1 -0
- package/build/utils/managerInfo.js +52 -0
- package/build/utils/managerInfo.js.map +1 -0
- package/package.json +6 -4
- package/postinstall.cjs +9 -0
package/.env.example
CHANGED
|
@@ -62,11 +62,31 @@ WINCCOA_FIELD=default
|
|
|
62
62
|
# For production: Create your own project-specific instructions
|
|
63
63
|
# WINCCOA_PROJECT_INSTRUCTIONS=javascript/mcpServer/project-instructions.md
|
|
64
64
|
|
|
65
|
+
# ====================
|
|
66
|
+
# PMON CONFIGURATION
|
|
67
|
+
# ====================
|
|
68
|
+
|
|
69
|
+
# Pmon TCP Connection Settings (optional - defaults to localhost:4999)
|
|
70
|
+
# WINCCOA_PMON_HOST=localhost
|
|
71
|
+
# WINCCOA_PMON_PORT=4999
|
|
72
|
+
|
|
73
|
+
# Pmon Authentication (optional - leave empty for no authentication)
|
|
74
|
+
# WINCCOA_PMON_USER=
|
|
75
|
+
# WINCCOA_PMON_PASSWORD=
|
|
65
76
|
|
|
66
77
|
# ====================
|
|
67
78
|
# TOOLS CONFIGURATION
|
|
68
79
|
# ====================
|
|
69
80
|
|
|
70
81
|
# Tools to load (comma-separated list of relative paths without .js extension)
|
|
71
|
-
# Available tools:
|
|
72
|
-
|
|
82
|
+
# Available tools:
|
|
83
|
+
# - Datapoints: datapoints/dp_basic, datapoints/dp_create, datapoints/dp_set, datapoints/dp_types, datapoints/dp_type_create
|
|
84
|
+
# - Icons: icons/icon (for creating custom SVG icons for widget headers/footers)
|
|
85
|
+
# - OPC UA: opcua/opcua_connection, opcua/opcua_address
|
|
86
|
+
# - Common Config: common/common_query, common/common_set, common/common_delete
|
|
87
|
+
# - Alarms: alarms/alarm_set, alarms/alarm_delete
|
|
88
|
+
# - Archive: archive/archive_set, archive/archive_delete, archive/archive_query
|
|
89
|
+
# - Dashboards: dashboards/dashboard, dashboards/widget
|
|
90
|
+
# - PV Range: pv_range/pv_range_query, pv_range/pv_range_set, pv_range/pv_range_delete
|
|
91
|
+
# - Manager: manager/manager_list, manager/manager_add, manager/manager_remove, manager/manager_control, manager/manager_properties
|
|
92
|
+
TOOLS=datapoints/dp_basic,datapoints/dp_create,datapoints/dp_set,datapoints/dp_types,datapoints/dp_type_create,icons/icon,opcua/opcua_connection,opcua/opcua_address,common/common_query,common/common_set,common/common_delete,alarms/alarm_set,alarms/alarm_delete,archive/archive_set,archive/archive_delete,archive/archive_query,dashboards/dashboard,dashboards/widget,pv_range/pv_range_query,pv_range/pv_range_set,pv_range/pv_range_delete
|
package/README.md
CHANGED
|
@@ -14,16 +14,24 @@ This Model Context Protocol (MCP) server connects AI assistants to WinCC OA SCAD
|
|
|
14
14
|
-
|
|
15
15
|
## ⚠️ Warning
|
|
16
16
|
|
|
17
|
-
**This tool can modify
|
|
17
|
+
**This tool can modify your WinCC OA system configuration and runtime data.** Changes made through this MCP server directly affect your SCADA system and connected industrial processes. Use at your own risk and ensure proper testing in a safe environment before deploying to production systems.
|
|
18
18
|
|
|
19
|
-
**To prevent write operations**, exclude these
|
|
20
|
-
- `datapoints/dp_set`
|
|
21
|
-
- `
|
|
19
|
+
**To prevent write operations to SCADA configuration and runtime data**, exclude these tool categories from your configuration:
|
|
20
|
+
- **Datapoints**: `datapoints/dp_set`, `datapoints/dp_create`, `datapoints/dp_type_create`
|
|
21
|
+
- **Alarms**: `alarms/alarm_set`, `alarms/alarm_delete`
|
|
22
|
+
- **Archives**: `archive/archive_set`, `archive/archive_delete`
|
|
23
|
+
- **Common Config**: `common/common_set`, `common/common_delete`
|
|
24
|
+
- **PV Ranges**: `pv_range/pv_range_set`, `pv_range/pv_range_delete`
|
|
25
|
+
- **Managers**: `manager/manager_control`, `manager/manager_add`, `manager/manager_remove`, `manager/manager_properties`
|
|
26
|
+
- **Dashboards**: `dashboards/dashboard`, `dashboards/widget`
|
|
27
|
+
- **OPC UA**: `opcua/opcua_connection`, `opcua/opcua_address`
|
|
28
|
+
|
|
29
|
+
**Note**: Icon tools (`icons/icon`) create/delete SVG files but don't modify SCADA data.
|
|
22
30
|
|
|
23
31
|
Example read-only configuration:
|
|
24
32
|
```env
|
|
25
33
|
# Only include read operations
|
|
26
|
-
TOOLS=datapoints/dp_basic,datapoints/dp_types
|
|
34
|
+
TOOLS=datapoints/dp_basic,datapoints/dp_types,archive/archive_query,common/common_query,pv_range/pv_range_query,manager/manager_list,opcua/opcua_connection
|
|
27
35
|
```
|
|
28
36
|
|
|
29
37
|
## Prerequisites
|
|
@@ -87,8 +95,18 @@ MCP_API_TOKEN=your-secure-token-here
|
|
|
87
95
|
# Choose industry context
|
|
88
96
|
WINCCOA_FIELD=default # or 'oil', 'transport'
|
|
89
97
|
|
|
90
|
-
# Configure available tools
|
|
91
|
-
|
|
98
|
+
# Configure available tools (examples - see docs/TOOLS.md for complete list)
|
|
99
|
+
# Full feature set
|
|
100
|
+
TOOLS=datapoints/dp_basic,datapoints/dp_set,opcua/opcua_connection,dashboards/dashboard,manager/manager_list
|
|
101
|
+
|
|
102
|
+
# Dashboard-focused setup
|
|
103
|
+
# TOOLS=datapoints/dp_basic,dashboards/dashboard,dashboards/widget,icons/icon
|
|
104
|
+
|
|
105
|
+
# Manager control setup
|
|
106
|
+
# TOOLS=manager/manager_list,manager/manager_control,manager/manager_add
|
|
107
|
+
|
|
108
|
+
# Read-only monitoring
|
|
109
|
+
# TOOLS=datapoints/dp_basic,archive/archive_query,alarms/alarm_query,manager/manager_list
|
|
92
110
|
```
|
|
93
111
|
|
|
94
112
|
### 3. Start Server
|
|
@@ -150,11 +168,25 @@ This method uses `cmd` to properly handle paths with spaces in Windows.
|
|
|
150
168
|
|
|
151
169
|
## Features
|
|
152
170
|
|
|
153
|
-
✅ **Secure API** - Token-based authentication
|
|
154
|
-
✅ **Industry Templates** - Pre-configured for Oil & Gas, Transportation
|
|
155
|
-
✅ **Custom Tools** - Extend with your own WinCC OA integrations
|
|
156
|
-
✅ **Project Rules** - Plant-specific AI guidance
|
|
157
|
-
✅ **Dynamic Loading** - Configure only needed tools
|
|
171
|
+
✅ **Secure API** - Token-based authentication
|
|
172
|
+
✅ **Industry Templates** - Pre-configured for Oil & Gas, Transportation
|
|
173
|
+
✅ **Custom Tools** - Extend with your own WinCC OA integrations
|
|
174
|
+
✅ **Project Rules** - Plant-specific AI guidance
|
|
175
|
+
✅ **Dynamic Loading** - Configure only needed tools
|
|
176
|
+
|
|
177
|
+
### Available Tool Categories
|
|
178
|
+
|
|
179
|
+
- **📊 Datapoints** - Read, write, and create datapoints and types
|
|
180
|
+
- **🔗 OPC UA** - Connect to OPC UA servers and browse address spaces
|
|
181
|
+
- **📈 Dashboards & Widgets** - Create and manage visualization dashboards
|
|
182
|
+
- **🚨 Alarms** - Configure alarm thresholds and notifications
|
|
183
|
+
- **📁 Archives** - Query and configure historical data storage
|
|
184
|
+
- **⚙️ Manager Control** - Start, stop, and manage WinCC OA processes (Pmon)
|
|
185
|
+
- **🔧 Common Config** - Set descriptions, aliases, formats, and units
|
|
186
|
+
- **✓ PV Range Validation** - Define min/max value ranges
|
|
187
|
+
- **🎨 Icons** - Create custom SVG icons and browse 1,400+ built-in Siemens IX icons
|
|
188
|
+
|
|
189
|
+
See **[🔧 TOOLS.md](docs/TOOLS.md)** for complete tool documentation.
|
|
158
190
|
|
|
159
191
|
## Support
|
|
160
192
|
|
|
@@ -1,52 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { enabled_1 as enabled };
|
|
19
|
-
export let secret: string | undefined;
|
|
20
|
-
export let expiresIn: string;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
namespace cors {
|
|
24
|
-
let enabled_2: boolean;
|
|
25
|
-
export { enabled_2 as enabled };
|
|
26
|
-
export let origins: string[];
|
|
27
|
-
export let credentials: boolean;
|
|
28
|
-
}
|
|
29
|
-
namespace ssl {
|
|
30
|
-
let enabled_3: boolean;
|
|
31
|
-
export { enabled_3 as enabled };
|
|
32
|
-
export let cert: string | undefined;
|
|
33
|
-
export let key: string | undefined;
|
|
34
|
-
export let ca: string | undefined;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
namespace security {
|
|
38
|
-
namespace rateLimit {
|
|
39
|
-
let enabled_4: boolean;
|
|
40
|
-
export { enabled_4 as enabled };
|
|
41
|
-
export let windowMs: number;
|
|
42
|
-
export let max: number;
|
|
43
|
-
}
|
|
44
|
-
namespace ipFilter {
|
|
45
|
-
let enabled_5: boolean;
|
|
46
|
-
export { enabled_5 as enabled };
|
|
47
|
-
export let whitelist: string[];
|
|
48
|
-
export let blacklist: string[];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Server Deployment Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for HTTP/STDIO server modes, authentication, CORS, SSL, and security.
|
|
5
|
+
*/
|
|
6
|
+
import type { ServerConfig, SslCertificates } from '../types/index.js';
|
|
7
|
+
export declare const serverConfig: ServerConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Helper function to load SSL certificates
|
|
10
|
+
* @returns SSL certificate data or null if SSL is disabled or loading fails
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadSSLConfig(): SslCertificates | null;
|
|
13
|
+
/**
|
|
14
|
+
* Validate configuration
|
|
15
|
+
* @returns Array of validation error messages (empty if valid)
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateConfig(): string[];
|
|
52
18
|
//# sourceMappingURL=server.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.config.d.ts","sourceRoot":"","sources":["../../src/config/server.config.
|
|
1
|
+
{"version":3,"file":"server.config.d.ts","sourceRoot":"","sources":["../../src/config/server.config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGvE,eAAO,MAAM,YAAY,EAAE,YAuD1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,IAAI,eAAe,GAAG,IAAI,CAmBtD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAiBzC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server Deployment Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for HTTP/STDIO server modes, authentication, CORS, SSL, and security.
|
|
5
|
+
*/
|
|
1
6
|
import { readFileSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
7
|
// Server deployment configuration
|
|
4
8
|
export const serverConfig = {
|
|
5
9
|
// Server mode configuration
|
|
6
|
-
mode: process.env.MCP_MODE || 'http',
|
|
10
|
+
mode: process.env.MCP_MODE || 'http',
|
|
7
11
|
// HTTP server configuration
|
|
8
12
|
http: {
|
|
9
13
|
port: parseInt(process.env.MCP_HTTP_PORT || '3000'),
|
|
@@ -11,7 +15,7 @@ export const serverConfig = {
|
|
|
11
15
|
// Authentication configuration
|
|
12
16
|
auth: {
|
|
13
17
|
enabled: true, // Always enabled for security
|
|
14
|
-
type: process.env.MCP_AUTH_TYPE || 'bearer',
|
|
18
|
+
type: process.env.MCP_AUTH_TYPE || 'bearer',
|
|
15
19
|
token: process.env.MCP_API_TOKEN, // Required - no default
|
|
16
20
|
// Additional auth options for future expansion
|
|
17
21
|
jwt: {
|
|
@@ -48,14 +52,21 @@ export const serverConfig = {
|
|
|
48
52
|
whitelist: process.env.IP_WHITELIST ? process.env.IP_WHITELIST.split(',') : [],
|
|
49
53
|
blacklist: process.env.IP_BLACKLIST ? process.env.IP_BLACKLIST.split(',') : []
|
|
50
54
|
}
|
|
51
|
-
}
|
|
55
|
+
}
|
|
52
56
|
};
|
|
53
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Helper function to load SSL certificates
|
|
59
|
+
* @returns SSL certificate data or null if SSL is disabled or loading fails
|
|
60
|
+
*/
|
|
54
61
|
export function loadSSLConfig() {
|
|
55
62
|
const config = serverConfig.http.ssl;
|
|
56
63
|
if (!config.enabled)
|
|
57
64
|
return null;
|
|
58
65
|
try {
|
|
66
|
+
if (!config.cert || !config.key) {
|
|
67
|
+
console.error('SSL enabled but cert or key path not configured');
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
59
70
|
return {
|
|
60
71
|
cert: readFileSync(config.cert),
|
|
61
72
|
key: readFileSync(config.key),
|
|
@@ -67,7 +78,10 @@ export function loadSSLConfig() {
|
|
|
67
78
|
return null;
|
|
68
79
|
}
|
|
69
80
|
}
|
|
70
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Validate configuration
|
|
83
|
+
* @returns Array of validation error messages (empty if valid)
|
|
84
|
+
*/
|
|
71
85
|
export function validateConfig() {
|
|
72
86
|
console.log('🔍 Starting configuration validation...');
|
|
73
87
|
console.log('🔍 process.env.MCP_API_TOKEN:', process.env.MCP_API_TOKEN ? 'SET' : 'NOT SET');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.config.js","sourceRoot":"","sources":["../../src/config/server.config.
|
|
1
|
+
{"version":3,"file":"server.config.js","sourceRoot":"","sources":["../../src/config/server.config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAGlC,kCAAkC;AAClC,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,4BAA4B;IAC5B,IAAI,EAAG,OAAO,CAAC,GAAG,CAAC,QAA6B,IAAI,MAAM;IAE1D,4BAA4B;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,MAAM,CAAC;QACnD,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,EAAE,iDAAiD;QAE/F,+BAA+B;QAC/B,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI,EAAE,8BAA8B;YAC7C,IAAI,EAAG,OAAO,CAAC,GAAG,CAAC,aAAsC,IAAI,QAAQ;YACrE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,wBAAwB;YAE1D,+CAA+C;YAC/C,GAAG,EAAE;gBACH,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM;gBAC/C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;gBAClC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,KAAK;aACnD;SACF;QAED,+CAA+C;QAC/C,IA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B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard Manager
|
|
3
|
+
*
|
|
4
|
+
* Central class for managing dashboards and widgets in WinCC OA.
|
|
5
|
+
* Provides CRUD operations for dashboards and widgets.
|
|
6
|
+
*/
|
|
7
|
+
import type { WinccoaManager } from 'winccoa-manager';
|
|
8
|
+
import { WidgetFactory } from './WidgetFactory.js';
|
|
9
|
+
import { LayoutHelper } from './LayoutHelper.js';
|
|
10
|
+
import type { DashboardConfig, DashboardInfo, WidgetIdentifier } from '../../types/dashboards/dashboard.js';
|
|
11
|
+
import type { WidgetInstance } from '../../types/dashboards/schema.js';
|
|
12
|
+
import type { WidgetConfig } from '../../types/dashboards/widgets.js';
|
|
13
|
+
/**
|
|
14
|
+
* Dashboard Manager Class
|
|
15
|
+
*/
|
|
16
|
+
export declare class DashboardManager {
|
|
17
|
+
private winccoa;
|
|
18
|
+
private widgetFactory;
|
|
19
|
+
private layoutHelper;
|
|
20
|
+
constructor(winccoa: WinccoaManager);
|
|
21
|
+
/**
|
|
22
|
+
* Get the WidgetFactory instance (for registering custom widget types)
|
|
23
|
+
*/
|
|
24
|
+
getWidgetFactory(): WidgetFactory;
|
|
25
|
+
/**
|
|
26
|
+
* Get the LayoutHelper instance
|
|
27
|
+
*/
|
|
28
|
+
getLayoutHelper(): LayoutHelper;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new dashboard
|
|
31
|
+
* @param config - Dashboard configuration (name, description, createdBy)
|
|
32
|
+
* @returns Dashboard datapoint name (e.g. "_Dashboard_000001")
|
|
33
|
+
*/
|
|
34
|
+
createDashboard(config: DashboardConfig): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Edit dashboard properties
|
|
37
|
+
* @param dashboardId - Dashboard datapoint name
|
|
38
|
+
* @param updates - Properties to update (name and/or description)
|
|
39
|
+
*/
|
|
40
|
+
editDashboard(dashboardId: string, updates: Partial<DashboardConfig>): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete a dashboard
|
|
43
|
+
* @param dashboardId - Dashboard datapoint name
|
|
44
|
+
*/
|
|
45
|
+
deleteDashboard(dashboardId: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* List all dashboards
|
|
48
|
+
* @returns Array of dashboard information
|
|
49
|
+
*/
|
|
50
|
+
listDashboards(): Promise<DashboardInfo[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Add a widget to a dashboard
|
|
53
|
+
* @param dashboardId - Dashboard datapoint name
|
|
54
|
+
* @param config - Widget configuration
|
|
55
|
+
* @returns Widget ID (UUID)
|
|
56
|
+
*/
|
|
57
|
+
addWidget(dashboardId: string, config: WidgetConfig): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Edit a widget on a dashboard
|
|
60
|
+
* @param dashboardId - Dashboard datapoint name
|
|
61
|
+
* @param identifier - Widget identifier (by ID or index)
|
|
62
|
+
* @param updates - Widget configuration updates
|
|
63
|
+
*/
|
|
64
|
+
editWidget(dashboardId: string, identifier: WidgetIdentifier, updates: Partial<WidgetConfig>): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a widget from a dashboard
|
|
67
|
+
* @param dashboardId - Dashboard datapoint name
|
|
68
|
+
* @param identifier - Widget identifier (by ID or index)
|
|
69
|
+
*/
|
|
70
|
+
deleteWidget(dashboardId: string, identifier: WidgetIdentifier): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* List all widgets on a dashboard
|
|
73
|
+
* @param dashboardId - Dashboard datapoint name
|
|
74
|
+
* @returns Array of widget instances
|
|
75
|
+
*/
|
|
76
|
+
listWidgets(dashboardId: string): Promise<WidgetInstance[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Get next available dashboard number
|
|
79
|
+
* @returns Next dashboard number
|
|
80
|
+
*/
|
|
81
|
+
private getNextDashboardNumber;
|
|
82
|
+
/**
|
|
83
|
+
* Get widgets from dashboard
|
|
84
|
+
* @param dashboardId - Dashboard datapoint name
|
|
85
|
+
* @returns Array of widget instances
|
|
86
|
+
*/
|
|
87
|
+
private getWidgets;
|
|
88
|
+
/**
|
|
89
|
+
* Find widget index by identifier
|
|
90
|
+
* @param widgets - Array of widgets
|
|
91
|
+
* @param identifier - Widget identifier
|
|
92
|
+
* @returns Widget index or -1 if not found
|
|
93
|
+
*/
|
|
94
|
+
private findWidgetIndex;
|
|
95
|
+
/**
|
|
96
|
+
* Validate widget configuration
|
|
97
|
+
* @param config - Widget configuration
|
|
98
|
+
*/
|
|
99
|
+
private validateWidgetConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Validate that datapoints exist
|
|
102
|
+
* @param config - Widget configuration
|
|
103
|
+
*/
|
|
104
|
+
private validateDatapoints;
|
|
105
|
+
/**
|
|
106
|
+
* Get unit from datapoint configuration
|
|
107
|
+
* @param dpName - Datapoint name
|
|
108
|
+
* @returns Unit string or undefined
|
|
109
|
+
*/
|
|
110
|
+
private getDatapointUnit;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=DashboardManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/dashboards/DashboardManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,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