codesysultra 1.0.3 → 1.0.4

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/dist/bin.js CHANGED
@@ -66,20 +66,15 @@ commander_1.program
66
66
  .version(version)
67
67
  .option('-p, --codesys-path <path>', 'Path to CODESYS executable (can contain spaces, use quotes if needed)', process.env.CODESYS_PATH || 'C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe')
68
68
  .option('-f, --codesys-profile <profile>', 'CODESYS profile name (overrides CODESYS_PROFILE env var)', process.env.CODESYS_PROFILE || 'CODESYS V3.5 SP21')
69
- .option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd());
70
- // 添加配置生成命令
71
- commander_1.program.command('config')
72
- .description('Generate configuration from CODESYS version info file')
73
- .option('-c, --codesys-path <path>', 'Path to CODESYS executable')
74
- .option('-v, --version-info <path>', 'Path to CODESYS version info file')
75
- .option('-o, --output <path>', 'Output configuration file path (optional, prints to console if not specified)')
76
- .action((options) => {
77
- generateConfig(options);
78
- });
69
+ .option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd())
70
+ .option('-g, --generate-config', 'Generate configuration file from CODESYS version info (use with -c and -v)')
71
+ .option('-v, --version-info <path>', 'Path to CODESYS version info file (for config generation)')
72
+ .option('-o, --output <path>', 'Output configuration file path (for config generation)');
79
73
  commander_1.program.parse(process.argv); // Parse the arguments
80
74
  const options = commander_1.program.opts();
81
- // 如果执行的是config命令,不继续执行服务器启动
82
- if (process.argv[2] === 'config') {
75
+ // 如果是生成配置模式
76
+ if (options.generateConfig) {
77
+ generateConfig(options);
83
78
  process.exit(0);
84
79
  }
85
80
  // --- Log options Commander parsed ---
@@ -121,7 +116,7 @@ function generateConfig(options) {
121
116
  process.exit(1);
122
117
  }
123
118
  if (!options.codesysPath) {
124
- console.error('Error: CODESYS path is required. Use -c or --codesys-path option.');
119
+ console.error('Error: CODESYS path is required. Use -p or --codesys-path option.');
125
120
  process.exit(1);
126
121
  }
127
122
  const versionInfoPath = path.resolve(options.versionInfo);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codesysultra",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Model Context Protocol (MCP) server for CODESYS automation platform",
5
5
  "main": "dist/server.js",
6
6
  "bin": {
@@ -0,0 +1,13 @@
1
+ {
2
+ "mcpServers": {
3
+ "codesys_local": {
4
+ "command": "codesysultra",
5
+ "args": [
6
+ "--codesys-path",
7
+ "E:\\Soft\\Codesys\\CODESYS\\Common\\CODESYS.exe",
8
+ "--codesys-profile",
9
+ "CODESYS V3.5 SP21 Patch 4"
10
+ ]
11
+ }
12
+ }
13
+ }