@codesys/mcp-toolkit 1.0.6 → 1.0.8
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/direct-codesys-mcp.js +150 -0
- package/dist/bin.js +15 -6
- package/dist/codesys_interop.js +104 -64
- package/dist/server.js +899 -884
- package/package.json +45 -47
- package/test-direct.js +0 -40
package/package.json
CHANGED
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@codesys/mcp-toolkit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/server.js",
|
|
5
|
-
"bin":
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@codesys/mcp-toolkit",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"main": "dist/server.js",
|
|
5
|
+
"bin": "./dist/bin.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"prepare": "npm run build"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"codesys",
|
|
13
|
+
"mcp",
|
|
14
|
+
"modelcontextprotocol",
|
|
15
|
+
"plc",
|
|
16
|
+
"automation",
|
|
17
|
+
"programming"
|
|
18
|
+
],
|
|
19
|
+
"author": "Your Name <your.email@example.com>",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"type": "commonjs",
|
|
22
|
+
"description": "Model Context Protocol (MCP) server for CODESYS automation platform",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/johannesPettersson80/codesys-mcp-toolkit.git"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/johannesPettersson80/codesys-mcp-toolkit#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/johannesPettersson80/codesys-mcp-toolkit/issues"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=14.0.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
36
|
+
"axios": "^1.6.8",
|
|
37
|
+
"commander": "^11.1.0",
|
|
38
|
+
"zod": "^3.24.3"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/commander": "^2.12.5",
|
|
42
|
+
"@types/node": "^22.14.1",
|
|
43
|
+
"typescript": "^5.8.3"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/test-direct.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const { spawn } = require('child_process');
|
|
2
|
-
|
|
3
|
-
// Paths
|
|
4
|
-
const codesysPath = "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe";
|
|
5
|
-
const profileName = "CODESYS V3.5 SP21";
|
|
6
|
-
|
|
7
|
-
// Log what we're doing
|
|
8
|
-
console.log(`Testing direct spawn of CODESYS\n`);
|
|
9
|
-
|
|
10
|
-
// Create a test Python script
|
|
11
|
-
const fs = require('fs');
|
|
12
|
-
const os = require('os');
|
|
13
|
-
const path = require('path');
|
|
14
|
-
const tempFile = path.join(os.tmpdir(), 'direct_test.py');
|
|
15
|
-
fs.writeFileSync(tempFile, 'print("DIRECT TEST SUCCESS")\n');
|
|
16
|
-
|
|
17
|
-
console.log(`Script file: ${tempFile}`);
|
|
18
|
-
console.log(`CODESYS path: ${codesysPath}`);
|
|
19
|
-
|
|
20
|
-
// Method 1: Using spawn with shell:true and proper quotes
|
|
21
|
-
const command = `"${codesysPath}" --profile="${profileName}" --noUI --runscript="${tempFile}"`;
|
|
22
|
-
console.log(`\nExecuting command: ${command}`);
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
// Use exec instead of spawn for simpler testing
|
|
26
|
-
require('child_process').exec(command, (error, stdout, stderr) => {
|
|
27
|
-
console.log("\n--- RESULTS ---");
|
|
28
|
-
if (error) {
|
|
29
|
-
console.log(`Error: ${error.message}`);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (stderr) {
|
|
33
|
-
console.log(`stderr: ${stderr}`);
|
|
34
|
-
}
|
|
35
|
-
console.log(`stdout: ${stdout}`);
|
|
36
|
-
console.log("--- END RESULTS ---");
|
|
37
|
-
});
|
|
38
|
-
} catch (err) {
|
|
39
|
-
console.log(`Caught error: ${err.message}`);
|
|
40
|
-
}
|