@codesys/mcp-toolkit 1.1.13 → 1.1.16

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.
@@ -0,0 +1,24 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm install:*)",
5
+ "Bash(npm run build:*)",
6
+ "Bash(npm publish:*)",
7
+ "Bash(npm pack:*)",
8
+ "Bash(mkdir:*)",
9
+ "Bash(tar:*)",
10
+ "Bash(ls:*)",
11
+ "Bash(find:*)",
12
+ "Bash(grep:*)",
13
+ "Bash(git clone:*)",
14
+ "Bash(pushd:*)",
15
+ "Bash(popd:*)",
16
+ "Bash(git checkout:*)",
17
+ "Bash(git ls-tree:*)",
18
+ "Bash(git reset:*)",
19
+ "Bash(git push:*)",
20
+ "Bash(npm whoami:*)"
21
+ ],
22
+ "deny": []
23
+ }
24
+ }
package/CHANGELOG.md CHANGED
@@ -5,64 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.1.13] - 2025-05-06
8
+ ## [1.1.16] - 2025-05-06
9
9
 
10
10
  ### Fixed
11
- - Fixed remaining f-string formatting in create_pou.py script
12
- - Restored compatibility with older Python versions in path formatting
13
-
14
- ## [1.1.12] - 2025-05-06
15
-
16
- ### Fixed
17
- - Completely rewrote path handling to avoid excessive backslash escaping
18
- - Added multiple fallback methods for opening CODESYS projects
19
- - Removed use of non-existent get_version_info API
20
- - Made project structure tool more resilient to various CODESYS API patterns
21
-
22
- ## [1.1.11] - 2025-05-06
23
-
24
- ### Fixed
25
- - Fixed syntax errors in Python scripts by replacing f-strings with older-style formatting
26
- - Ensures compatibility with Python version used in CODESYS scripting environment
27
-
28
- ## [1.1.10] - 2025-05-06
29
-
30
- ### Fixed
31
- - Improved handling of Windows paths in `get_project_structure` and `ensure_project_open` functions
32
- - Enhanced error handling and debugging for project structure tool
33
- - Added more detailed logging to help diagnose connection issues with CODESYS
34
-
35
- ## [1.1.9] - 2025-05-06
36
-
37
- ### Added
38
- - Added three new MCP tools that were previously only available as resources:
39
- - `check_status`: Tool to check CODESYS environment and open project status
40
- - `get_project_structure`: Tool to retrieve the structure of a CODESYS project
41
- - `get_pou_code`: Tool to retrieve code from a specific POU
42
- - These tools allow Claude and other AI assistants to directly access project inspection functionality
43
-
44
- ## [1.1.8] - 2025-05-06
45
-
46
- ### Fixed
47
- - Enhanced create_pou script to automatically find the Application object when only "Application" is specified as the parent path
48
- - Added better error messages with suggestions when Application isn't found
49
-
50
- ## [1.1.7] - 2025-05-06
51
-
52
- ### Fixed
53
- - Fixed Python scripts not being included in the npm package
54
- - Enhanced script loading to search for scripts in multiple possible locations
55
- - Added build step to copy scripts to dist folder
56
-
57
- ## [1.1.6] - 2025-05-06
58
-
59
- ### Fixed
60
- - Added TypeScript as dev dependency to fix build process
61
-
62
- ## [1.1.4] - 2025-05-01
63
-
64
- ### Changed
65
- - Refactored the code for better maintainability
11
+ - Reverted to v1.1.3 code base which has working POU creation functionality
12
+ - Fixed path handling by using simpler approach from v1.1.3
13
+ - Restored original Application object finding logic that worked in v1.1.3
66
14
 
67
15
  ## [1.0.0] - 2025-04-23
68
16
 
@@ -0,0 +1,72 @@
1
+ # Contributing to @codesys/mcp-toolkit
2
+
3
+ Thank you for considering contributing to the CODESYS MCP Toolkit! This document provides guidelines and steps for contributing.
4
+
5
+ ## Code of Conduct
6
+
7
+ Please be respectful and considerate of others when contributing to this project. We aim to foster an inclusive and welcoming community.
8
+
9
+ ## How Can I Contribute?
10
+
11
+ ### Reporting Bugs
12
+
13
+ Bug reports help improve the project! When reporting bugs:
14
+
15
+ 1. Check if the bug has already been reported
16
+ 2. Use the bug report template
17
+ 3. Include detailed steps to reproduce the issue
18
+ 4. Describe the expected vs. actual behavior
19
+ 5. Include screenshots if applicable
20
+ 6. Provide environment details (OS, Node.js version, etc.)
21
+
22
+ ### Suggesting Features
23
+
24
+ We welcome feature suggestions! When suggesting features:
25
+
26
+ 1. Describe the problem your feature would solve
27
+ 2. Explain how your feature would work
28
+ 3. Consider potential alternatives
29
+ 4. Provide examples of similar features in other projects (if applicable)
30
+
31
+ ### Pull Requests
32
+
33
+ 1. Fork the repository
34
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
35
+ 3. Make your changes
36
+ 4. Run tests and ensure they pass
37
+ 5. Commit your changes (`git commit -m 'Add amazing feature'`)
38
+ 6. Push to your branch (`git push origin feature/amazing-feature`)
39
+ 7. Open a Pull Request
40
+
41
+ ## Development Setup
42
+
43
+ 1. Clone the repository
44
+ ```bash
45
+ git clone https://github.com/yourusername/codesys-mcp-toolkit.git
46
+ cd codesys-mcp-toolkit
47
+ ```
48
+
49
+ 2. Install dependencies
50
+ ```bash
51
+ npm install
52
+ ```
53
+
54
+ 3. Build the project
55
+ ```bash
56
+ npm run build
57
+ ```
58
+
59
+ ## Style Guidelines
60
+
61
+ - Follow existing code formatting patterns
62
+ - Use meaningful variable and function names
63
+ - Add comments where necessary to explain complex logic
64
+ - Update documentation when changing functionality
65
+
66
+ ## Testing
67
+
68
+ - Add tests for new features
69
+ - Ensure all tests pass before submitting a PR
70
+ - Consider edge cases in your tests
71
+
72
+ Thank you for contributing!
Binary file
Binary file
Binary file
Binary file
@@ -43,6 +43,8 @@ try:
43
43
  PARENT_PATH_REL, # Original "Application"
44
44
  "%s.%s" % (project_name, PARENT_PATH_REL), # "projectName.Application"
45
45
  "%s/%s" % (project_name, PARENT_PATH_REL), # "projectName/Application"
46
+ "PLCWinNT/Plc Logic/Application", # Common CODESYS structure
47
+ "PLCWinNT.Plc Logic.Application", # Using dots instead
46
48
  project_name # Just the project name itself might work
47
49
  ]
48
50
 
@@ -2,7 +2,12 @@ import traceback
2
2
  # --- Find object by path function ---
3
3
  def find_object_by_path_robust(start_node, full_path, target_type_name="object"):
4
4
  print("DEBUG: Finding %s by path: '%s'" % (target_type_name, full_path))
5
- normalized_path = full_path.replace('\\\\', '/').strip('/')
5
+ # Handle both dot and slash separators
6
+ # First replace backslashes with forward slashes
7
+ path_with_slashes = full_path.replace('\\', '/').strip('/')
8
+ # Then replace dots with slashes (CODESYS sometimes uses dots)
9
+ normalized_path = path_with_slashes.replace('.', '/')
10
+ # Split into parts
6
11
  path_parts = normalized_path.split('/')
7
12
  if not path_parts:
8
13
  print("ERROR: Path is empty.")