85 lines
1.9 KiB
Markdown
85 lines
1.9 KiB
Markdown
# CODESYS MCP Companion Extension
|
|
|
|
VS Code/Cursor companion extension for the CODESYS MCP bridge.
|
|
|
|
This extension provides command workflows, project/actions/jobs views, status bar state, and diagnostics for the existing Python MCP bridge located at:
|
|
|
|
- `python_scripting/mcp_codesys_bridge/server.py`
|
|
|
|
## Features
|
|
|
|
- MCP bridge lifecycle and health check
|
|
- Project-level commands:
|
|
- create project
|
|
- stage existing project
|
|
- read project inventory
|
|
- read device I/O
|
|
- write POU
|
|
- write I/O mapping
|
|
- manage device
|
|
- sync project
|
|
- build project
|
|
- download to device
|
|
- Job polling UX through Jobs view
|
|
- Error diagnostics surfaced in Problems panel
|
|
- ST language support:
|
|
- syntax grammar
|
|
- snippets
|
|
- context menu action for current ST file sync
|
|
|
|
## Settings
|
|
|
|
All settings are under the `codesys.*` namespace:
|
|
|
|
- `codesys.pythonPath`
|
|
- `codesys.bridgeScriptPath`
|
|
- `codesys.agentUrl`
|
|
- `codesys.agentToken`
|
|
- `codesys.requestTimeoutSec`
|
|
- `codesys.pollIntervalMs`
|
|
- `codesys.defaultProjectPath`
|
|
- `codesys.defaultDryRunMutations`
|
|
- `codesys.allowDownloadCommand`
|
|
|
|
## Local Development
|
|
|
|
Prerequisites:
|
|
|
|
- Node.js 20+
|
|
- npm 10+
|
|
- Python 3 available for bridge startup
|
|
|
|
Install and build:
|
|
|
|
```bash
|
|
cd vscode_codesys_companion
|
|
npm install
|
|
npm run check
|
|
```
|
|
|
|
Run extension in Extension Development Host:
|
|
|
|
1. Open `vscode_codesys_companion` in VS Code/Cursor.
|
|
2. Press `F5`.
|
|
3. Use command palette commands with prefix `CODESYS:`.
|
|
|
|
## Packaging
|
|
|
|
Build VSIX package:
|
|
|
|
```bash
|
|
cd vscode_codesys_companion
|
|
npm install
|
|
npm run compile
|
|
npm run package
|
|
```
|
|
|
|
## Operational Notes
|
|
|
|
- Keep mutating operations in dry-run mode first.
|
|
- `download_to_device` command is gated by `codesys.allowDownloadCommand`.
|
|
- Bridge auth requires `codesys.agentToken` to match VM agent token.
|
|
- Align operations with:
|
|
- `python_scripting/how-to-use-codesys-mcp.md`
|
|
- `python_scripting/codesys-mcp-bridge-operations.md`
|