mcp-for-i 0.1.13 → 0.3.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 +27 -0
- 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 +52 -11
- 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 +178 -11
- package/dist/controlplane/serverShared.js +25 -6
- package/dist/controlplane/serviceManager.js +147 -100
- package/dist/controlplane/ui.js +1783 -920
- 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 +334 -0
- package/dist/ibmi/tn5250/datastream.js +109 -0
- package/dist/ibmi/tn5250/ebcdic.js +93 -0
- package/dist/ibmi/tn5250/ebcdicTables.js +27 -0
- package/dist/ibmi/tn5250/index.js +6 -0
- package/dist/ibmi/tn5250/screen.js +1033 -0
- package/dist/ibmi/tn5250/telnet.js +186 -0
- package/dist/ibmi/variables.js +18 -7
- package/dist/index.js +79 -24
- 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 +800 -0
- package/dist/mcp/modules/tn5250App.js +194 -0
- package/dist/mcp/modules/tn5250Font.js +8 -0
- package/dist/mcp/modules/tn5250Live.js +221 -0
- package/dist/mcp/modules/tn5250LivePage.js +480 -0
- package/dist/mcp/policy.js +412 -0
- package/dist/mcp/tools.js +1719 -698
- package/dist/security/credentialStore.js +62 -13
- 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 +264 -220
- package/docs/configuration.md +193 -60
- package/docs/examples.md +109 -73
- package/docs/overview.md +15 -15
- package/docs/security.md +101 -16
- package/docs/tools.md +367 -188
- package/package.json +5 -2
package/docs/tools.md
CHANGED
|
@@ -1,188 +1,367 @@
|
|
|
1
|
-
# Tools
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- `ibmi.
|
|
7
|
-
- `ibmi.
|
|
8
|
-
- `ibmi.session.
|
|
9
|
-
- `ibmi.session.
|
|
10
|
-
- `ibmi.
|
|
11
|
-
- `ibmi.
|
|
12
|
-
- `ibmi.
|
|
13
|
-
- `ibmi.connections.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- `ibmi.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- `ibmi.qsys.
|
|
20
|
-
- `ibmi.qsys.
|
|
21
|
-
- `ibmi.qsys.
|
|
22
|
-
- `ibmi.qsys.members.
|
|
23
|
-
- `ibmi.qsys.members.
|
|
24
|
-
- `ibmi.qsys.members.
|
|
25
|
-
- `ibmi.qsys.
|
|
26
|
-
- `ibmi.qsys.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- `ibmi.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- `
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- `
|
|
39
|
-
- `ibmi.search.
|
|
40
|
-
- `
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- `
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- `ibmi.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- `ibmi.
|
|
50
|
-
- `ibmi.
|
|
51
|
-
- `ibmi.
|
|
52
|
-
- `ibmi.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- `ibmi.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- `
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- `ibmi.
|
|
70
|
-
- `ibmi.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- `
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- `ibmi.
|
|
79
|
-
- `ibmi.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- `ibmi.
|
|
84
|
-
-
|
|
85
|
-
- `
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `ibmi.
|
|
90
|
-
- `ibmi.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- `ibmi.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- `ibmi.
|
|
99
|
-
- `ibmi.
|
|
100
|
-
- `ibmi.
|
|
101
|
-
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- `ibmi.
|
|
107
|
-
- `ibmi.
|
|
108
|
-
- `ibmi.
|
|
109
|
-
- `ibmi.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- `ibmi.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- `ibmi.
|
|
116
|
-
- `ibmi.
|
|
117
|
-
- `ibmi.
|
|
118
|
-
- `ibmi.
|
|
119
|
-
- `ibmi.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- `ibmi.
|
|
123
|
-
- `ibmi.
|
|
124
|
-
- `ibmi.
|
|
125
|
-
- `ibmi.
|
|
126
|
-
- `
|
|
127
|
-
- `
|
|
128
|
-
- `
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- `ibmi.
|
|
141
|
-
- `ibmi.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
- `ibmi.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
- `ibmi.
|
|
155
|
-
- `ibmi.
|
|
156
|
-
- `ibmi.
|
|
157
|
-
- `
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- `ibmi.
|
|
161
|
-
- `ibmi.
|
|
162
|
-
- `ibmi.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
- `ibmi.
|
|
166
|
-
- `ibmi.
|
|
167
|
-
- `ibmi.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- `ibmi.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- `ibmi.
|
|
178
|
-
- `ibmi.
|
|
179
|
-
- `ibmi.
|
|
180
|
-
- `ibmi.
|
|
181
|
-
- `ibmi.
|
|
182
|
-
- `ibmi.
|
|
183
|
-
- `ibmi.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
- `
|
|
1
|
+
# Tools
|
|
2
|
+
|
|
3
|
+
Every tool carries MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`), so MCP clients can auto-approve read-only tools and ask before destructive ones. Only the IBM Docs tools reach the internet (`openWorldHint: true`).
|
|
4
|
+
|
|
5
|
+
## Connection
|
|
6
|
+
- `ibmi.connect`
|
|
7
|
+
- `ibmi.disconnect`
|
|
8
|
+
- `ibmi.session.list`
|
|
9
|
+
- `ibmi.session.status`
|
|
10
|
+
- `ibmi.session.keepalive`
|
|
11
|
+
- `ibmi.session.terminate`
|
|
12
|
+
- `ibmi.session.bootstrap`
|
|
13
|
+
- `ibmi.connections.list`
|
|
14
|
+
- `ibmi.connections.add`
|
|
15
|
+
- `ibmi.connections.update`
|
|
16
|
+
- `ibmi.connections.delete`
|
|
17
|
+
|
|
18
|
+
## QSYS / Members
|
|
19
|
+
- `ibmi.qsys.libraries.list`
|
|
20
|
+
- `ibmi.qsys.objects.list`
|
|
21
|
+
- `ibmi.qsys.sourcefiles.list`
|
|
22
|
+
- `ibmi.qsys.members.list`
|
|
23
|
+
- `ibmi.qsys.members.read`
|
|
24
|
+
- `ibmi.qsys.members.write`
|
|
25
|
+
- `ibmi.qsys.members.create`
|
|
26
|
+
- `ibmi.qsys.members.rename`
|
|
27
|
+
- `ibmi.qsys.members.delete`
|
|
28
|
+
- `ibmi.qsys.sourcefiles.create`
|
|
29
|
+
- `ibmi.qsys.libraries.create`
|
|
30
|
+
|
|
31
|
+
### Source performance and compatibility notes
|
|
32
|
+
|
|
33
|
+
- Existing `members.list` calls keep the legacy array response. Set `responseFormat: "page"`, provide a filter, or provide paging arguments to receive a bounded structured page.
|
|
34
|
+
- Existing `members.read` calls keep the legacy text response. Set `responseFormat: "structured"` or request ranges, context, metadata, or a version check to receive the structured snapshot envelope.
|
|
35
|
+
- `members.write` supports optional optimistic-concurrency checks through `expectedVersion` and `expectedSha256`.
|
|
36
|
+
- `members.read` uses a job-local alias for source-date reads and a complete `CPYTOSTMF` fallback if the SQL path is unavailable.
|
|
37
|
+
- Both read paths normalize content the same way before hashing (LF line endings, trailing blanks trimmed from every line), so `sha256` and `version` do not change when a read falls back from SQL to `CPYTOSTMF`.
|
|
38
|
+
- Cached snapshots are only served after a cheap re-check of the member's `LAST_SOURCE_UPDATE_TIMESTAMP` and row count, so edits made outside this server are seen immediately. Cache hits report `cacheStatus: "hit"` and `validatedAt`.
|
|
39
|
+
- Full reads are capped by the `sourceReadMaxBytes` / `sourceReadMaxLines` settings (defaults 2,000,000 bytes and 50,000 lines). Larger members return a `SOURCE_TOO_LARGE` error with the size and version; read them with `startLine`/`endLine` or `ranges`, or locate code with `ibmi.search.members` / `ibmi.source.inspect`.
|
|
40
|
+
- `startLine` without `endLine` reads to the end of the member. Ranges past the end return no lines and a warning. Range responses are limited to 2,000 lines; when cut, the response has `truncated: true` and `nextLine`.
|
|
41
|
+
- `metadataOnly: true` does not download content. It returns `changeMarker` and catalog metadata, plus `sha256`/`version` only when a validated cached snapshot exists.
|
|
42
|
+
- A version mismatch (`expectedVersion` / `expectedSha256`) on read, inspect or write is a tool error with `code: "VERSION_CONFLICT"`, `currentVersion` and `currentSha256`; nothing is modified.
|
|
43
|
+
- A successful `members.write` reads the member back and returns `version`, `sha256`, `lineCount` and `previousVersion` (as JSON when a version check or `responseFormat: "structured"` is used; otherwise the text stays `OK` and the details are in `structuredContent`). The version check and the write are separate host operations, so a change made in the instant between them is not detected.
|
|
44
|
+
|
|
45
|
+
## IFS
|
|
46
|
+
- `ibmi.ifs.list`
|
|
47
|
+
- `ibmi.ifs.read`
|
|
48
|
+
- `ibmi.ifs.write`
|
|
49
|
+
- `ibmi.ifs.mkdir`
|
|
50
|
+
- `ibmi.ifs.delete`
|
|
51
|
+
- `ibmi.ifs.upload`
|
|
52
|
+
- `ibmi.ifs.download`
|
|
53
|
+
|
|
54
|
+
## Search
|
|
55
|
+
- `ibmi.search.members`
|
|
56
|
+
- `ibmi.search.ifs`
|
|
57
|
+
- `ibmi.find.ifs`
|
|
58
|
+
|
|
59
|
+
`ibmi.search.members` accepts either `term` or up to 20 `terms` in one remote request.
|
|
60
|
+
|
|
61
|
+
- Terms are matched literally (`-F`) and sent over stdin (`-f -`), never through the shell.
|
|
62
|
+
- `maxMatches` defaults to 100 (maximum 1,000). The limit is applied on the host while the grep runs (`-m` per member plus a bounded output pipe), not after downloading everything.
|
|
63
|
+
- The response includes `matchCount`, `maxMatches`, `truncated` and, when truncated, `truncatedReason` (`max-matches` or `output-limit`). When `truncated` is true, narrow the search (members filter, more specific terms) rather than raising the limit.
|
|
64
|
+
- With `before`/`after` (0 to 50), each returned line has `kind: "match"` or `kind: "context"`.
|
|
65
|
+
- `pfgrep` is used when installed at `/QOpenSys/pkgs/bin/pfgrep`; otherwise grep is used.
|
|
66
|
+
|
|
67
|
+
## Composite Source Inspection
|
|
68
|
+
|
|
69
|
+
- `ibmi.source.resolve`
|
|
70
|
+
- `ibmi.source.inspect`
|
|
71
|
+
|
|
72
|
+
`ibmi.source.inspect` batches metadata, outline, search, range-read, and dependency extraction over one versioned source snapshot.
|
|
73
|
+
|
|
74
|
+
Outline and dependency extraction follow the member source type: RPG (fully free, fixed and mixed: procedures, subroutines, prototypes, data structures, `dcl-f`/F-spec files, `EXTPGM`/`EXTPROC`, `CALL`/`CALLB`/`CALLP`, `/COPY`/`/INCLUDE` and embedded SQL tables), CL (`CALL`, `CALLPRC`, `DCLF`, `OVRDBF TOFILE`, `INCLUDE`, `RUNSQL`, `SBMJOB CMD(CALL ...)`, labels, subroutines), SQL (created objects; tables from `FROM`, `JOIN`, `INSERT`/`MERGE INTO`, `UPDATE`, `DELETE FROM`, `REFERENCES`; `CALL`), and DDS PF/LF/DSPF/PRTF (record formats, keys, fields; `REF`, `REFFLD`, `PFILE`, `JFILE`). Results include the detected `language`.
|
|
75
|
+
|
|
76
|
+
## Official IBM i Documentation
|
|
77
|
+
|
|
78
|
+
- `ibmi.docs.search`
|
|
79
|
+
- `ibmi.docs.open`
|
|
80
|
+
|
|
81
|
+
The documentation catalog is also exposed through MCP resources: `ibmi-docs://catalog` and `ibmi-docs://topic/{ref}`.
|
|
82
|
+
|
|
83
|
+
- `ibmi.docs.open` accepts a `ref` from search or any `https://www.ibm.com/docs/...` URL (for example a single CL command or API page). The URL must be https, host exactly `www.ibm.com`, path under `/docs/`, with no user information or port. Redirects are followed only within `www.ibm.com/docs/`, at most 3.
|
|
84
|
+
- Pages are capped at 12 MiB while downloading, HTML tables become Markdown tables, and pages that were opened become searchable.
|
|
85
|
+
- Cached pages expire after 7 days (`MCP_FOR_I_IBM_DOCS_CACHE_TTL_DAYS`). `cacheStatus` is `hit`, `miss`, `refreshed` or `stale` (expired copy served because the refresh failed).
|
|
86
|
+
- The search catalog covers IBM i 7.2 to 7.6. Asking for an older release returns a warning saying IBM Docs has no collection for it.
|
|
87
|
+
|
|
88
|
+
## Actions
|
|
89
|
+
- `ibmi.actions.list`
|
|
90
|
+
- `ibmi.actions.run`
|
|
91
|
+
- `ibmi.actions.save`
|
|
92
|
+
- `ibmi.actions.delete`
|
|
93
|
+
|
|
94
|
+
## Library List
|
|
95
|
+
- `ibmi.libl.get`
|
|
96
|
+
- `ibmi.libl.set`
|
|
97
|
+
- `ibmi.libl.add`
|
|
98
|
+
- `ibmi.libl.remove`
|
|
99
|
+
- `ibmi.libl.setCurrent`
|
|
100
|
+
- `ibmi.libl.validate`
|
|
101
|
+
- `ibmi.libl.move`
|
|
102
|
+
- `ibmi.libl.prune`
|
|
103
|
+
- `ibmi.libl.runProfileCommand`
|
|
104
|
+
|
|
105
|
+
## Profiles
|
|
106
|
+
- `ibmi.profiles.list`
|
|
107
|
+
- `ibmi.profiles.save`
|
|
108
|
+
- `ibmi.profiles.delete`
|
|
109
|
+
- `ibmi.profiles.activate`
|
|
110
|
+
|
|
111
|
+
## Resolve
|
|
112
|
+
- `ibmi.resolve.path`
|
|
113
|
+
|
|
114
|
+
## Deploy
|
|
115
|
+
- `ibmi.deploy.uploadDirectory`
|
|
116
|
+
- `ibmi.deploy.uploadFiles`
|
|
117
|
+
- `ibmi.deploy.setCcsid`
|
|
118
|
+
- `ibmi.deploy.compare`
|
|
119
|
+
- `ibmi.deploy.sync`
|
|
120
|
+
|
|
121
|
+
### Deploy Notes
|
|
122
|
+
- `ibmi.deploy.compare` returns richer drift data: `onlyLocal`, `onlyRemote`, `identical`, `changed`, `unresolved`, and a `summary`.
|
|
123
|
+
- `ibmi.deploy.sync` supports `overwrite`, `dryRun`, and `deleteExtraRemote`.
|
|
124
|
+
- `ibmi.deploy.sync` returns execution mapping (`planned`, `applied`, `errors`) for safer automation, plus a `summary` with `planned`, `uploaded`, `unchanged`, `skipped`, `deleted` and `failed` counts.
|
|
125
|
+
- `ibmi.deploy.sync` takes `method`:
|
|
126
|
+
- `all` (default): original behavior. Uploads files missing remotely; with `overwrite`, also files whose size differs or is unknown.
|
|
127
|
+
- `changed`: compares SHA-256 hashes of files present on both sides (local with node crypto, remote with `sha256sum` or `openssl dgst -sha256` in batched calls) and uploads only missing or different files. Fails with a clear error when the IBM i has neither tool.
|
|
128
|
+
- `gitChanged`: uploads the staged, unstaged and untracked files under `localPath` reported by `git status --porcelain -z` (run without a shell). Deleted files are listed in `planned.gitDeleted`, never removed remotely.
|
|
129
|
+
- `selection`: uploads the paths listed in `files` (relative to `localPath`; absolute paths and `..` are refused).
|
|
130
|
+
- `deleteExtraRemote` works only with `all` and `changed`.
|
|
131
|
+
- `ibmi.deploy.compare` takes `method: "changed"` to compare by SHA-256 instead of size (`comparedBy: "sha256"`).
|
|
132
|
+
|
|
133
|
+
## Filters
|
|
134
|
+
- `ibmi.filters.list`
|
|
135
|
+
- `ibmi.filters.save`
|
|
136
|
+
- `ibmi.filters.delete`
|
|
137
|
+
|
|
138
|
+
## IFS Shortcuts
|
|
139
|
+
- `ibmi.ifs.shortcuts.list`
|
|
140
|
+
- `ibmi.ifs.shortcuts.add`
|
|
141
|
+
- `ibmi.ifs.shortcuts.delete`
|
|
142
|
+
|
|
143
|
+
## Debug
|
|
144
|
+
- `ibmi.debug.status`
|
|
145
|
+
- `ibmi.debug.startService`
|
|
146
|
+
- `ibmi.debug.stopService`
|
|
147
|
+
|
|
148
|
+
## SQL / CL
|
|
149
|
+
- `ibmi.sql.query`
|
|
150
|
+
- `ibmi.sql.execute`
|
|
151
|
+
- `ibmi.cl.run`
|
|
152
|
+
|
|
153
|
+
### SQL / CL Notes
|
|
154
|
+
- `ibmi.sql.query` supports cursor paging (`cursor`), `pageSize`, `maxRows`, `timeoutMs`, and optional `includeMetadata`.
|
|
155
|
+
- `ibmi.sql.execute` asks the user before writes under the guarded policy and supports optional `timeoutMs`.
|
|
156
|
+
- `ibmi.cl.run` supports `ile`, `qsh`, or `pase` execution with optional `timeoutMs`.
|
|
157
|
+
- Tool responses include structured envelopes (`structuredContent`) for machine-safe agent parsing.
|
|
158
|
+
|
|
159
|
+
## Diagnostics / Ops
|
|
160
|
+
- `ibmi.diagnostics.parseEvfevent`
|
|
161
|
+
- `ibmi.joblog.get`
|
|
162
|
+
- `ibmi.spool.list`
|
|
163
|
+
- `ibmi.spool.read`
|
|
164
|
+
- `ibmi.spool.hold`
|
|
165
|
+
- `ibmi.spool.release`
|
|
166
|
+
- `ibmi.spool.delete`
|
|
167
|
+
- `ibmi.spool.move`
|
|
168
|
+
- `ibmi.jobs.list`
|
|
169
|
+
- `ibmi.jobs.hold`
|
|
170
|
+
- `ibmi.jobs.release`
|
|
171
|
+
- `ibmi.jobs.end`
|
|
172
|
+
- `ibmi.subsystems.list`
|
|
173
|
+
- `ibmi.subsystems.status`
|
|
174
|
+
- `ibmi.subsystems.start`
|
|
175
|
+
- `ibmi.subsystems.end`
|
|
176
|
+
- `ibmi.msgq.read`
|
|
177
|
+
- `ibmi.msgq.send`
|
|
178
|
+
- `ibmi.msgq.reply`
|
|
179
|
+
- `ibmi.locks.list`
|
|
180
|
+
- `ibmi.authority.object.get`
|
|
181
|
+
- `ibmi.dataqueue.send`
|
|
182
|
+
- `ibmi.dataqueue.receive`
|
|
183
|
+
- `ibmi.dataarea.read`
|
|
184
|
+
- `ibmi.dataarea.write`
|
|
185
|
+
|
|
186
|
+
### Diagnostics Notes
|
|
187
|
+
- Diagnostics tools return normalized records suitable for downstream agents (`source`, normalized severity/status fields, and preserved raw fields).
|
|
188
|
+
- `ibmi.actions.run` now returns mapped execution status (`ok`, `status`) and parsed command diagnostics alongside raw command output.
|
|
189
|
+
- Spool controls now support hold/release/delete and output-queue move operations for targeted spool entries.
|
|
190
|
+
- Job and subsystem controls support both observability (`list`/`status`) and lifecycle actions (hold/release/end/start).
|
|
191
|
+
- Message queue tooling supports operational reads plus explicit send/reply workflows.
|
|
192
|
+
- Lock and authority tools are useful preflight checks before risky writes.
|
|
193
|
+
- Data queue and data area tooling covers common IBM i operational integration surfaces.
|
|
194
|
+
|
|
195
|
+
## Audit
|
|
196
|
+
- `ibmi.audit.list`
|
|
197
|
+
- `ibmi.audit.verify`
|
|
198
|
+
- `ibmi.audit.export`
|
|
199
|
+
- `ibmi.audit.purge`
|
|
200
|
+
|
|
201
|
+
### Audit Notes
|
|
202
|
+
- Tool calls are recorded in a tamper-evident local audit chain.
|
|
203
|
+
- `ibmi.audit.verify` validates hash continuity and head hash state.
|
|
204
|
+
- `ibmi.audit.export` supports `jsonl`, `json`, and `csv` output.
|
|
205
|
+
- `ibmi.audit.purge` supports `dryRun`; destructive purge asks the user under guarded (other profiles: `approve=true`).
|
|
206
|
+
|
|
207
|
+
## Journaling
|
|
208
|
+
- `ibmi.journal.objects.list`
|
|
209
|
+
- `ibmi.journal.entries.query`
|
|
210
|
+
- `ibmi.qaudjrn.events.query`
|
|
211
|
+
- `ibmi.journal.receiver.create`
|
|
212
|
+
- `ibmi.journal.create`
|
|
213
|
+
- `ibmi.journal.receiver.change`
|
|
214
|
+
- `ibmi.journal.startPf`
|
|
215
|
+
- `ibmi.journal.endPf`
|
|
216
|
+
- `ibmi.journal.startIfs`
|
|
217
|
+
- `ibmi.journal.endIfs`
|
|
218
|
+
- `ibmi.journal.receivers.retention`
|
|
219
|
+
|
|
220
|
+
### Journaling Notes
|
|
221
|
+
- `ibmi.journal.entries.query` supports advanced filters (`journalCode`, `entryType`, `userName`, `jobName`, `programName`) and normalizes key fields.
|
|
222
|
+
- `ibmi.qaudjrn.events.query` targets `QSYS/QAUDJRN` for security/compliance event review.
|
|
223
|
+
- `ibmi.journal.receivers.retention` supports `dryRun`; destructive cleanup asks the user under guarded (other profiles: `approve=true`).
|
|
224
|
+
|
|
225
|
+
## Compliance
|
|
226
|
+
- `ibmi.compliance.report.generate`
|
|
227
|
+
|
|
228
|
+
### Compliance Notes
|
|
229
|
+
- Generates preset compliance snapshots with audit-chain verification + QAUDJRN summaries.
|
|
230
|
+
- Optional evidence-bundle signing writes `<outputPath>.sig` and `<outputPath>.sha256`.
|
|
231
|
+
|
|
232
|
+
## TN5250
|
|
233
|
+
- `ibmi.tn5250.connect`
|
|
234
|
+
- `ibmi.tn5250.readScreen`
|
|
235
|
+
- `ibmi.tn5250.setField`
|
|
236
|
+
- `ibmi.tn5250.sendKeys`
|
|
237
|
+
- `ibmi.tn5250.click`
|
|
238
|
+
- `ibmi.tn5250.waitFor`
|
|
239
|
+
- `ibmi.tn5250.snapshot`
|
|
240
|
+
- `ibmi.tn5250.disconnect`
|
|
241
|
+
|
|
242
|
+
### TN5250 Notes
|
|
243
|
+
These tools drive a real 5250 display session over telnet (RFC 1205 / RFC 2877 / RFC 4777): what you see is the actual green screen, and anything an operator can do there (menus, prompts, interactive programs) can be done here.
|
|
244
|
+
|
|
245
|
+
- **connect**: opens one session per saved connection. The host is the connection's host; the port and TLS come from the connection (or global) settings `tn5250Port` and `tn5250Tls` (default port 23; port 992 or `tn5250Tls: true` means TLS), and can be overridden with `port` / `tls`. `deviceName` (or the `tn5250DeviceName` setting) requests a virtual device name. `screenSize: "27x132"` announces an IBM-3477-FC display; the default is IBM-3179-2 (24x80). `ccsid` (or the `tn5250Ccsid` setting) picks the single-byte EBCDIC code page for screen text; the matching `CODEPAGE`, `CHARSET` and `KBDTYPE` are announced to the host. Calling connect again while the session is open returns the current screen with `reused: true`.
|
|
246
|
+
- **Sign-on**: `signOn: true` uses the connection's saved user and password; a password is never accepted as a tool argument. Over TLS the credentials are offered in the telnet negotiation (RFC 4777 auto sign-on, which needs the `QRMTSIGN` system value to allow it). Otherwise, or if the host still shows a sign-on screen, the user and password fields of the sign-on screen are filled and Enter is pressed. The result reports `signOn.method` and `signOn.stillOnSignOnScreen`. On plain telnet (port 23) the password travels unencrypted, exactly as with any 5250 emulator; use TLS.
|
|
247
|
+
- **readScreen** returns `text` (one string per row), `cursor`, `keyboardLocked`, `inputInhibited` (an error message is showing; `errorLine` has it), `readPending` and `fields`. Each field has an `id` such as `r6c53` (row 6, column 53), `index`, `row`, `col`, `length`, a `label` taken from the text to its left, `protected`, `hidden`, `modified`, `numeric` and `commandLine` (labelled `===>`). Hidden (non-display, password-style) fields never include their content, only `hasValue`, and their positions are blank in `text`.
|
|
248
|
+
- **setField** fills a field locally by `fieldId` (id, 1-based index, or `"command"` for the command line) or by `row`/`col`. Nothing is sent until an AID key is pressed. `useStoredPassword: true` fills a hidden field with the connection's saved password (for example a re-sign-on prompt).
|
|
249
|
+
- **sendKeys** types `text` at the cursor (optionally after moving it with `cursorRow`/`cursorCol`), then presses `keys`: local keys `Tab`, `BackTab` (`Shift+Tab`), `Home`, `End`, `Reset`, `EraseEOF`, `EraseInput`, `FieldExit`, `Field+`, `Field-`, `Dup`, `Insert` (toggles insert mode, shown as `insertMode`), `Delete`, `Up`, `Down`, `Left` (`Backspace`), `Right` and `NewLine`, and at most one host key, last: `Enter`, `F1`-`F24`, `PageUp`/`PageDown` (Roll Down/Up), `Clear`, `Help`, `Print`, `Attn`, `SysReq`. A local key can be repeated with `*N` (`Down*3`). As in IBM emulators, `Esc` (also `Escape`, `Attention`) is `Attn` and `Shift+Esc` (also `SysRq`) is `SysReq`. Attn runs the job's attention program (the "Esc menu"); if the host sends nothing back within 5 seconds (no attention program), the keyboard is unlocked again and the result has a `note`. `Field+`/`Field-` right-adjust numeric fields (Field- marks the value negative), `Field Exit` right-adjusts fields that ask for it, and `Dup` fills a Dup-enabled field with the DUP character (shown as `*`). After an AID key it waits up to `timeoutMs` for the host to unlock the keyboard and returns the new screen with `settled`. If an error message has inhibited input, `Reset` is pressed automatically (`autoReset: true`).
|
|
250
|
+
- **click** works like an emulator mouse: it moves the cursor to `row`/`col`. A click on a function-key legend such as `F3=Exit` presses that key, and on `More...` presses PageDown (`hotspots: false` turns this off); `doubleClick: true` moves the cursor and presses Enter. Keys pressed by a click go through the same checks as sendKeys.
|
|
251
|
+
- **waitFor** waits for `text` to appear on any row and/or for the keyboard to unlock (`keyboardUnlocked`, default true when no text is given). An input-inhibited error state also counts as unlocked, because the host is waiting for the operator.
|
|
252
|
+
- **Live view**: as soon as a session opens, the MCP server serves a live 5250 page on `127.0.0.1` (port 3981, or the next free port; `tn5250LiveViewPort` sets it, `tn5250LiveView: false` turns it off). Every screen result carries `liveViewUrl`; the link holds a per-process token, so only someone with the link can open it. The page shows the session the agent drives and follows it live, and you can type and click in it like an emulator (Esc = Attn, Shift+Esc = SysReq, Ctrl alone = Reset, a click moves the cursor or presses a key legend, a double click presses Enter). While you type, the agent's setField, sendKeys and click calls are refused for a few seconds with a message asking it to wait and re-read the screen; `readScreen` then shows `personTyping: true` and `lastActor: "person"`. Your own keys skip the approval prompt but keep read-only mode, the read-only profile and deny lists. The control plane's Runtime tab lists the open sessions with an Open link. The screen scales to fill the space (fit to width or height), so the page embeds cleanly in a product at any size, including an iframe. The controls are optional: press the **Controls** button (top right), or add `view=screen` to the link, for a screen-only view that fills the whole area; `keys=0`, `header=0`, `hint=0` and `status=0` hide individual parts, and `chrome=full` forces everything on. The choice is remembered per browser, and a URL param always wins.
|
|
253
|
+
- **In-chat screen (MCP Apps)**: clients that support MCP Apps (`io.modelcontextprotocol/ui`) draw the same screen inside the chat after any 5250 tool call; you can type and click there too, and its key presses go through the 5250 tools, so the approval prompts still apply. Clients without that support see the usual text result and can use `liveViewUrl`.
|
|
254
|
+
- **snapshot** returns `plainText` plus the structured screen. **disconnect** closes the session; `ibmi.disconnect` and `ibmi.session.terminate` close it too.
|
|
255
|
+
- **Write gate**: every AID key goes through the write gate. Read-only connections (`readOnlyMode` or the `read-only` policy) refuse all AID keys, including Enter and `signOn`, so they can only open and read the first screen. When a recognised command line (`===>`) holds text, pressing a data-sending AID key is checked as `cl.run` with that text (command policy, and approval under the default guarded policy); any other AID key is checked as `tn5250.sendKeys` (add it to `requireApprovalFor` to ask the user first).
|
|
256
|
+
- Text typed into hidden fields is replaced by `***REDACTED***` in the server log and the audit record.
|
|
257
|
+
- Supported: TN5250 negotiation (TERMINAL-TYPE, BINARY, EOR, NEW-ENVIRON with DEVNAME, KBDTYPE, CODEPAGE and CHARSET), TLS with certificate pinning, Write To Display (SOH, SBA, SF with field format words, IC/MC, RA, EA, TD), Clear Unit (and Alternate for 27x132), Clear Format Table, Write Error Code, Read Input Fields / Read MDT Fields / Read Immediate / Read Screen, Save/Restore Screen, Roll and the 5250 Query. Text uses one of the single-byte CCSIDs 37, 273, 277, 278, 280, 284, 285, 297, 500, 871, 1047 and 1140-1149; double-byte (DBCS) code pages are not supported. The audit record of each 5250 call keeps the screen's first line, so you can see where a session went. Windows, pull-down menus and other Write To Display Structured Field constructs are skipped (their text still shows where the host writes it as plain data); a warning is listed in `warnings`.
|
|
258
|
+
|
|
259
|
+
## Object, Member and IFS Operations
|
|
260
|
+
- `ibmi.objects.copy` - `CRTDUPOBJ` to `toLibrary` (default: same library) as `newObject` (default: same name); `data=true` adds `DATA(*YES)` for `*FILE`.
|
|
261
|
+
- `ibmi.objects.move` - `MOVOBJ` to `toLibrary`.
|
|
262
|
+
- `ibmi.objects.rename` - `RNMOBJ` to `newObject`.
|
|
263
|
+
- `ibmi.objects.delete` - runs the delete command for the type (`DLTPGM`, `DLTSRVPGM`, `DLTF`, `DLTDTAARA`, ...). `objectType: "*LIB"` deletes the library named in `library` with `DLTLIB` and needs `confirmName` repeating the library name; under guarded the user confirms every library delete (other profiles: `approve=true`).
|
|
264
|
+
- `ibmi.objects.changeDescription` - `CHGOBJD TEXT(...)`; an empty `text` sets `*BLANK`.
|
|
265
|
+
- `ibmi.libraries.copy` - `CPYLIB FROMLIB TOLIB CRTLIB(*YES|*NO) DATA(*YES|*NO)`; `createLibrary` and `data` default to true; `timeoutMs` defaults to 10 minutes.
|
|
266
|
+
- `ibmi.qsys.members.copy` - `CPYSRCF ... MBROPT(*REPLACE)` to `toLibrary`/`toSourceFile`/`toMember` (each defaults to the source value). Refuses an existing target member unless `replace=true`.
|
|
267
|
+
- `ibmi.qsys.members.changeText` - `CHGPFM TEXT(...)`.
|
|
268
|
+
- `ibmi.qsys.members.changeType` - `CHGPFM SRCTYPE(...)`.
|
|
269
|
+
- `ibmi.ifs.copy` - `cp`, or `cp -R` with `recursive=true`.
|
|
270
|
+
- `ibmi.ifs.move` - `mv`.
|
|
271
|
+
|
|
272
|
+
### Object, Member and IFS Operation Notes
|
|
273
|
+
- All of these tools change the system: they are refused in read-only mode and by the read-only policy profile, and ask the user first when the guarded profile lists their operation (`qsys.write`; IFS tools use `ifs.write` or `qsys.write` for the destination, and `ibmi.ifs.move` also `ifs.delete`).
|
|
274
|
+
- Supported object types: `*PGM`, `*SRVPGM`, `*MODULE`, `*FILE`, `*DTAARA`, `*DTAQ`, `*CMD`, `*MSGF`, `*MENU`, `*PNLGRP`, `*BNDDIR`, `*JOBD`, `*OUTQ`, `*USRSPC`, `*USRIDX`, `*USRQ`, `*SQLPKG`, `*QRYDFN`, `*JRN`, `*JRNRCV`, `*SBSD`, `*CLS`, `*TBL` (plus `*LIB` for delete).
|
|
275
|
+
- Names are validated and uppercased; text is limited to 50 characters, quoted for CL, and may not contain control characters.
|
|
276
|
+
- Objects in IBM system libraries (`QSYS*`, `QUSRSYS`, `QRECOVERY`, `QSPL`, `QRPLOBJ`, `QHLPSYS`, `QDOC`, `QSRV`, `SYSIBM`, `SYSIBMADM`, `SYSPROC`, `SYSTOOLS`, `SYSCAT`, `SYSFUN`, `SYSSTAT`, `#*`) are never changed, moved, deleted or copied into. Deleting a library and copying into a library (`CPYLIB` target) also refuse every `Q*` name, including `QGPL` and `QTEMP`.
|
|
277
|
+
- The built CL command is checked against `allowCommands`/`denyCommands`, and every library involved against `allowLibraries`/`denyLibraries`. A failing command returns a tool error with the IBM i message.
|
|
278
|
+
- Member copy and attribute changes drop the cached member snapshot for the affected member.
|
|
279
|
+
- IFS copy/move check both paths against `allowPaths`/`denyPaths`. The destination (and the source of a move or recursive copy) gets the same guard as `ibmi.ifs.delete`: no root, top-level directory, `/QSYS.LIB/<lib>.LIB`, second-level `/QOpenSys` or `/QIBM` directory, IBM product directory, `..` or wildcards. The destination may not equal or sit inside the source. An existing destination is refused unless `overwrite=true`; an existing directory then receives the copied or moved entry inside it.
|
|
280
|
+
|
|
281
|
+
## Bulk Members
|
|
282
|
+
- `ibmi.members.downloadAll`
|
|
283
|
+
- `ibmi.members.uploadChanged`
|
|
284
|
+
|
|
285
|
+
### Bulk Members Notes
|
|
286
|
+
- `downloadAll` copies every member of `sourceFile` (or `sourceFiles`, or every source file in `library` when neither is given) to `localPath/LIB/FILE/MEMBER.ext`. The extension is the lowercased member type (`mbr` when the type is blank). `memberPrefix` and `sourceTypes` narrow the set; `maxMembers` (default 500, max 5000) caps it and the result reports `truncated`.
|
|
287
|
+
- A manifest `.mcp-for-i-members.json` in `localPath` records each member's source type, `version`, `sha256` and last-change timestamp.
|
|
288
|
+
- Re-running `downloadAll` keeps local files edited since the last download (reported in `skipped`) unless `overwrite: true`.
|
|
289
|
+
- `uploadChanged` walks the tree under `localPath` (filter with `library`, `sourceFile`, `members`). Files whose content still matches the manifest are skipped without contacting the IBM i. A member that changed on the IBM i since download, or exists remotely without a manifest entry, is reported in `conflicts` and not written unless `force: true`. Missing members are created with SRCTYPE from the manifest or the file extension (`createMissing`, default true).
|
|
290
|
+
- `uploadChanged` honors the write gate (read-only mode, policy, user confirmation), `denyLibraries`/`allowLibraries` for every library in the tree, and `dryRun`. Written members are dropped from the member snapshot cache and the manifest is updated with their new version.
|
|
291
|
+
- Line endings are normalized to LF before hashing and upload.
|
|
292
|
+
|
|
293
|
+
## Compare
|
|
294
|
+
- `ibmi.compare.text`
|
|
295
|
+
|
|
296
|
+
### Compare Notes
|
|
297
|
+
- Compares any two of: a source member (`{ "type": "member", "library", "sourceFile", "member" }`), an IFS stream file (`{ "type": "ifs", "path" }`) or a local file (`{ "type": "local", "path" }`). Member and IFS sides may name their own `connectionName`, so the same member can be compared across two systems.
|
|
298
|
+
- Returns a unified diff plus `stats` (`hunks`, `added`, `removed`), `identical`, and size/line count/SHA-256 for each side.
|
|
299
|
+
- Options: `context` (default 3), `ignoreTrailingWhitespace` (default true), `ignoreCase` (default false), `maxBytes` per side (default 2 MB, max 16 MB), `maxDiffLines` (default 2000; counts always cover the whole diff and `truncated` says when the text was cut).
|
|
300
|
+
- Members are read through the member snapshot reader: only the source text is compared (no sequence numbers or source dates) and the record padding is trimmed. A missing final newline is not reported as a difference.
|
|
301
|
+
- Local files must be inside the allowed local roots. IFS and local files must be UTF-8 text. Library and IFS path policies are checked for each side.
|
|
302
|
+
|
|
303
|
+
## Inspection
|
|
304
|
+
- `ibmi.objects.describe`
|
|
305
|
+
- `ibmi.members.describe`
|
|
306
|
+
- `ibmi.ifs.stat`
|
|
307
|
+
- `ibmi.programs.info`
|
|
308
|
+
- `ibmi.objects.whereUsed`
|
|
309
|
+
- `ibmi.tables.describe`
|
|
310
|
+
- `ibmi.routines.describe`
|
|
311
|
+
|
|
312
|
+
### Inspection Notes
|
|
313
|
+
- All inspection tools are read-only, cap their queries with `FETCH FIRST`, and upper-case and validate every name.
|
|
314
|
+
- `ibmi.objects.describe` reads `QSYS2.OBJECT_STATISTICS` (owner, size, text, attribute, created/changed/last-used/save dates and source file information when recorded). `objectType` defaults to `*ALL`. If the system rejects the `OBJECT_NAME` argument, the library listing is filtered by name instead. `attributes` holds every non-empty column the service returned.
|
|
315
|
+
- `ibmi.members.describe` reads `QSYS2.SYSPARTITIONSTAT` (source type, text, records, data size, created/changed/source-changed/last-used dates) plus the record length and the `SRCDTA` CCSID.
|
|
316
|
+
- `ibmi.ifs.stat` reads `QSYS2.IFS_OBJECT_STATISTICS` (type, CCSID, owner, size, dates). On releases without that service it falls back to `ls -ldL` (no CCSID) and adds a warning.
|
|
317
|
+
- `ibmi.programs.info` reads `QSYS2.PROGRAM_INFO` for a `*PGM` or `*SRVPGM` (program type, activation group, adopted authority, source location, target release), bound modules from `QSYS2.BOUND_MODULE_INFO`, bound service programs from `QSYS2.BOUND_SRVPGM_INFO`, and exports/imports from `QSYS2.PROGRAM_EXPORT_IMPORT_INFO`. For a service program it returns `binderSource` (`STRPGMEXP PGMLVL(*CURRENT) SIGNATURE(*GEN)` with one `EXPORT` per exported symbol). Check the export order against `DSPSRVPGM DETAIL(*SIGNATURE)` before binding with it. Missing optional services become `warnings`.
|
|
318
|
+
- `ibmi.objects.whereUsed` runs `DSPPGMREF` into a uniquely named QTEMP outfile and reads it in the same SQL job. `direction: "uses"` lists what a program references (`library`, `program`, optional `programType`). `direction: "usedBy"` scans every program, service program and module in `library` and returns the references to `object` (optional `objectLibrary`, which also matches `*LIBL` references, and `objectType`), plus a de-duplicated `programs` list. Scanning a large library can take a while.
|
|
319
|
+
- `ibmi.tables.describe` accepts system or SQL names and returns the table row from `QSYS2.SYSTABLES`, columns from `QSYS2.SYSCOLUMNS`, constraints with key columns (`SYSCST`/`SYSKEYCST`) and SQL indexes with their keys (`SYSINDEXES`/`SYSKEYS`). Keys of DDS keyed files and logical files are not included.
|
|
320
|
+
- `ibmi.routines.describe` returns every overload from `QSYS2.SYSROUTINES` with parameters from `QSYS2.SYSPARMS` and a readable `signature`. `includeDefinition` adds the SQL routine body (capped at 64 KB).
|
|
321
|
+
|
|
322
|
+
## Compile and errors
|
|
323
|
+
- `ibmi.actions.run` (compile against a member or streamfile)
|
|
324
|
+
- `ibmi.compile.listing`
|
|
325
|
+
- `ibmi.diagnostics.parseEvfevent`
|
|
326
|
+
|
|
327
|
+
### Compile Notes
|
|
328
|
+
- Member targets: pass `targetType: "member"` and `targetPath: "LIB/FILE/MEMBER[.TYPE]"` (or `library`, `sourceFile`, `member`). The action gets `&OPENLIB`, `&OPENSPF`, `&OPENMBR` (and lowercase `&OPENLIBL`, `&OPENSPFL`, `&OPENMBRL`), `&EXT` (member type, looked up when not given), `&EXTL`, `&NAME`, `&NAMEL`, `&BASENAME`, `&SRCFILE` (`LIB/FILE`), `&SRCLIB`, `&SRCPF`.
|
|
329
|
+
- Streamfile targets: `targetPath` is an absolute IFS path. The action gets `&FULLPATH`, `&RELATIVEPATH` (relative to the working directory), `&FILEDIR`, `&PARENT`, `&BASENAME`, `&NAME`, `&NAMEL`, `&EXT`, `&EXTL`. The working directory is `cwd`, else `remoteWorkspace`, else the home directory.
|
|
330
|
+
- Built-in actions are typed `member` or `streamfile`; running one against the other kind of target is refused, and so is any command that still contains a target variable the target did not set (for example `&RELATIVEPATH` on a member).
|
|
331
|
+
- Longer variable names are substituted first and a name only matches as a whole word, so `&EXT` does not corrupt `&EXTL`.
|
|
332
|
+
- When the command uses `OPTION(*EVENTF)`, the EVFEVENT member is read from the library and name of the object the command creates (`PGM(`, `MODULE(`, `OBJ(`, `SRVPGM(`, `CMD(`, `FILE(` ...; `*CURLIB`/`*LIBL` resolve to the current library). Override with `evfeventLibrary` / `evfeventMember`. The result has `errors` (grouped by source file, each with `line`, `column`, `endLine`, `endColumn`, `severity`, `severityLevel`, `msgid`, `text`) and `errorSummary`.
|
|
333
|
+
- `deployFirst`: with `localWorkspace` and `remoteWorkspace`, the workspace is pushed with `ibmi.deploy.sync` (`overwrite: true`) before the command runs. Without a local workspace the deploy is reported as skipped.
|
|
334
|
+
- `postDownload`: listed paths (relative to the working directory, or absolute) are downloaded to `downloadTo` (default `localWorkspace`). Downloaded `.evfevent` files are parsed and merged into `errors`.
|
|
335
|
+
- `outputToFile`: the command, exit code, stdout and stderr are written to this local path. `&LOCAL` or a relative path resolves against `localWorkspace`.
|
|
336
|
+
- `includeListing: true` returns the compile listing: the newest spooled file named after the object (else `QSYSPRT`, else `QPJOBLOG`) owned by the user and created since the command started.
|
|
337
|
+
- A failed command is returned as a tool error that names the first EVFEVENT error.
|
|
338
|
+
- `ibmi.compile.listing` (read-only) fetches the same listing on its own: `objectName`, optional `userName`, `since` (IBM i timestamp) and `maxLines`.
|
|
339
|
+
- `ibmi.diagnostics.parseEvfevent` parses EVFEVENT text (TIMESTAMP, PROCESSOR, FILEID, FILEEND, EXPANSION, ERROR records). Errors that the compiler reports against a temporary file such as `QTEMP/QSQLTEMP1` are mapped back to the original source line through the precompiler's EXPANSION records.
|
|
340
|
+
|
|
341
|
+
## System Information
|
|
342
|
+
- `ibmi.system.info` (read-only)
|
|
343
|
+
|
|
344
|
+
Returns, in one call:
|
|
345
|
+
- `os`: release (from `SYSIBMADM.ENV_SYS_INFO`), host name, CPUs, memory, plus partition and ASP figures from `QSYS2.SYSTEM_STATUS_INFO`.
|
|
346
|
+
- `ptfGroups`: one row per PTF group from `QSYS2.GROUP_PTF_INFO` with the latest level known, its status and the latest installed level. Capped by `ptfGroupLimit` (default 100, max 1000) with `truncated`.
|
|
347
|
+
- `authorities`: the current user's class, special authorities, group profiles and limited capabilities from `QSYS2.USER_INFO`.
|
|
348
|
+
- `systemValues`: an allow-listed set of system values from `QSYS2.SYSTEM_VALUE_INFO` (security, national language, date/time, library list, model). `systemValues` picks a subset; names outside the allow-list are rejected.
|
|
349
|
+
- `pase` and `tools`: `uname`, a few environment variables (PATH, HOME, SHELL, LANG, LC_ALL, TZ, QIBM_CCSID, QIBM_PASE_CCSID) and where pfgrep, openssl, git, bash, python3, node, java and mapepire-server are installed, gathered by one PASE command (`command -v`, then `/QOpenSys/pkgs/bin`).
|
|
350
|
+
|
|
351
|
+
Pick parts with `sections` (`os`, `ptfGroups`, `authorities`, `systemValues`, `pase`, `tools`). A section that fails is reported under `errors` and the others are still returned.
|
|
352
|
+
|
|
353
|
+
## Search by Change Date
|
|
354
|
+
- `ibmi.search.changedLines` (read-only)
|
|
355
|
+
|
|
356
|
+
Finds source lines whose `SRCDAT` falls between `from` and `to` (inclusive, `YYYY-MM-DD`; `to` defaults to today). `member` is a member name or a generic name with `*` (`ORD*`, `*ALL`, the default); `memberType` narrows a generic search. Each hit has the member, line number, sequence number, date and text.
|
|
357
|
+
|
|
358
|
+
- `SRCDAT` stores `YYMMDD`. Years 40-99 are read as 1940-1999 and 00-39 as 2000-2039 (the IBM i two-digit year window). Lines with no date are never returned.
|
|
359
|
+
- Each member is read with a `QTEMP` alias created in the same SQL job as the query.
|
|
360
|
+
- `maxLines` (default 500, max 5000) and `maxMembers` (default 50, max 500) cap the work; `truncated` and `truncatedReason` say when either was hit. For a generic search, a member that cannot be read is listed under `errors`.
|
|
361
|
+
|
|
362
|
+
## Library List Tidying
|
|
363
|
+
- `ibmi.libl.move`: move a library to a 1-based `position`, or `direction` `up`/`down` by `steps` (default 1), or `top`/`bottom`.
|
|
364
|
+
- `ibmi.libl.prune`: remove libraries that no longer exist (checked with `QSYS2.OBJECT_STATISTICS`). `dryRun` only reports. A missing current library is reported, not changed.
|
|
365
|
+
- `ibmi.libl.runProfileCommand`: run a profile's `setLibraryListCommand` (the active profile by default, or `profileName`) and store the user library list and current library it produces, read back from `QSYS2.LIBRARY_LIST_INFO` in the same SQL job. `saveToProfile` also stores the result in the profile. Set the command with `ibmi.profiles.save` (`profile.setLibraryListCommand`). The command is checked against the CL command policy.
|
|
366
|
+
|
|
367
|
+
All three update the stored connection settings the same way `ibmi.libl.set` does, need a writable connection, ask the user first under guarded policies, and run `CHGLIBL`/`CHGCURLIB` when `applyToJob` is true.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-for-i",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local MCP server and control plane for IBM i workflows",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"start:controlplane": "node dist/controlplane/index.js",
|
|
29
29
|
"dev": "ts-node src/index.ts",
|
|
30
30
|
"dev:controlplane": "ts-node src/controlplane/index.ts",
|
|
31
|
-
"test": "npm run build && node
|
|
31
|
+
"test": "npm run build && node scripts/run-unit-tests.mjs",
|
|
32
32
|
"test:all": "npm run build && node --test test/*.mjs",
|
|
33
33
|
"test:ibmi": "npm run build && node --test test/ibmi.integration.test.mjs",
|
|
34
34
|
"test:mcp": "npm run build && node --test test/mcp.integration.test.mjs",
|
|
@@ -38,14 +38,17 @@
|
|
|
38
38
|
"release:major": "node scripts/release-auto.mjs major"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@ibm/mapepire-js": "^1.0.1",
|
|
41
42
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
42
43
|
"diff": "^5.2.0",
|
|
43
44
|
"keytar": "^7.9.0",
|
|
44
45
|
"node-ssh": "^13.1.0",
|
|
46
|
+
"ws": "^8.22.0",
|
|
45
47
|
"zod-to-json-schema": "^3.23.2"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@types/diff": "^7.0.2",
|
|
51
|
+
"@types/ws": "^8.18.2",
|
|
49
52
|
"dotenv": "^17.2.3",
|
|
50
53
|
"ts-node": "^10.9.0",
|
|
51
54
|
"typescript": "^5.4.0"
|