Yesterday's 0.6.1 fix refused on every miss from _resolve_in_repo,
including the case where the IDE-level library_manager global is not
injected into the script context (which is the actual situation when
running through the MCP's script execution channel rather than the
interactive script REPL). Result: false-negative refuses for libraries
that ARE installed, just not visible from this script context.
This commit factors out _resolve_in_repo_accessible() and uses it to
distinguish three outcomes:
(a) Found in repo -> proceed; managed reference
(b) Repo accessible, name NOT hit -> HARD REFUSE (the bricking case)
Opt-in via ALLOW_UNRESOLVED=1.
(c) Repo NOT accessible at all -> proceed; rely on the post-add
_is_resolved() guard at line ~309
to catch hollow placeholders.
The (c) path is the safe relaxation: we cannot prove the library is
missing, so we defer to the post-add check rather than refuse blindly.
Adds for installed libraries succeed normally, broken adds still get
caught and removed before save.
Verified live: add_library 'OPC UA PubSub SL' against MCPTest2.project
(library was installed via Tools > Library Repository) now succeeds
cleanly with reference 'OPC UA PubSub SL [managed] ns=OPC_UA_PubSub_SL'.
54 lines
1.6 KiB
JSON
54 lines
1.6 KiB
JSON
{
|
|
"name": "codesys-mcp-sp21-plus",
|
|
"version": "0.6.2",
|
|
"description": "Codesys-MCP-SP21+ -- fork of luke-harriman/Codesys-MCP carrying CODESYS V3.5 SP22 Patch 1 fixes (and forward-compat with later SPs): script-engine API drift, online/runtime tool auto-login, dual-SHA release classifier, set_pou_code omitted-decl wipe fix, add_library managed-overload, etc. MCP server for CODESYS with persistent UI instance and file-based IPC.",
|
|
"main": "dist/server.js",
|
|
"bin": {
|
|
"codesys-mcp-sp21-plus": "dist/bin.js"
|
|
},
|
|
"files": [
|
|
"dist/",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc && node -e \"require('fs').cpSync('src/scripts','dist/scripts',{recursive:true})\"",
|
|
"test": "vitest --run",
|
|
"test:watch": "vitest",
|
|
"typecheck": "tsc --noEmit",
|
|
"prepublishOnly": "npm run build && npm test"
|
|
},
|
|
"keywords": [
|
|
"codesys",
|
|
"mcp",
|
|
"plc",
|
|
"automation",
|
|
"persistent",
|
|
"ui"
|
|
],
|
|
"author": "luke-harriman (upstream); phobicdotno (SP21+ fork)",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/phobicdotno/Codesys-MCP-SP21-plus.git"
|
|
},
|
|
"homepage": "https://github.com/phobicdotno/Codesys-MCP-SP21-plus#readme",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"node": ">=18"
|
|
},
|
|
"dependencies": {
|
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
"commander": "^11.1.0",
|
|
"ssh2": "^1.17.0",
|
|
"uuid": "^9.0.0",
|
|
"zod": "^3.24.3"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.14.1",
|
|
"@types/ssh2": "^1.15.5",
|
|
"@types/uuid": "^9.0.0",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "^5.5.3",
|
|
"vitest": "^1.6.0"
|
|
}
|
|
}
|