mcp-for-i 0.1.12 → 0.2.0

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.
Files changed (68) hide show
  1. package/README.md +224 -190
  2. package/dist/config/store.js +229 -109
  3. package/dist/controlplane/auth.js +128 -0
  4. package/dist/controlplane/clientIntegrationService.js +83 -4
  5. package/dist/controlplane/commands.js +14 -9
  6. package/dist/controlplane/connectionService.js +110 -5
  7. package/dist/controlplane/connectionTest.js +329 -0
  8. package/dist/controlplane/errors.js +12 -0
  9. package/dist/controlplane/runtimeService.js +98 -26
  10. package/dist/controlplane/server.js +124 -12
  11. package/dist/controlplane/serverShared.js +25 -6
  12. package/dist/controlplane/serviceManager.js +113 -100
  13. package/dist/controlplane/ui.js +1742 -892
  14. package/dist/ibmi/CompileTools.js +29 -1
  15. package/dist/ibmi/IBMiContent.js +435 -63
  16. package/dist/ibmi/IbmDocs.js +685 -0
  17. package/dist/ibmi/LocalLanguageActions.js +129 -3
  18. package/dist/ibmi/Search.js +158 -52
  19. package/dist/ibmi/Tools.js +7 -10
  20. package/dist/ibmi/client.js +220 -31
  21. package/dist/ibmi/evfevent.js +256 -0
  22. package/dist/ibmi/knownHosts.js +190 -0
  23. package/dist/ibmi/libraryList.js +93 -0
  24. package/dist/ibmi/sourceInspect.js +815 -0
  25. package/dist/ibmi/sqlJob.js +888 -0
  26. package/dist/ibmi/sqlParse.js +317 -0
  27. package/dist/ibmi/tn5250/certTrust.js +59 -0
  28. package/dist/ibmi/tn5250/client.js +310 -0
  29. package/dist/ibmi/tn5250/datastream.js +109 -0
  30. package/dist/ibmi/tn5250/ebcdic.js +74 -0
  31. package/dist/ibmi/tn5250/index.js +6 -0
  32. package/dist/ibmi/tn5250/screen.js +827 -0
  33. package/dist/ibmi/tn5250/telnet.js +186 -0
  34. package/dist/ibmi/variables.js +18 -7
  35. package/dist/index.js +60 -22
  36. package/dist/mcp/annotations.js +155 -0
  37. package/dist/mcp/audit.js +490 -133
  38. package/dist/mcp/confirm.js +48 -0
  39. package/dist/mcp/context.js +43 -5
  40. package/dist/mcp/deployMethods.js +192 -0
  41. package/dist/mcp/logger.js +5 -10
  42. package/dist/mcp/modules/bulkMembers.js +476 -0
  43. package/dist/mcp/modules/changedLines.js +189 -0
  44. package/dist/mcp/modules/compare.js +198 -0
  45. package/dist/mcp/modules/compile.js +515 -0
  46. package/dist/mcp/modules/ifsOps.js +123 -0
  47. package/dist/mcp/modules/index.js +38 -0
  48. package/dist/mcp/modules/inspect.js +811 -0
  49. package/dist/mcp/modules/libl.js +246 -0
  50. package/dist/mcp/modules/members.js +171 -0
  51. package/dist/mcp/modules/objects.js +339 -0
  52. package/dist/mcp/modules/system.js +266 -0
  53. package/dist/mcp/modules/tn5250.js +515 -0
  54. package/dist/mcp/policy.js +412 -0
  55. package/dist/mcp/tools.js +1700 -698
  56. package/dist/security/credentialStore.js +183 -7
  57. package/dist/security/localPaths.js +138 -0
  58. package/dist/security/redact.js +79 -0
  59. package/dist/util/atomicWrite.js +101 -0
  60. package/dist/util/fileLock.js +206 -0
  61. package/docs/capabilities.md +50 -7
  62. package/docs/configuration.md +189 -57
  63. package/docs/examples.md +109 -73
  64. package/docs/installation.md +4 -0
  65. package/docs/overview.md +15 -15
  66. package/docs/security.md +101 -8
  67. package/docs/tools.md +363 -188
  68. package/package.json +56 -53
