@etm-professional-control/winccoa-mcp-server 1.0.0 → 1.0.2
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/README.md +6 -3
- package/package.json +3 -2
- package/postinstall.cjs +63 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ cd <OA_ProjPath>/javascript
|
|
|
20
20
|
mkdir mcpServer && cd mcpServer
|
|
21
21
|
|
|
22
22
|
# Install packages
|
|
23
|
-
npm install @etm/winccoa-mcp-server
|
|
23
|
+
npm install @etm-professional-control/winccoa-mcp-server
|
|
24
24
|
npm install file:C:/Siemens/Automation/WinCC_OA/3.20/javascript/winccoa-manager
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -34,7 +34,8 @@ notepad .env # Windows
|
|
|
34
34
|
|
|
35
35
|
**Minimal .env setup:**
|
|
36
36
|
```env
|
|
37
|
-
#
|
|
37
|
+
# IMPORTANT: This token MUST match the token in Claude Desktop config!
|
|
38
|
+
# Optional: Generate a secure token with: openssl rand -hex 32
|
|
38
39
|
MCP_API_TOKEN=your-secure-token-here
|
|
39
40
|
|
|
40
41
|
# Choose industry context
|
|
@@ -65,6 +66,8 @@ Edit `%APPDATA%/Claude/claude_desktop_config.json`:
|
|
|
65
66
|
}
|
|
66
67
|
```
|
|
67
68
|
|
|
69
|
+
**⚠️ IMPORTANT:** Replace `YOUR_TOKEN_HERE` with the exact same token from your `.env` file's `MCP_API_TOKEN`. The tokens must match exactly!
|
|
70
|
+
|
|
68
71
|
## Documentation
|
|
69
72
|
|
|
70
73
|
- **[📦 Installation Guide](docs/INSTALLATION.md)** - Complete setup instructions
|
|
@@ -89,4 +92,4 @@ Edit `%APPDATA%/Claude/claude_desktop_config.json`:
|
|
|
89
92
|
|
|
90
93
|
## License
|
|
91
94
|
|
|
92
|
-
ISC - See LICENSE.md for details.
|
|
95
|
+
ISC - See LICENSE.md for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etm-professional-control/winccoa-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MCP Server for WinCC OA with field-specific configurations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"src/fields",
|
|
63
63
|
"config",
|
|
64
64
|
"README.md",
|
|
65
|
-
".env.example"
|
|
65
|
+
".env.example",
|
|
66
|
+
"postinstall.cjs"
|
|
66
67
|
]
|
|
67
68
|
}
|
package/postinstall.cjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Get package info dynamically
|
|
7
|
+
const packageJson = require('./package.json');
|
|
8
|
+
const packageName = packageJson.name;
|
|
9
|
+
|
|
10
|
+
// Determine the installation directory (where npm install was run)
|
|
11
|
+
const installDir = process.env.INIT_CWD || process.cwd();
|
|
12
|
+
const nodeModulesPath = path.join(installDir, 'node_modules', packageName);
|
|
13
|
+
|
|
14
|
+
console.log(`Installing WinCC OA MCP Server files to: ${installDir}`);
|
|
15
|
+
console.log(`Package location: ${nodeModulesPath}`);
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// Copy build files to installation directory
|
|
19
|
+
const buildDir = path.join(nodeModulesPath, 'build');
|
|
20
|
+
|
|
21
|
+
if (fs.existsSync(buildDir)) {
|
|
22
|
+
// Copy all files from build directory
|
|
23
|
+
const files = fs.readdirSync(buildDir, { withFileTypes: true });
|
|
24
|
+
|
|
25
|
+
for (const file of files) {
|
|
26
|
+
const srcPath = path.join(buildDir, file.name);
|
|
27
|
+
const destPath = path.join(installDir, file.name);
|
|
28
|
+
|
|
29
|
+
if (file.isDirectory()) {
|
|
30
|
+
// Copy directory recursively
|
|
31
|
+
fs.cpSync(srcPath, destPath, { recursive: true });
|
|
32
|
+
console.log(`Copied directory: ${file.name}`);
|
|
33
|
+
} else {
|
|
34
|
+
// Copy file
|
|
35
|
+
fs.copyFileSync(srcPath, destPath);
|
|
36
|
+
console.log(`Copied file: ${file.name}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Copy .env.example
|
|
41
|
+
const envExampleSrc = path.join(nodeModulesPath, '.env.example');
|
|
42
|
+
const envExampleDest = path.join(installDir, '.env.example');
|
|
43
|
+
|
|
44
|
+
if (fs.existsSync(envExampleSrc)) {
|
|
45
|
+
fs.copyFileSync(envExampleSrc, envExampleDest);
|
|
46
|
+
console.log('Copied .env.example');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log('\n✅ Installation complete!');
|
|
50
|
+
console.log('\nNext steps:');
|
|
51
|
+
console.log('1. Copy the environment file: cp .env.example .env');
|
|
52
|
+
console.log('2. Edit .env with your configuration');
|
|
53
|
+
console.log('3. Add JavaScript Manager in WinCC OA with script path: index_http.js');
|
|
54
|
+
|
|
55
|
+
} else {
|
|
56
|
+
console.error('Build directory not found in package');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error('Error during postinstall:', error.message);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|