Labsco
johannesPettersson80 logo

Codesys-mcp-toolkit

โ˜… 100

from johannesPettersson80

A Model Context Protocol (MCP) server for CODESYS V3 programming environments.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

@codesys/mcp-toolkit

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 via the CODESYS Scripting Engine.

๐ŸŒŸ Features

  • Project Management

    • Open existing CODESYS projects (open_project)
    • Create new projects from standard templates (create_project)
    • Save project changes (save_project)
  • POU Management

    • Create Programs, Function Blocks, and Functions (create_pou)
    • Set declaration and implementation code (set_pou_code)
    • Create properties for Function Blocks (create_property)
    • Create methods for Function Blocks (create_method)
    • Compile projects (compile_project)
  • MCP Resources

    • codesys://project/status: Check scripting status and currently open project state.
    • codesys://project/{+project_path}/structure: Retrieve the object structure of a specified project.
    • codesys://project/{+project_path}/pou/{+pou_path}/code: Read the declaration and implementation code for a specified POU, Method, or Property accessor.

๐Ÿ› ๏ธ Command-Line Arguments

When running codesys-mcp-tool directly or configuring it, you can use these arguments:

  • -p, --codesys-path <path>: Full path to CODESYS.exe. (Required, overrides CODESYS_PATH env var, has a default but relying on it is not recommended).
  • -f, --codesys-profile <profile>: Name of the CODESYS profile. (Required, overrides CODESYS_PROFILE env var, has a default but relying on it is not recommended).
  • -w, --workspace <dir>: Workspace directory for resolving relative project paths passed to tools. Defaults to the directory where the command was launched (which might be unpredictable when run by another application). Setting this explicitly might be needed if using relative paths.
  • -h, --help: Show help message.
  • --version: Show package version.

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page. (Optionally add a CONTRIBUTING.md file with more details).

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgements

  • The CODESYS GmbH team for the powerful CODESYS platform and its scripting engine.
  • The Model Context Protocol project for defining the interaction standard.
  • All contributors and users who help improve this toolkit.