@codesys/mcp-toolkit 1.0.3 → 1.0.5

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,119 +1,119 @@
1
- # Configuration Guide
2
-
3
- This guide explains how to configure the CODESYS MCP Toolkit with MCP clients.
4
-
5
- ## Claude Desktop Configuration
6
-
7
- Claude Desktop is a popular MCP client that can use the CODESYS MCP Toolkit.
8
-
9
- ### Finding the Configuration File
10
-
11
- The configuration file is located at:
12
- - Windows: `C:\Users\<YourUsername>\AppData\Roaming\Claude\claude_desktop_config.json`
13
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
14
-
15
- ### Adding the CODESYS MCP Server Entry
16
-
17
- Edit the configuration file and add the CODESYS MCP server to the `mcpServers` object:
18
-
19
- ```json
20
- {
21
- "mcpServers": {
22
- "codesys_local": {
23
- "command": "npx",
24
- "args": [
25
- "-y",
26
- "@codesys/mcp-toolkit",
27
- "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
28
- "--codesys-profile", "CODESYS V3.5 SP21"
29
- ]
30
- }
31
- }
32
- }
33
- ```
34
-
35
- ### Configuration Parameters
36
-
37
- - `command`: Use `npx` to execute the package
38
- - `args`: Array of arguments
39
- - `-y`: Automatically accept npm install prompts
40
- - `@codesys/mcp-toolkit`: The package name
41
- - `--codesys-path`: Path to your CODESYS.exe
42
- - `--codesys-profile`: Your CODESYS profile name
43
-
44
- ### Customizing for Your Environment
45
-
46
- You must customize:
47
- 1. `--codesys-path`: Set to the actual path of your CODESYS executable
48
- 2. `--codesys-profile`: Set to the exact name of your CODESYS profile
49
-
50
- **Important Notes:**
51
- - Use double backslashes (`\\`) in Windows paths in JSON
52
- - The profile name must match exactly what appears in CODESYS
53
-
54
- ### Applying Changes
55
-
56
- After modifying the configuration:
57
- 1. Save the file
58
- 2. Restart Claude Desktop completely
59
- 3. Claude should now have access to the CODESYS MCP server
60
-
61
- ## Command-Line Options
62
-
63
- When using the toolkit directly, the following options are available:
64
-
65
- ```
66
- Usage: codesys-mcp-toolkit [options]
67
-
68
- Options:
69
- -V, --version output the version number
70
- -e, --codesys-path <path> Path to CODESYS executable
71
- -p, --codesys-profile <profile> CODESYS profile name
72
- -h, --help display help for command
73
- ```
74
-
75
- ## Verifying Configuration
76
-
77
- To verify your configuration:
78
-
79
- 1. In Claude Desktop, ask:
80
- ```
81
- Can you please check the status of the CODESYS Local server?
82
- ```
83
-
84
- 2. Claude should use the `project-status` resource and return information about the CODESYS server connection.
85
-
86
- ## Multiple CODESYS Installations
87
-
88
- If you have multiple CODESYS installations, you can create multiple server entries with different names:
89
-
90
- ```json
91
- {
92
- "mcpServers": {
93
- "codesys_3_5_21": {
94
- "command": "npx",
95
- "args": [
96
- "-y",
97
- "@codesys/mcp-toolkit",
98
- "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
99
- "--codesys-profile", "CODESYS V3.5 SP21"
100
- ]
101
- },
102
- "codesys_3_5_19": {
103
- "command": "npx",
104
- "args": [
105
- "-y",
106
- "@codesys/mcp-toolkit",
107
- "--codesys-path", "C:\\Program Files\\CODESYS 3.5.19.0\\CODESYS\\Common\\CODESYS.exe",
108
- "--codesys-profile", "CODESYS V3.5 SP19"
109
- ]
110
- }
111
- }
112
- }
113
- ```
114
-
115
- ## Next Steps
116
-
117
- - Try some [basic examples](examples.md)
118
- - Learn about the [available tools and resources](api.md)
119
- - Check the [troubleshooting guide](troubleshooting.md) if you encounter issues
1
+ # Configuration Guide
2
+
3
+ This guide explains how to configure the CODESYS MCP Toolkit with MCP clients.
4
+
5
+ ## Claude Desktop Configuration
6
+
7
+ Claude Desktop is a popular MCP client that can use the CODESYS MCP Toolkit.
8
+
9
+ ### Finding the Configuration File
10
+
11
+ The configuration file is located at:
12
+ - Windows: `C:\Users\<YourUsername>\AppData\Roaming\Claude\claude_desktop_config.json`
13
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
14
+
15
+ ### Adding the CODESYS MCP Server Entry
16
+
17
+ Edit the configuration file and add the CODESYS MCP server to the `mcpServers` object:
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "codesys_local": {
23
+ "command": "npx",
24
+ "args": [
25
+ "-y",
26
+ "@codesys/mcp-toolkit",
27
+ "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
28
+ "--codesys-profile", "CODESYS V3.5 SP21"
29
+ ]
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ### Configuration Parameters
36
+
37
+ - `command`: Use `npx` to execute the package
38
+ - `args`: Array of arguments
39
+ - `-y`: Automatically accept npm install prompts
40
+ - `@codesys/mcp-toolkit`: The package name
41
+ - `--codesys-path`: Path to your CODESYS.exe
42
+ - `--codesys-profile`: Your CODESYS profile name
43
+
44
+ ### Customizing for Your Environment
45
+
46
+ You must customize:
47
+ 1. `--codesys-path`: Set to the actual path of your CODESYS executable
48
+ 2. `--codesys-profile`: Set to the exact name of your CODESYS profile
49
+
50
+ **Important Notes:**
51
+ - Use double backslashes (`\\`) in Windows paths in JSON
52
+ - The profile name must match exactly what appears in CODESYS
53
+
54
+ ### Applying Changes
55
+
56
+ After modifying the configuration:
57
+ 1. Save the file
58
+ 2. Restart Claude Desktop completely
59
+ 3. Claude should now have access to the CODESYS MCP server
60
+
61
+ ## Command-Line Options
62
+
63
+ When using the toolkit directly, the following options are available:
64
+
65
+ ```
66
+ Usage: codesys-mcp-toolkit [options]
67
+
68
+ Options:
69
+ -V, --version output the version number
70
+ -e, --codesys-path <path> Path to CODESYS executable
71
+ -p, --codesys-profile <profile> CODESYS profile name
72
+ -h, --help display help for command
73
+ ```
74
+
75
+ ## Verifying Configuration
76
+
77
+ To verify your configuration:
78
+
79
+ 1. In Claude Desktop, ask:
80
+ ```
81
+ Can you please check the status of the CODESYS Local server?
82
+ ```
83
+
84
+ 2. Claude should use the `project-status` resource and return information about the CODESYS server connection.
85
+
86
+ ## Multiple CODESYS Installations
87
+
88
+ If you have multiple CODESYS installations, you can create multiple server entries with different names:
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "codesys_3_5_21": {
94
+ "command": "npx",
95
+ "args": [
96
+ "-y",
97
+ "@codesys/mcp-toolkit",
98
+ "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
99
+ "--codesys-profile", "CODESYS V3.5 SP21"
100
+ ]
101
+ },
102
+ "codesys_3_5_19": {
103
+ "command": "npx",
104
+ "args": [
105
+ "-y",
106
+ "@codesys/mcp-toolkit",
107
+ "--codesys-path", "C:\\Program Files\\CODESYS 3.5.19.0\\CODESYS\\Common\\CODESYS.exe",
108
+ "--codesys-profile", "CODESYS V3.5 SP19"
109
+ ]
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ ## Next Steps
116
+
117
+ - Try some [basic examples](examples.md)
118
+ - Learn about the [available tools and resources](api.md)
119
+ - Check the [troubleshooting guide](troubleshooting.md) if you encounter issues
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.
@@ -1,78 +1,78 @@
1
- # CODESYS MCP Toolkit Examples
2
-
3
- This directory contains examples of how to use the CODESYS MCP toolkit effectively.
4
-
5
- ## Example Configuration Files
6
-
7
- ### Basic MCP Configuration
8
-
9
- `claude_desktop_config.json` - Example configuration for Claude Desktop:
10
-
11
- ```json
12
- {
13
- "mcpServers": {
14
- "codesys_local": {
15
- "command": "npx",
16
- "args": [
17
- "-y",
18
- "@codesys/mcp-toolkit",
19
- "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
20
- "--codesys-profile", "CODESYS V3.5 SP21"
21
- ]
22
- }
23
- }
24
- }
25
- ```
26
-
27
- ## Example Prompts
28
-
29
- Here are some example prompts you can use with Claude Desktop:
30
-
31
- ### Create a Motor Controller Function Block
32
-
33
- ```
34
- Using the CODESYS Local server, please create a MotorController function block with the following:
35
-
36
- 1. Properties:
37
- - SpeedSetpoint (INT)
38
- - ActualSpeed (INT)
39
- - IsRunning (BOOL)
40
-
41
- 2. Methods:
42
- - Start() - Sets IsRunning to TRUE
43
- - Stop() - Sets IsRunning to FALSE
44
- - SetSpeed(speed: INT) - Sets SpeedSetpoint to the given value
45
-
46
- Create this in a new project at C:/MyProjects/MotorControl.project
47
- ```
48
-
49
- ### Open and Analyze an Existing Project
50
-
51
- ```
52
- Using the CODESYS Local server, please open the project at C:/MyProjects/ExistingProject.project and show me its structure. Then, show me the code for the main POU.
53
- ```
54
-
55
- ### Compile a Project
56
-
57
- ```
58
- Using the CODESYS Local server, please open the project at C:/MyProjects/MyProject.project and compile it. Let me know if there are any errors.
59
- ```
60
-
61
- ## Programmatic Usage Examples
62
-
63
- If you're integrating directly with the server code, here are some examples:
64
-
65
- ### CLI Usage
66
-
67
- Run the server directly:
68
-
69
- ```bash
70
- codesys-mcp-toolkit --codesys-path "C:\Program Files\CODESYS 3.5.21.0\CODESYS\Common\CODESYS.exe" --codesys-profile "CODESYS V3.5 SP21"
71
- ```
72
-
73
- ## Use Cases
74
-
75
- * Automated PLC project creation
76
- * Standardized Function Block library management
77
- * Continuous integration for CODESYS projects
78
- * Documentation generation from CODESYS projects
1
+ # CODESYS MCP Toolkit Examples
2
+
3
+ This directory contains examples of how to use the CODESYS MCP toolkit effectively.
4
+
5
+ ## Example Configuration Files
6
+
7
+ ### Basic MCP Configuration
8
+
9
+ `claude_desktop_config.json` - Example configuration for Claude Desktop:
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "codesys_local": {
15
+ "command": "npx",
16
+ "args": [
17
+ "-y",
18
+ "@codesys/mcp-toolkit",
19
+ "--codesys-path", "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe",
20
+ "--codesys-profile", "CODESYS V3.5 SP21"
21
+ ]
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Example Prompts
28
+
29
+ Here are some example prompts you can use with Claude Desktop:
30
+
31
+ ### Create a Motor Controller Function Block
32
+
33
+ ```
34
+ Using the CODESYS Local server, please create a MotorController function block with the following:
35
+
36
+ 1. Properties:
37
+ - SpeedSetpoint (INT)
38
+ - ActualSpeed (INT)
39
+ - IsRunning (BOOL)
40
+
41
+ 2. Methods:
42
+ - Start() - Sets IsRunning to TRUE
43
+ - Stop() - Sets IsRunning to FALSE
44
+ - SetSpeed(speed: INT) - Sets SpeedSetpoint to the given value
45
+
46
+ Create this in a new project at C:/MyProjects/MotorControl.project
47
+ ```
48
+
49
+ ### Open and Analyze an Existing Project
50
+
51
+ ```
52
+ Using the CODESYS Local server, please open the project at C:/MyProjects/ExistingProject.project and show me its structure. Then, show me the code for the main POU.
53
+ ```
54
+
55
+ ### Compile a Project
56
+
57
+ ```
58
+ Using the CODESYS Local server, please open the project at C:/MyProjects/MyProject.project and compile it. Let me know if there are any errors.
59
+ ```
60
+
61
+ ## Programmatic Usage Examples
62
+
63
+ If you're integrating directly with the server code, here are some examples:
64
+
65
+ ### CLI Usage
66
+
67
+ Run the server directly:
68
+
69
+ ```bash
70
+ codesys-mcp-toolkit --codesys-path "C:\Program Files\CODESYS 3.5.21.0\CODESYS\Common\CODESYS.exe" --codesys-profile "CODESYS V3.5 SP21"
71
+ ```
72
+
73
+ ## Use Cases
74
+
75
+ * Automated PLC project creation
76
+ * Standardized Function Block library management
77
+ * Continuous integration for CODESYS projects
78
+ * Documentation generation from CODESYS projects