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.
- package/README.md +224 -190
- package/dist/config/store.js +229 -109
- package/dist/controlplane/auth.js +128 -0
- package/dist/controlplane/clientIntegrationService.js +83 -4
- package/dist/controlplane/commands.js +14 -9
- package/dist/controlplane/connectionService.js +110 -5
- package/dist/controlplane/connectionTest.js +329 -0
- package/dist/controlplane/errors.js +12 -0
- package/dist/controlplane/runtimeService.js +98 -26
- package/dist/controlplane/server.js +124 -12
- package/dist/controlplane/serverShared.js +25 -6
- package/dist/controlplane/serviceManager.js +113 -100
- package/dist/controlplane/ui.js +1742 -892
- package/dist/ibmi/CompileTools.js +29 -1
- package/dist/ibmi/IBMiContent.js +435 -63
- package/dist/ibmi/IbmDocs.js +685 -0
- package/dist/ibmi/LocalLanguageActions.js +129 -3
- package/dist/ibmi/Search.js +158 -52
- package/dist/ibmi/Tools.js +7 -10
- package/dist/ibmi/client.js +220 -31
- package/dist/ibmi/evfevent.js +256 -0
- package/dist/ibmi/knownHosts.js +190 -0
- package/dist/ibmi/libraryList.js +93 -0
- package/dist/ibmi/sourceInspect.js +815 -0
- package/dist/ibmi/sqlJob.js +888 -0
- package/dist/ibmi/sqlParse.js +317 -0
- package/dist/ibmi/tn5250/certTrust.js +59 -0
- package/dist/ibmi/tn5250/client.js +310 -0
- package/dist/ibmi/tn5250/datastream.js +109 -0
- package/dist/ibmi/tn5250/ebcdic.js +74 -0
- package/dist/ibmi/tn5250/index.js +6 -0
- package/dist/ibmi/tn5250/screen.js +827 -0
- package/dist/ibmi/tn5250/telnet.js +186 -0
- package/dist/ibmi/variables.js +18 -7
- package/dist/index.js +60 -22
- package/dist/mcp/annotations.js +155 -0
- package/dist/mcp/audit.js +490 -133
- package/dist/mcp/confirm.js +48 -0
- package/dist/mcp/context.js +43 -5
- package/dist/mcp/deployMethods.js +192 -0
- package/dist/mcp/logger.js +5 -10
- package/dist/mcp/modules/bulkMembers.js +476 -0
- package/dist/mcp/modules/changedLines.js +189 -0
- package/dist/mcp/modules/compare.js +198 -0
- package/dist/mcp/modules/compile.js +515 -0
- package/dist/mcp/modules/ifsOps.js +123 -0
- package/dist/mcp/modules/index.js +38 -0
- package/dist/mcp/modules/inspect.js +811 -0
- package/dist/mcp/modules/libl.js +246 -0
- package/dist/mcp/modules/members.js +171 -0
- package/dist/mcp/modules/objects.js +339 -0
- package/dist/mcp/modules/system.js +266 -0
- package/dist/mcp/modules/tn5250.js +515 -0
- package/dist/mcp/policy.js +412 -0
- package/dist/mcp/tools.js +1700 -698
- package/dist/security/credentialStore.js +183 -7
- package/dist/security/localPaths.js +138 -0
- package/dist/security/redact.js +79 -0
- package/dist/util/atomicWrite.js +101 -0
- package/dist/util/fileLock.js +206 -0
- package/docs/capabilities.md +50 -7
- package/docs/configuration.md +189 -57
- package/docs/examples.md +109 -73
- package/docs/installation.md +4 -0
- package/docs/overview.md +15 -15
- package/docs/security.md +101 -8
- package/docs/tools.md +363 -188
- 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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
mcp-for-i
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- `
|
|
71
|
-
- `
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- `
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
npm i -g mcp-for-i@
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
npm i -g mcp-for-i@0.1.
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
mcp-for-i
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
npm
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
npm run release:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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`
|