@codesys/mcp-toolkit 1.1.4 → 1.1.6

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.
@@ -1,155 +1,155 @@
1
- # @codesys/mcp-toolkit
2
-
3
- ![npm](https://img.shields.io/npm/v/@codesys/mcp-toolkit)
4
- ![License](https://img.shields.io/github/license/yourusername/codesys-mcp-toolkit)
5
-
6
- A Model Context Protocol (MCP) server for CODESYS V3 programming environments. This toolkit enables seamless interaction between MCP clients (like Claude Desktop) and CODESYS, allowing automation of project management, POU creation, code editing, and compilation tasks.
7
-
8
- <p align="center">
9
- <img src="https://github.com/yourusername/codesys-mcp-toolkit/raw/main/docs/assets/diagram.png" alt="CODESYS MCP Toolkit Architecture" width="600">
10
- </p>
11
-
12
- ## 🌟 Features
13
-
14
- - **Project Management**
15
- - Open existing CODESYS projects
16
- - Create new projects from templates
17
- - Save project changes
18
-
19
- - **POU Management**
20
- - Create Programs, Function Blocks, and Functions
21
- - Set declaration and implementation code
22
- - Create properties and methods for Function Blocks
23
- - Compile projects
24
-
25
- - **MCP Resources**
26
- - `codesys://project/status`: Check scripting status and project state
27
- - `codesys://project/{+project_path}/structure`: Retrieve project structure
28
- - `codesys://project/{+project_path}/pou/{+pou_path}/code`: Read POU code
29
-
30
- - **MCP Tools**
31
- - `open_project`: Open specified CODESYS project
32
- - `create_project`: Create new CODESYS project
33
- - `save_project`: Save currently open project
34
- - `create_pou`: Create new Program, Function Block, or Function
35
- - `set_pou_code`: Update code for a specified POU
36
- - `create_property`: Create property in a Function Block
37
- - `create_method`: Create method in a Function Block
38
- - `compile_project`: Compile the open project
39
-
40
- ## 📋 Prerequisites
41
-
42
- - **CODESYS V3**: A working CODESYS V3 installation (tested with 3.5 SP21) with **Scripting Engine** component enabled
43
- - **Node.js**: Version 18 or later required
44
- - **MCP Client**: An MCP-enabled application (e.g., Claude Desktop)
45
-
46
- ## 🚀 Installation
47
-
48
- ### Option 1: Install from npm (Recommended)
49
-
50
- ```bash
51
- npm install -g @codesys/mcp-toolkit
52
- ```
53
-
54
- This installs the package globally, making the `codesys-mcp-toolkit` command available in your terminal.
55
-
56
- ### Option 2: Install from Source
57
-
58
- ```bash
59
- # Clone the repository
60
- git clone https://github.com/yourusername/codesys-mcp-toolkit.git
61
- cd codesys-mcp-toolkit
62
-
63
- # Install dependencies
64
- npm install
65
-
66
- # Build the project
67
- npm run build
68
-
69
- # Install globally
70
- npm install -g .
71
- ```
72
-
73
- ## 🔧 Configuration
74
-
75
- ### Claude Desktop Configuration
76
-
77
- 1. Locate your Claude Desktop configuration file:
78
- - Windows: `C:\Users\<YourUsername>\AppData\Roaming\Claude\claude_desktop_config.json`
79
-
80
- 2. Add the CODESYS MCP server entry:
81
-
82
- ```json
83
- {
84
- "mcpServers": {
85
- "codesys_local": {
86
- "command": "npx",
87
- "args": [
88
- "-y",
89
- "@codesys/mcp-toolkit",
90
- "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
91
- "--codesys-profile", "CODESYS V3.5 SP21"
92
- ]
93
- }
94
- }
95
- }
96
- ```
97
-
98
- 3. Customize the paths to match your CODESYS installation:
99
- - `--codesys-path`: Path to your CODESYS.exe
100
- - `--codesys-profile`: Your CODESYS profile name
101
-
102
- 4. Restart Claude Desktop to apply the changes
103
-
104
- ## 🛠️ Usage Examples
105
-
106
- ### Creating a Function Block with Properties
107
-
108
- ```
109
- Ask Claude: "Using the CODESYS Local server, please create a Motor Controller function block with Start and Stop methods, plus CurrentSpeed property."
110
- ```
111
-
112
- Claude will execute these MCP tool calls:
113
- 1. `create_pou` to create the MotorController Function Block
114
- 2. `create_property` to add the CurrentSpeed property
115
- 3. `create_method` to add Start and Stop methods
116
- 4. `set_pou_code` to implement each method and property
117
-
118
- ### Opening and Compiling a Project
119
-
120
- ```
121
- Ask Claude: "Can you open the project at C:/MyProjects/TestProject.project using CODESYS Local and compile it?"
122
- ```
123
-
124
- Claude will:
125
- 1. Use `open_project` to open the specified file
126
- 2. Use `compile_project` to build the application
127
-
128
- ## 🔍 Troubleshooting
129
-
130
- ### Common Issues
131
-
132
- - **Connection Failures**: Check Claude Desktop logs for error messages
133
- - **Path Issues**: Ensure CODESYS executable path is correct
134
- - **Profile Mismatch**: Verify profile name matches exactly
135
- - **Permission Problems**: Ensure Claude has appropriate permissions
136
- - **CODESYS Already Running**: Close other CODESYS instances
137
-
138
- ### Debug Logs
139
-
140
- Check logs at:
141
- - Windows: `C:\Users\<YourUsername>\AppData\Roaming\Claude\logs\`
142
-
143
- ## 🤝 Contributing
144
-
145
- Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
146
-
147
- ## 📝 License
148
-
149
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
150
-
151
- ## 🙏 Acknowledgements
152
-
153
- - The [CODESYS](https://www.codesys.com/) team for their scripting engine
154
- - [Model Context Protocol](https://github.com/m-ld/model-context-protocol) project
155
- - All contributors who have helped improve this toolkit
1
+ # @codesys/mcp-toolkit
2
+
3
+ ![npm](https://img.shields.io/npm/v/@codesys/mcp-toolkit)
4
+ ![License](https://img.shields.io/github/license/yourusername/codesys-mcp-toolkit)
5
+
6
+ A Model Context Protocol (MCP) server for CODESYS V3 programming environments. This toolkit enables seamless interaction between MCP clients (like Claude Desktop) and CODESYS, allowing automation of project management, POU creation, code editing, and compilation tasks.
7
+
8
+ <p align="center">
9
+ <img src="https://github.com/yourusername/codesys-mcp-toolkit/raw/main/docs/assets/diagram.png" alt="CODESYS MCP Toolkit Architecture" width="600">
10
+ </p>
11
+
12
+ ## 🌟 Features
13
+
14
+ - **Project Management**
15
+ - Open existing CODESYS projects
16
+ - Create new projects from templates
17
+ - Save project changes
18
+
19
+ - **POU Management**
20
+ - Create Programs, Function Blocks, and Functions
21
+ - Set declaration and implementation code
22
+ - Create properties and methods for Function Blocks
23
+ - Compile projects
24
+
25
+ - **MCP Resources**
26
+ - `codesys://project/status`: Check scripting status and project state
27
+ - `codesys://project/{+project_path}/structure`: Retrieve project structure
28
+ - `codesys://project/{+project_path}/pou/{+pou_path}/code`: Read POU code
29
+
30
+ - **MCP Tools**
31
+ - `open_project`: Open specified CODESYS project
32
+ - `create_project`: Create new CODESYS project
33
+ - `save_project`: Save currently open project
34
+ - `create_pou`: Create new Program, Function Block, or Function
35
+ - `set_pou_code`: Update code for a specified POU
36
+ - `create_property`: Create property in a Function Block
37
+ - `create_method`: Create method in a Function Block
38
+ - `compile_project`: Compile the open project
39
+
40
+ ## 📋 Prerequisites
41
+
42
+ - **CODESYS V3**: A working CODESYS V3 installation (tested with 3.5 SP21) with **Scripting Engine** component enabled
43
+ - **Node.js**: Version 18 or later required
44
+ - **MCP Client**: An MCP-enabled application (e.g., Claude Desktop)
45
+
46
+ ## 🚀 Installation
47
+
48
+ ### Option 1: Install from npm (Recommended)
49
+
50
+ ```bash
51
+ npm install -g @codesys/mcp-toolkit
52
+ ```
53
+
54
+ This installs the package globally, making the `codesys-mcp-toolkit` command available in your terminal.
55
+
56
+ ### Option 2: Install from Source
57
+
58
+ ```bash
59
+ # Clone the repository
60
+ git clone https://github.com/yourusername/codesys-mcp-toolkit.git
61
+ cd codesys-mcp-toolkit
62
+
63
+ # Install dependencies
64
+ npm install
65
+
66
+ # Build the project
67
+ npm run build
68
+
69
+ # Install globally
70
+ npm install -g .
71
+ ```
72
+
73
+ ## 🔧 Configuration
74
+
75
+ ### Claude Desktop Configuration
76
+
77
+ 1. Locate your Claude Desktop configuration file:
78
+ - Windows: `C:\Users\<YourUsername>\AppData\Roaming\Claude\claude_desktop_config.json`
79
+
80
+ 2. Add the CODESYS MCP server entry:
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "codesys_local": {
86
+ "command": "npx",
87
+ "args": [
88
+ "-y",
89
+ "@codesys/mcp-toolkit",
90
+ "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
91
+ "--codesys-profile", "CODESYS V3.5 SP21"
92
+ ]
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ 3. Customize the paths to match your CODESYS installation:
99
+ - `--codesys-path`: Path to your CODESYS.exe
100
+ - `--codesys-profile`: Your CODESYS profile name
101
+
102
+ 4. Restart Claude Desktop to apply the changes
103
+
104
+ ## 🛠️ Usage Examples
105
+
106
+ ### Creating a Function Block with Properties
107
+
108
+ ```
109
+ Ask Claude: "Using the CODESYS Local server, please create a Motor Controller function block with Start and Stop methods, plus CurrentSpeed property."
110
+ ```
111
+
112
+ Claude will execute these MCP tool calls:
113
+ 1. `create_pou` to create the MotorController Function Block
114
+ 2. `create_property` to add the CurrentSpeed property
115
+ 3. `create_method` to add Start and Stop methods
116
+ 4. `set_pou_code` to implement each method and property
117
+
118
+ ### Opening and Compiling a Project
119
+
120
+ ```
121
+ Ask Claude: "Can you open the project at C:/MyProjects/TestProject.project using CODESYS Local and compile it?"
122
+ ```
123
+
124
+ Claude will:
125
+ 1. Use `open_project` to open the specified file
126
+ 2. Use `compile_project` to build the application
127
+
128
+ ## 🔍 Troubleshooting
129
+
130
+ ### Common Issues
131
+
132
+ - **Connection Failures**: Check Claude Desktop logs for error messages
133
+ - **Path Issues**: Ensure CODESYS executable path is correct
134
+ - **Profile Mismatch**: Verify profile name matches exactly
135
+ - **Permission Problems**: Ensure Claude has appropriate permissions
136
+ - **CODESYS Already Running**: Close other CODESYS instances
137
+
138
+ ### Debug Logs
139
+
140
+ Check logs at:
141
+ - Windows: `C:\Users\<YourUsername>\AppData\Roaming\Claude\logs\`
142
+
143
+ ## 🤝 Contributing
144
+
145
+ Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
146
+
147
+ ## 📝 License
148
+
149
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
150
+
151
+ ## 🙏 Acknowledgements
152
+
153
+ - The [CODESYS](https://www.codesys.com/) team for their scripting engine
154
+ - [Model Context Protocol](https://github.com/m-ld/model-context-protocol) project
155
+ - All contributors who have helped improve this toolkit
package/docs/index.md CHANGED
@@ -1,26 +1,26 @@
1
- # CODESYS MCP Toolkit Documentation
2
-
3
- Welcome to the documentation for the CODESYS MCP Toolkit!
4
-
5
- ## Overview
6
-
7
- The CODESYS MCP Toolkit provides a bridge between Model Context Protocol (MCP) clients and CODESYS V3 programming environments. This toolkit enables seamless interaction for automating project management, POU creation, code editing, and compilation tasks.
8
-
9
- ## Components
10
-
11
- - **MCP Server**: Core component that handles MCP protocol communication
12
- - **CODESYS Script Integration**: Interface with CODESYS scripting engine
13
- - **Command-Line Interface**: For direct usage and configuration
14
-
15
- ## Getting Started
16
-
17
- - [Installation](installation.md)
18
- - [Configuration](configuration.md)
19
- - [Usage Examples](examples.md)
20
- - [API Reference](api.md)
21
-
22
- ## Advanced Topics
23
-
24
- - [Contributing Guidelines](../CONTRIBUTING.md)
25
- - [Troubleshooting](troubleshooting.md)
26
- - [Custom Extensions](extensions.md)
1
+ # CODESYS MCP Toolkit Documentation
2
+
3
+ Welcome to the documentation for the CODESYS MCP Toolkit!
4
+
5
+ ## Overview
6
+
7
+ The CODESYS MCP Toolkit provides a bridge between Model Context Protocol (MCP) clients and CODESYS V3 programming environments. This toolkit enables seamless interaction for automating project management, POU creation, code editing, and compilation tasks.
8
+
9
+ ## Components
10
+
11
+ - **MCP Server**: Core component that handles MCP protocol communication
12
+ - **CODESYS Script Integration**: Interface with CODESYS scripting engine
13
+ - **Command-Line Interface**: For direct usage and configuration
14
+
15
+ ## Getting Started
16
+
17
+ - [Installation](installation.md)
18
+ - [Configuration](configuration.md)
19
+ - [Usage Examples](examples.md)
20
+ - [API Reference](api.md)
21
+
22
+ ## Advanced Topics
23
+
24
+ - [Contributing Guidelines](../CONTRIBUTING.md)
25
+ - [Troubleshooting](troubleshooting.md)
26
+ - [Custom Extensions](extensions.md)
@@ -1,84 +1,84 @@
1
- # Installation Guide
2
-
3
- This guide covers how to install the CODESYS MCP Toolkit on your system.
4
-
5
- ## Prerequisites
6
-
7
- Before installing, ensure you have:
8
-
9
- 1. **Node.js**: Version 18 or later
10
- - Download from [nodejs.org](https://nodejs.org/)
11
- - Verify installation with `node --version`
12
-
13
- 2. **CODESYS V3**: A working CODESYS V3 installation
14
- - Tested with version 3.5 SP21
15
- - Must have the **Scripting Engine** component enabled
16
- - Verify by opening CODESYS and checking if scripting commands are available
17
-
18
- 3. **MCP Client**: An MCP-enabled application (e.g., Claude Desktop)
19
-
20
- ## Installation Methods
21
-
22
- ### Method 1: Install from npm (Recommended)
23
-
24
- The simplest way to install is directly from npm:
25
-
26
- ```bash
27
- npm install -g @codesys/mcp-toolkit
28
- ```
29
-
30
- This installs the package globally on your system, making the `codesys-mcp-toolkit` command available in your terminal.
31
-
32
- Verify the installation by running:
33
-
34
- ```bash
35
- codesys-mcp-toolkit --version
36
- ```
37
-
38
- ### Method 2: Install from Source
39
-
40
- For development or to get the latest unreleased changes:
41
-
42
- ```bash
43
- # Clone the repository
44
- git clone https://github.com/yourusername/codesys-mcp-toolkit.git
45
- cd codesys-mcp-toolkit
46
-
47
- # Install dependencies
48
- npm install
49
-
50
- # Build the project
51
- npm run build
52
-
53
- # Install globally
54
- npm install -g .
55
- ```
56
-
57
- Verify the installation using the same command as above.
58
-
59
- ## Next Steps
60
-
61
- After installation:
62
-
63
- 1. [Configure your MCP client](configuration.md) to use the CODESYS MCP Toolkit
64
- 2. Try some [basic examples](examples.md)
65
- 3. Learn about the [available tools and resources](api.md)
66
-
67
- ## Troubleshooting Installation Issues
68
-
69
- ### Common Issues
70
-
71
- - **Permission errors**: You may need to run npm with administrative privileges
72
- ```bash
73
- sudo npm install -g @codesys/mcp-toolkit # On Linux/macOS
74
- # or use PowerShell as Administrator on Windows
75
- ```
76
-
77
- - **Path issues**: Ensure the npm global bin directory is in your PATH
78
-
79
- - **Node.js version**: Verify you have Node.js 18 or later
80
- ```bash
81
- node --version
82
- ```
83
-
84
- If you encounter other issues, please check the [troubleshooting guide](troubleshooting.md) or [open an issue](https://github.com/yourusername/codesys-mcp-toolkit/issues) on GitHub.
1
+ # Installation Guide
2
+
3
+ This guide covers how to install the CODESYS MCP Toolkit on your system.
4
+
5
+ ## Prerequisites
6
+
7
+ Before installing, ensure you have:
8
+
9
+ 1. **Node.js**: Version 18 or later
10
+ - Download from [nodejs.org](https://nodejs.org/)
11
+ - Verify installation with `node --version`
12
+
13
+ 2. **CODESYS V3**: A working CODESYS V3 installation
14
+ - Tested with version 3.5 SP21
15
+ - Must have the **Scripting Engine** component enabled
16
+ - Verify by opening CODESYS and checking if scripting commands are available
17
+
18
+ 3. **MCP Client**: An MCP-enabled application (e.g., Claude Desktop)
19
+
20
+ ## Installation Methods
21
+
22
+ ### Method 1: Install from npm (Recommended)
23
+
24
+ The simplest way to install is directly from npm:
25
+
26
+ ```bash
27
+ npm install -g @codesys/mcp-toolkit
28
+ ```
29
+
30
+ This installs the package globally on your system, making the `codesys-mcp-toolkit` command available in your terminal.
31
+
32
+ Verify the installation by running:
33
+
34
+ ```bash
35
+ codesys-mcp-toolkit --version
36
+ ```
37
+
38
+ ### Method 2: Install from Source
39
+
40
+ For development or to get the latest unreleased changes:
41
+
42
+ ```bash
43
+ # Clone the repository
44
+ git clone https://github.com/yourusername/codesys-mcp-toolkit.git
45
+ cd codesys-mcp-toolkit
46
+
47
+ # Install dependencies
48
+ npm install
49
+
50
+ # Build the project
51
+ npm run build
52
+
53
+ # Install globally
54
+ npm install -g .
55
+ ```
56
+
57
+ Verify the installation using the same command as above.
58
+
59
+ ## Next Steps
60
+
61
+ After installation:
62
+
63
+ 1. [Configure your MCP client](configuration.md) to use the CODESYS MCP Toolkit
64
+ 2. Try some [basic examples](examples.md)
65
+ 3. Learn about the [available tools and resources](api.md)
66
+
67
+ ## Troubleshooting Installation Issues
68
+
69
+ ### Common Issues
70
+
71
+ - **Permission errors**: You may need to run npm with administrative privileges
72
+ ```bash
73
+ sudo npm install -g @codesys/mcp-toolkit # On Linux/macOS
74
+ # or use PowerShell as Administrator on Windows
75
+ ```
76
+
77
+ - **Path issues**: Ensure the npm global bin directory is in your PATH
78
+
79
+ - **Node.js version**: Verify you have Node.js 18 or later
80
+ ```bash
81
+ node --version
82
+ ```
83
+
84
+ If you encounter other issues, please check the [troubleshooting guide](troubleshooting.md) or [open an issue](https://github.com/yourusername/codesys-mcp-toolkit/issues) on GitHub.