package/README.md CHANGED
@@ -1,190 +1,224 @@
1
- # MCP-for-i
2
-
3
- `mcp-for-i` is a local MCP server + control plane for IBM i workflows. It provides secure connection onboarding, keychain-backed credentials, cross-platform runtime update controls, and IBM i tools for agent-driven operations.
4
-
5
- ## Install
6
-
7
- Install globally from npm:
8
-
9
- ```bash
10
- npm i -g mcp-for-i
11
- ```
12
-
13
- Verify commands:
14
-
15
- ```bash
16
- mcp-for-i --help
17
- mcp-for-i-control help
18
- ```
19
-
20
- Supported shells and terminals include PowerShell, `cmd`, Git Bash, Bash, Zsh, and WSL shells, across Windows, macOS, and Linux.
21
-
22
- ## Quick Start
23
-
24
- 1. Open the local control plane:
25
-
26
- ```bash
27
- mcp-for-i control
28
- ```
29
-
30
- `mcp-for-i control` will start the control server in the background if needed, then open the UI. If a browser cannot be opened in the current environment, it prints the local URL instead.
31
-
32
- 2. The default local UI URL is:
33
-
34
- ```text
35
- http://127.0.0.1:3980
36
- ```
37
-
38
- 3. Add IBM i connection profiles in the UI. Passwords are stored in the OS keychain, not plain config.
39
-
40
- ## Control Commands
41
-
42
- From an npm install or a git checkout build, these commands are the supported control entrypoints:
43
-
44
- ```bash
45
- mcp-for-i control
46
- mcp-for-i control status
47
- mcp-for-i control enable
48
- mcp-for-i control disable
49
- ```
50
-
51
- Equivalent direct control-plane binary commands:
52
-
53
- ```bash
54
- mcp-for-i-control open
55
- mcp-for-i-control status
56
- mcp-for-i-control enable
57
- mcp-for-i-control disable
58
- mcp-for-i-control serve
59
- ```
60
-
61
- Behavior by environment:
62
- - Windows: `enable` registers a Startup entry.
63
- - macOS: `enable` registers a LaunchAgent.
64
- - Linux: `enable` uses a user `systemd` service when available.
65
- - WSL: `enable` installs a guarded `.bashrc` hook that starts the control plane on interactive Bash shell launch.
66
-
67
- ## Add To Coding Clients
68
-
69
- The control-plane UI now includes a `Clients` tab with one-click setup for:
70
- - `Codex Desktop / CLI`
71
- - `Claude Code` when the `claude` CLI is installed
72
- - `VS Code / GitHub Copilot` when the `code` CLI is installed
73
-
74
- It also includes manual guidance for:
75
- - `Project Bob`
76
- - other MCP clients that use generic JSON/TOML stdio server configuration
77
-
78
- The UI writes or invokes the local client-specific setup on the same machine where the control plane is running. If a client CLI is not installed, the UI falls back to showing the exact launch command/snippet to use manually.
79
-
80
- ## Update and Version Management
81
-
82
- Update to latest globally:
83
-
84
- ```bash
85
- npm i -g mcp-for-i@latest
86
- ```
87
-
88
- Install a specific version:
89
-
90
- ```bash
91
- npm i -g mcp-for-i@0.1.1
92
- ```
93
-
94
- Rollback example:
95
-
96
- ```bash
97
- npm i -g mcp-for-i@0.1.0
98
- ```
99
-
100
- Check current installed version:
101
-
102
- ```bash
103
- mcp-for-i --version
104
- ```
105
-
106
- ## Control Plane Updates
107
-
108
- The control plane intentionally stays narrow:
109
-
110
- - `Update MCP`
111
- - If running from a git checkout: pulls latest changes from `origin/<current-branch>`, then installs/builds.
112
- - If running as an npm-installed package: upgrades the global npm package to latest.
113
- - On Windows global installs, update still runs in a detached updater to avoid file-lock (`EBUSY`) errors during self-update.
114
- - `Update Skills`
115
- - Pulls or clones the configured skills repository and branch into the local `skills` directory.
116
-
117
- For npm installs and manual upgrades, prefer standard npm commands such as `npm i -g mcp-for-i@latest`.
118
-
119
- ## Development (Git Checkout)
120
-
121
- For contributors working from source:
122
-
123
- ```bash
124
- npm install
125
- npm run build
126
- npm test
127
- npm run start:controlplane
128
- ```
129
-
130
- You can also use the built artifacts directly after build:
131
-
132
- ```bash
133
- node dist/index.js
134
- node dist/index.js control
135
- node dist/controlplane/index.js open
136
- ```
137
-
138
- ## Automated Release (No Manual Version Bump)
139
-
140
- Use the release script instead of raw `npm publish`.
141
-
142
- Patch release:
143
-
144
- ```bash
145
- npm run release:patch
146
- ```
147
-
148
- Minor release:
149
-
150
- ```bash
151
- npm run release:minor
152
- ```
153
-
154
- Major release:
155
-
156
- ```bash
157
- npm run release:major
158
- ```
159
-
160
- What it does:
161
- - Verifies git working tree is clean.
162
- - Runs `npm test` (unless `--skip-tests` is passed).
163
- - Checks npm published version.
164
- - Auto-bumps version only when local version is not ahead.
165
- - Publishes to npm.
166
- - Pushes commit/tag to GitHub.
167
-
168
- Optional flags:
169
-
170
- ```bash
171
- npm run release:patch -- --skip-tests
172
- npm run release:patch -- --otp=123456
173
- npm run release:patch -- --no-push
174
- ```
175
-
176
- ## Security Model
177
-
178
- - Credential-bearing direct tool arguments are blocked for connection creation/update flows.
179
- - Passwords are stored in keychain when available.
180
- - Control plane is local-first (`127.0.0.1` by default).
181
- - Guarded policy profile is the default for operational safety.
182
- - Tool schemas are strict (`additionalProperties: false`) with runtime argument validation, including nested connection/action/filter/profile payloads.
183
- - QSYS object names and source settings are validated before command execution to reduce interpolation and injection risk.
184
-
185
- ## Links
186
-
187
- - Main repo: [ashishthomas2202/mcp-for-i](https://github.com/ashishthomas2202/mcp-for-i)
188
- - Skills repo: [ashishthomas2202/mcp-for-i-skills](https://github.com/ashishthomas2202/mcp-for-i-skills)
189
- - Docs: `docs/`
190
- - Full capability guide: `docs/capabilities.md`
1
+ # MCP-for-i
2
+
3
+ `mcp-for-i` is a local MCP server + control plane for IBM i workflows. It provides secure connection onboarding, keychain-backed credentials, cross-platform runtime update controls, and IBM i tools for agent-driven operations.
4
+
5
+ ## Install
6
+
7
+ The npm package name is `mcp-for-i`.
8
+
9
+ Install globally from npm:
10
+
11
+ ```bash
12
+ npm i -g mcp-for-i
13
+ ```
14
+
15
+ Verify commands:
16
+
17
+ ```bash
18
+ mcp-for-i --help
19
+ mcp-for-i-control help
20
+ ```
21
+
22
+ Supported shells and terminals include PowerShell, `cmd`, Git Bash, Bash, Zsh, and WSL shells, across Windows, macOS, and Linux.
23
+
24
+ ## Quick Start
25
+
26
+ 1. Open the local control plane:
27
+
28
+ ```bash
29
+ mcp-for-i control
30
+ ```
31
+
32
+ `mcp-for-i control` will start the control server in the background if needed, then open the UI. If a browser cannot be opened in the current environment, it prints the local URL instead.
33
+
34
+ 2. The default local UI URL is:
35
+
36
+ ```text
37
+ http://127.0.0.1:3980
38
+ ```
39
+
40
+ 3. Add IBM i connection profiles in the UI. Passwords are stored in the OS keychain, not plain config.
41
+
42
+ WSL note: persistent password storage requires a working Linux Secret Service inside the WSL distro. WSL does not automatically use Windows Credential Manager; when no keychain is available, MCP-for-i keeps passwords only for the current process and the control plane shows a warning.
43
+
44
+ Credential storage adapts to the Node runtime: Windows Node from PowerShell, `cmd`, or Git Bash uses Windows Credential Manager; macOS uses Keychain; Linux uses Secret Service; WSL uses the WSL distro's Linux Secret Service.
45
+
46
+ ## Control Commands
47
+
48
+ From an npm install or a git checkout build, these commands are the supported control entrypoints:
49
+
50
+ ```bash
51
+ mcp-for-i control
52
+ mcp-for-i control status
53
+ mcp-for-i control enable
54
+ mcp-for-i control disable
55
+ ```
56
+
57
+ Equivalent direct control-plane binary commands:
58
+
59
+ ```bash
60
+ mcp-for-i-control open
61
+ mcp-for-i-control status
62
+ mcp-for-i-control enable
63
+ mcp-for-i-control disable
64
+ mcp-for-i-control serve
65
+ ```
66
+
67
+ Behavior by environment:
68
+ - Windows: `enable` registers a Startup entry.
69
+ - macOS: `enable` registers a LaunchAgent.
70
+ - Linux: `enable` uses a user `systemd` service when available.
71
+ - WSL: `enable` installs a guarded `.bashrc` hook that starts the control plane on interactive Bash shell launch.
72
+
73
+ ## Add To Coding Clients
74
+
75
+ The control-plane UI now includes a `Clients` tab with one-click setup for:
76
+ - `Codex Desktop / CLI`
77
+ - `Claude Code` when the `claude` CLI is installed
78
+ - `VS Code / GitHub Copilot` when the `code` CLI is installed
79
+
80
+ It also includes manual guidance for:
81
+ - `Project Bob`
82
+ - other MCP clients that use generic JSON/TOML stdio server configuration
83
+
84
+ The UI writes or invokes the local client-specific setup on the same machine where the control plane is running. If a client CLI is not installed, the UI falls back to showing the exact launch command/snippet to use manually.
85
+
86
+ ## Update and Version Management
87
+
88
+ Update to latest globally:
89
+
90
+ ```bash
91
+ npm i -g mcp-for-i@latest
92
+ ```
93
+
94
+ Install a specific version:
95
+
96
+ ```bash
97
+ npm i -g mcp-for-i@0.1.1
98
+ ```
99
+
100
+ Rollback example:
101
+
102
+ ```bash
103
+ npm i -g mcp-for-i@0.1.0
104
+ ```
105
+
106
+ Check current installed version:
107
+
108
+ ```bash
109
+ mcp-for-i --version
110
+ ```
111
+
112
+ ## Control Plane Updates
113
+
114
+ The control plane intentionally stays narrow:
115
+
116
+ - `Update MCP`
117
+ - If running from a git checkout: pulls latest changes from `origin/<current-branch>`, then installs/builds.
118
+ - If running as an npm-installed package: upgrades the global npm package to latest.
119
+ - On Windows global installs, update still runs in a detached updater to avoid file-lock (`EBUSY`) errors during self-update.
120
+ - `Update Skills`
121
+ - Pulls or clones the configured skills repository and branch into the local `skills` directory.
122
+
123
+ For npm installs and manual upgrades, prefer standard npm commands such as `npm i -g mcp-for-i@latest`.
124
+
125
+ ## Development (Git Checkout)
126
+
127
+ For contributors working from source:
128
+
129
+ ```bash
130
+ npm install
131
+ npm run build
132
+ npm test
133
+ npm run start:controlplane
134
+ ```
135
+
136
+ You can also use the built artifacts directly after build:
137
+
138
+ ```bash
139
+ node dist/index.js
140
+ node dist/index.js control
141
+ node dist/controlplane/index.js open
142
+ ```
143
+
144
+ ## Automated Release (No Manual Version Bump)
145
+
146
+ Use the release script instead of raw `npm publish`. The script publishes the `mcp-for-i` npm package.
147
+
148
+ Before releasing, verify npm auth and the currently published version:
149
+
150
+ ```bash
151
+ npm whoami
152
+ npm view mcp-for-i version
153
+ ```
154
+
155
+ If `npm whoami` fails, run `npm login` first.
156
+
157
+ Patch release:
158
+
159
+ ```bash
160
+ npm run release:patch
161
+ ```
162
+
163
+ Minor release:
164
+
165
+ ```bash
166
+ npm run release:minor
167
+ ```
168
+
169
+ Major release:
170
+
171
+ ```bash
172
+ npm run release:major
173
+ ```
174
+
175
+ What it does:
176
+ - Verifies git working tree is clean.
177
+ - Runs `npm test` (unless `--skip-tests` is passed).
178
+ - Checks npm published version.
179
+ - Auto-bumps version only when local version is not ahead.
180
+ - Publishes to npm.
181
+ - Pushes commit/tag to GitHub.
182
+
183
+ Optional flags:
184
+
185
+ ```bash
186
+ npm run release:patch -- --skip-tests
187
+ npm run release:patch -- --otp=123456
188
+ npm run release:patch -- --no-push
189
+ ```
190
+
191
+ OTP is only needed when the npm account has two-factor authentication enabled for publishing. If npm asks for a one-time password, use the current code from the authenticator app or recovery method configured on the npm account, then rerun with `--otp=<code>`. If the account does not have publish-time 2FA enabled, no OTP is needed.
192
+
193
+ ## Security Model
194
+
195
+ - Credential-bearing direct tool arguments are blocked for connection creation/update flows.
196
+ - Passwords are stored in keychain when available; failed or missing keychain access falls back to process-only session storage with a visible control-plane warning.
197
+ - Control plane is local-first (`127.0.0.1` by default).
198
+ - Guarded policy profile is the default for operational safety.
199
+ - Tool schemas are strict (`additionalProperties: false`) with runtime argument validation, including nested connection/action/filter/profile payloads.
200
+ - QSYS object names and source settings are validated before command execution to reduce interpolation and injection risk.
201
+
202
+ ## Fast Source Investigation
203
+
204
+ The existing member tools remain compatible: an unchanged `ibmi.qsys.members.list` call still returns an array, and an unchanged `ibmi.qsys.members.read` call still returns source text. New callers can opt into faster, bounded workflows:
205
+
206
+ - `ibmi.session.bootstrap` returns connection, release, library-list, policy, transport, and capability information in one call.
207
+ - `ibmi.source.resolve` finds an exact member across likely source files without returning an entire source-file inventory.
208
+ - `ibmi.source.inspect` performs up to eight metadata, outline, search, range-read, and dependency operations over one consistent member snapshot.
209
+ - `ibmi.qsys.members.list` supports exact/prefix/contains/source-type/change-time filtering and keyset paging with `responseFormat: "page"`.
210
+ - `ibmi.qsys.members.read` supports ranges, context, metadata, SHA-256, and version checks with `responseFormat: "structured"`.
211
+ - `ibmi.qsys.members.write` accepts `expectedVersion` or `expectedSha256` to prevent a stale analysis from overwriting newer source.
212
+
213
+ Source-date reads use an ephemeral `QTEMP` alias in the same database job. If that path is unavailable, the server falls back to a complete UTF-8 `CPYTOSTMF` read; it never reconstructs a member from search matches.
214
+
215
+ ## IBM i Documentation
216
+
217
+ `ibmi.docs.search` and `ibmi.docs.open` provide a release-aware, cached catalog of allowlisted official IBM documentation. The same catalog and topic content are exposed as MCP resources under `ibmi-docs://`. Documentation results include their official canonical URL, content version/checksum, and observation time. When local coverage is insufficient, search results explicitly recommend a web fallback instead of presenting cached material as exhaustive.
218
+
219
+ ## Links
220
+
221
+ - Main repo: [ashishthomas2202/mcp-for-i](https://github.com/ashishthomas2202/mcp-for-i)
222
+ - Skills repo: [ashishthomas2202/mcp-for-i-skills](https://github.com/ashishthomas2202/mcp-for-i-skills)
223
+ - Docs: `docs/`
224
+ - Full capability guide: `docs/capabilities.md`