@liofly/iobroker-mcp 0.0.0-stage → 1.15.2

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Niklas Pfenninger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,72 @@
1
- # Temporary Holding Version
1
+ # @liofly/iobroker-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A [Model Context Protocol](https://modelcontextprotocol.io) server for ioBroker. It lets an AI
4
+ agent read and edit the scripts of the ioBroker javascript adapter and inspect states and logs —
5
+ without VS Code, without a local workspace and without the companion extension.
6
+
7
+ The server speaks MCP over stdio and is started by the MCP client:
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "iobroker": {
13
+ "command": "npx",
14
+ "args": ["-y", "@liofly/iobroker-mcp"],
15
+ "env": {
16
+ "IOBROKER_MCP_URL": "http://iobroker.local:8081",
17
+ "IOBROKER_MCP_USERNAME": "admin",
18
+ "IOBROKER_MCP_PASSWORD": "…"
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ Everything is configured through environment variables. There is no config file and no command
28
+ line flag that carries a value.
29
+
30
+ | Variable | Required | Default | Meaning |
31
+ |---|---|---|---|
32
+ | `IOBROKER_MCP_URL` | yes | – | `http://host:8081` or `https://host:8081`, including the admin port |
33
+ | `IOBROKER_MCP_USERNAME` | when login is enabled | – | ioBroker user |
34
+ | `IOBROKER_MCP_PASSWORD` | when login is enabled | – | ioBroker password |
35
+ | `IOBROKER_MCP_ALLOW_SELF_SIGNED` | no | `false` | accept self signed certificates for `https://` |
36
+ | `IOBROKER_MCP_READ_ONLY` | no | `false` | expose the read tools only |
37
+ | `IOBROKER_MCP_SCRIPT_AUTO_RUN` | no | `false` | enable a script right after it was created |
38
+ | `IOBROKER_MCP_LOG_LEVEL` | no | `info` | stderr diagnostics: `error`, `warn`, `info`, `debug`, `silly` |
39
+
40
+ `npx @liofly/iobroker-mcp --check` validates the environment and prints a redacted summary to stderr
41
+ without connecting. `--version` and `--help` do not touch the network either.
42
+
43
+ ## Tools
44
+
45
+ Read: `iobroker_get_scripts`, `iobroker_get_script_content`, `iobroker_get_js_instances`,
46
+ `iobroker_get_state`, `iobroker_get_logs`.
47
+
48
+ Write: `iobroker_start_script`, `iobroker_stop_script`, `iobroker_create_script`,
49
+ `iobroker_create_directory`, `iobroker_rename_script`, `iobroker_move_script`,
50
+ `iobroker_delete_script`, `iobroker_delete_directory`, `iobroker_update_script_source`.
51
+
52
+ The four synchronisation tools of the VS Code extension (`upload_*`, `download_script`,
53
+ `get_changed_scripts`) do not exist, because there is no local file to upload, download or compare.
54
+ `iobroker_update_script_source` replaces the upload flow: read the script with
55
+ `iobroker_get_script_content`, then send the complete new source.
56
+
57
+ ## Notes
58
+
59
+ - Diagnostics go to stderr; stdout carries the protocol. The password and session token are
60
+ redacted from every log line and error message.
61
+ - A tool call is bounded to 30 seconds, at most 8 calls run at the same time. The server connects
62
+ lazily on the first call and stays alive until the client closes stdin.
63
+ - Three failed logins stop the server in a state that needs a restart with a corrected password,
64
+ so a wrong password cannot lock the ioBroker user.
65
+ - Works with ioBroker Admin 5, 6 and 7; Admin 4 only degraded, like the extension.
66
+
67
+ The full documentation, including the design of the timeouts and the tool reference, is in the
68
+ [repository](https://github.com/nokxs/iobroker-javascript-vs-code-extension#readme).
69
+
70
+ ## License
71
+
72
+ MIT