mcp-for-i 0.2.0 → 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.
@@ -1,263 +1,264 @@
1
- # MCP-for-i Capabilities (Current)
2
-
3
- This document summarizes what `mcp-for-i` can do today across the MCP server and local control-plane workflow.
4
-
5
- Version context: `0.2.0`.
6
-
7
- ## 1) Platform Capabilities
8
-
9
- ### 1.1 Secure Onboarding and Connection Management
10
- - Local control plane for adding/updating/deleting saved IBM i connections.
11
- - Credential handling via OS keychain flow (no plaintext password arguments in MCP connection tools).
12
- - Connection policies per profile (`read-only`, `guarded`, `power-user`).
13
- - Connection profiles for per-user/per-context library and variable settings.
14
-
15
- ### 1.2 Runtime Safety and Policy Guardrails
16
- - Strict tool input schemas (`additionalProperties: false`) with runtime validation.
17
- - Guarded approval model: the user confirms sensitive operations in the MCP client.
18
- - Read-only mode enforcement.
19
- - Validation for critical identifiers (QSYS names, journaling object names, etc.).
20
-
21
- ### 1.3 Session Lifecycle
22
- - Multi-session tracking.
23
- - Session status/list/keepalive/terminate operations.
24
- - One-call session bootstrap with release, library-list, policy, transports, and supported fast-path capabilities.
25
- - Sliding inactivity timeout.
26
- - Heartbeat and reconnect behavior.
27
- - Persistent SQL job per connection (Mapepire, when installed on the IBM i): SQL, SQL-run CL, library list changes and the job log share one job across calls; falls back to a new QZDFMDB2 job per call when Mapepire is not available. Timed-out statements are cancelled on the IBM i. See [configuration](configuration.md#persistent-sql-job-mapepire) for `sqlTransport` and how to install Mapepire.
28
-
29
- ### 1.4 Agent-Safe Structured Results
30
- - Tool responses expose structured payloads for automation.
31
- - SQL/CL/diagnostic outputs normalized where applicable.
32
- - TN5250 screens are returned as text rows plus machine-readable fields (position, label, protected/hidden flags); hidden field contents are never returned.
33
-
34
- ### 1.5 Auditing and Compliance Foundations
35
- - Tamper-evident hash-chain audit record for tool calls.
36
- - Audit verification, export, and retention purge controls.
37
- - Compliance report generation with optional signed evidence bundle.
38
-
39
- ### 1.6 IBM i Operations Control (Phase 7)
40
- - Spool lifecycle controls (hold/release/delete/move by job/file/number).
41
- - Job lifecycle controls (list/hold/release/end).
42
- - Subsystem lifecycle controls (list/status/start/end).
43
- - Message queue operations (read/send/reply).
44
- - Preflight operational visibility (lock contention + object authority lookup).
45
- - Data queue and data area operations for integration and runbook workflows.
46
-
47
- ## 2) Complete MCP Tool Catalog
48
-
49
- ### Connection and Session
50
- - `ibmi.connect`
51
- - `ibmi.disconnect`
52
- - `ibmi.session.list`
53
- - `ibmi.session.status`
54
- - `ibmi.session.keepalive`
55
- - `ibmi.session.terminate`
56
- - `ibmi.session.bootstrap`
57
- - `ibmi.connections.list`
58
- - `ibmi.connections.add`
59
- - `ibmi.connections.update`
60
- - `ibmi.connections.delete`
61
-
62
- ### QSYS and Source Management
63
- - `ibmi.qsys.libraries.list`
64
- - `ibmi.qsys.objects.list`
65
- - `ibmi.qsys.sourcefiles.list`
66
- - `ibmi.qsys.members.list`
67
- - `ibmi.qsys.members.read`
68
- - `ibmi.qsys.members.write`
69
- - `ibmi.qsys.members.create`
70
- - `ibmi.qsys.members.rename`
71
- - `ibmi.qsys.members.delete`
72
- - `ibmi.qsys.members.copy`
73
- - `ibmi.qsys.members.changeText`
74
- - `ibmi.qsys.members.changeType`
75
- - `ibmi.qsys.sourcefiles.create`
76
- - `ibmi.qsys.libraries.create`
77
- - `ibmi.objects.copy`, `ibmi.objects.move`, `ibmi.objects.rename`, `ibmi.objects.delete`, `ibmi.objects.changeDescription`
78
- - `ibmi.libraries.copy`
79
- - Legacy-compatible member list/read responses plus opt-in filtered paging, ranged reads, metadata, version/hash checks, caching, and complete fallback reads.
80
-
81
- ### IFS Operations
82
- - `ibmi.ifs.list`
83
- - `ibmi.ifs.read`
84
- - `ibmi.ifs.write`
85
- - `ibmi.ifs.mkdir`
86
- - `ibmi.ifs.delete`
87
- - `ibmi.ifs.copy`
88
- - `ibmi.ifs.move`
89
- - `ibmi.ifs.upload`
90
- - `ibmi.ifs.download`
91
-
92
- ### Search and Resolution
93
- - `ibmi.search.members`
94
- - `ibmi.source.resolve`
95
- - `ibmi.source.inspect`
96
- - `ibmi.search.ifs`
97
- - `ibmi.find.ifs`
98
- - `ibmi.search.changedLines`
99
- - `ibmi.resolve.path`
100
-
101
- ### System Information
102
- - `ibmi.system.info`
103
-
104
- ### Official IBM i Documentation
105
- - `ibmi.docs.search`
106
- - `ibmi.docs.open` (any `https://www.ibm.com/docs/` page)
107
- - MCP resources at `ibmi-docs://catalog` and `ibmi-docs://topic/{ref}`
108
-
109
- ### Actions, Filters, Profiles, Library List
110
- - `ibmi.actions.list`
111
- - `ibmi.actions.run` (compiles members or streamfiles and returns EVFEVENT errors by file; see docs/tools.md "Compile and errors")
112
- - `ibmi.actions.save`
113
- - `ibmi.actions.delete`
114
- - `ibmi.filters.list`
115
- - `ibmi.filters.save`
116
- - `ibmi.filters.delete`
117
- - `ibmi.profiles.list`
118
- - `ibmi.profiles.save`
119
- - `ibmi.profiles.delete`
120
- - `ibmi.profiles.activate`
121
- - `ibmi.libl.get`
122
- - `ibmi.libl.set`
123
- - `ibmi.libl.add`
124
- - `ibmi.libl.remove`
125
- - `ibmi.libl.setCurrent`
126
- - `ibmi.libl.validate`
127
- - `ibmi.libl.move`
128
- - `ibmi.libl.prune`
129
- - `ibmi.libl.runProfileCommand`
130
- - `ibmi.ifs.shortcuts.list`
131
- - `ibmi.ifs.shortcuts.add`
132
- - `ibmi.ifs.shortcuts.delete`
133
-
134
- ### Compare and Inspection
135
- - `ibmi.compare.text`
136
- - `ibmi.objects.describe`
137
- - `ibmi.members.describe`
138
- - `ibmi.ifs.stat`
139
- - `ibmi.programs.info`
140
- - `ibmi.objects.whereUsed`
141
- - `ibmi.tables.describe`
142
- - `ibmi.routines.describe`
143
-
144
- ### Deploy and File Sync
145
- - `ibmi.deploy.compare`
146
- - `ibmi.deploy.sync`
147
- - `ibmi.deploy.uploadDirectory`
148
- - `ibmi.deploy.uploadFiles`
149
- - `ibmi.deploy.setCcsid`
150
- - `ibmi.deploy.sync` methods: `all`, `changed` (SHA-256), `gitChanged`, `selection`
151
-
152
- ### Bulk Source Members
153
- - `ibmi.members.downloadAll`
154
- - `ibmi.members.uploadChanged`
155
-
156
- ### SQL, CL, Diagnostics, Spool, Debug
157
- - `ibmi.sql.query`
158
- - `ibmi.sql.execute`
159
- - `ibmi.cl.run`
160
- - `ibmi.diagnostics.parseEvfevent`
161
- - `ibmi.compile.listing`
162
- - `ibmi.joblog.get`
163
- - `ibmi.spool.list`
164
- - `ibmi.spool.read`
165
- - `ibmi.spool.hold`
166
- - `ibmi.spool.release`
167
- - `ibmi.spool.delete`
168
- - `ibmi.spool.move`
169
- - `ibmi.jobs.list`
170
- - `ibmi.jobs.hold`
171
- - `ibmi.jobs.release`
172
- - `ibmi.jobs.end`
173
- - `ibmi.subsystems.list`
174
- - `ibmi.subsystems.status`
175
- - `ibmi.subsystems.start`
176
- - `ibmi.subsystems.end`
177
- - `ibmi.msgq.read`
178
- - `ibmi.msgq.send`
179
- - `ibmi.msgq.reply`
180
- - `ibmi.locks.list`
181
- - `ibmi.authority.object.get`
182
- - `ibmi.dataqueue.send`
183
- - `ibmi.dataqueue.receive`
184
- - `ibmi.dataarea.read`
185
- - `ibmi.dataarea.write`
186
- - `ibmi.debug.status`
187
- - `ibmi.debug.startService`
188
- - `ibmi.debug.stopService`
189
-
190
- ### Audit and Compliance
191
- - `ibmi.audit.list`
192
- - `ibmi.audit.verify`
193
- - `ibmi.audit.export`
194
- - `ibmi.audit.purge`
195
- - `ibmi.compliance.report.generate`
196
-
197
- ### Journaling
198
- - `ibmi.journal.objects.list`
199
- - `ibmi.journal.entries.query`
200
- - `ibmi.qaudjrn.events.query`
201
- - `ibmi.journal.receiver.create`
202
- - `ibmi.journal.create`
203
- - `ibmi.journal.receiver.change`
204
- - `ibmi.journal.startPf`
205
- - `ibmi.journal.endPf`
206
- - `ibmi.journal.startIfs`
207
- - `ibmi.journal.endIfs`
208
- - `ibmi.journal.receivers.retention`
209
-
210
- ### TN5250 (5250 green-screen sessions)
211
- A real TN5250 client: connects to the saved connection's host on port 23 (or 992 with TLS), reads the actual screen and fields, fills fields and presses keys (Enter, F1-F24, PageUp/PageDown, Clear, Help, Attn, SysReq). Optional sign-on uses the stored credentials. AID keys go through the write gate: read-only connections cannot press them, and text on a `===>` command line is checked against the command policy. See [tools](tools.md#tn5250-notes) for details and limits.
212
-
213
- - `ibmi.tn5250.connect`
214
- - `ibmi.tn5250.readScreen`
215
- - `ibmi.tn5250.setField`
216
- - `ibmi.tn5250.sendKeys`
217
- - `ibmi.tn5250.waitFor`
218
- - `ibmi.tn5250.snapshot`
219
- - `ibmi.tn5250.disconnect`
220
-
221
- ## 3) High-Value Behaviors Users Often Miss
222
-
223
- ### 3.1 Guarded Approvals
224
- - In guarded policy, risky operations wait for the user to confirm them in the MCP client; the agent cannot approve them itself.
225
- - With `approvalMode: "agent"` (for clients without prompts), `approve=true` from the agent is accepted instead.
226
-
227
- ### 3.2 Audit Data Lifecycle
228
- - Verify chain integrity with `ibmi.audit.verify`.
229
- - Export evidence using `ibmi.audit.export` (`jsonl`, `json`, `csv`).
230
- - Use `ibmi.audit.purge` for retention cleanup (`dryRun` supported).
231
-
232
- ### 3.3 Journaling and QAUDJRN
233
- - PF and IFS journaling lifecycle operations are supported.
234
- - `ibmi.journal.entries.query` supports advanced filters (`journalCode`, `entryType`, `userName`, `jobName`, `programName`).
235
- - `ibmi.qaudjrn.events.query` provides normalized QAUDJRN security/compliance event access.
236
-
237
- ### 3.4 Compliance Report Bundles
238
- - `ibmi.compliance.report.generate` can return in-memory report payload or write to `outputPath`.
239
- - Optional signing creates:
240
- - `<outputPath>.sig`
241
- - `<outputPath>.sha256`
242
-
243
- ## 4) Useful Local Paths and Env Knobs
244
-
245
- ### 4.1 Config and Audit Storage
246
- - Config base directory: from local MCP-for-i config store (`~/.mcp-for-i` on typical setups).
247
- - Default audit log path:
248
- - `<configDir>/audit/tool-audit.jsonl`
249
-
250
- ### 4.2 Audit Environment Variables
251
- - `MCP_FOR_I_AUDIT_ENABLED=0` disables audit append.
252
- - `MCP_FOR_I_AUDIT_LOG_PATH=<path>` overrides default audit file location.
253
-
254
- ### 4.3 Logging Environment Variables
255
- - `MCP_FOR_I_LOG_ENABLED`
256
- - `MCP_FOR_I_LOG_LEVEL`
257
- - `MCP_FOR_I_LOG`
258
- - `MCP_FOR_I_LOG_STDERR`
259
-
260
- ## 5) Current Scope Boundary
261
-
262
- Implemented through Phase 7.
263
- Next roadmap items begin at Phase 8 (reliability/recovery/change assurance), then autonomy/distribution phases.
1
+ # MCP-for-i Capabilities (Current)
2
+
3
+ This document summarizes what `mcp-for-i` can do today across the MCP server and local control-plane workflow.
4
+
5
+ Version context: `0.2.0`.
6
+
7
+ ## 1) Platform Capabilities
8
+
9
+ ### 1.1 Secure Onboarding and Connection Management
10
+ - Local control plane for adding/updating/deleting saved IBM i connections.
11
+ - Credential handling via OS keychain flow (no plaintext password arguments in MCP connection tools).
12
+ - Connection policies per profile (`read-only`, `guarded`, `power-user`).
13
+ - Connection profiles for per-user/per-context library and variable settings.
14
+
15
+ ### 1.2 Runtime Safety and Policy Guardrails
16
+ - Strict tool input schemas (`additionalProperties: false`) with runtime validation.
17
+ - Guarded approval model: the user confirms sensitive operations in the MCP client.
18
+ - Read-only mode enforcement.
19
+ - Validation for critical identifiers (QSYS names, journaling object names, etc.).
20
+
21
+ ### 1.3 Session Lifecycle
22
+ - Multi-session tracking.
23
+ - Session status/list/keepalive/terminate operations.
24
+ - One-call session bootstrap with release, library-list, policy, transports, and supported fast-path capabilities.
25
+ - Sliding inactivity timeout.
26
+ - Heartbeat and reconnect behavior.
27
+ - Persistent SQL job per connection (Mapepire, when installed on the IBM i): SQL, SQL-run CL, library list changes and the job log share one job across calls; falls back to a new QZDFMDB2 job per call when Mapepire is not available. Timed-out statements are cancelled on the IBM i. See [configuration](configuration.md#persistent-sql-job-mapepire) for `sqlTransport` and how to install Mapepire.
28
+
29
+ ### 1.4 Agent-Safe Structured Results
30
+ - Tool responses expose structured payloads for automation.
31
+ - SQL/CL/diagnostic outputs normalized where applicable.
32
+ - TN5250 screens are returned as text rows plus machine-readable fields (position, label, protected/hidden flags); hidden field contents are never returned.
33
+
34
+ ### 1.5 Auditing and Compliance Foundations
35
+ - Tamper-evident hash-chain audit record for tool calls.
36
+ - Audit verification, export, and retention purge controls.
37
+ - Compliance report generation with optional signed evidence bundle.
38
+
39
+ ### 1.6 IBM i Operations Control (Phase 7)
40
+ - Spool lifecycle controls (hold/release/delete/move by job/file/number).
41
+ - Job lifecycle controls (list/hold/release/end).
42
+ - Subsystem lifecycle controls (list/status/start/end).
43
+ - Message queue operations (read/send/reply).
44
+ - Preflight operational visibility (lock contention + object authority lookup).
45
+ - Data queue and data area operations for integration and runbook workflows.
46
+
47
+ ## 2) Complete MCP Tool Catalog
48
+
49
+ ### Connection and Session
50
+ - `ibmi.connect`
51
+ - `ibmi.disconnect`
52
+ - `ibmi.session.list`
53
+ - `ibmi.session.status`
54
+ - `ibmi.session.keepalive`
55
+ - `ibmi.session.terminate`
56
+ - `ibmi.session.bootstrap`
57
+ - `ibmi.connections.list`
58
+ - `ibmi.connections.add`
59
+ - `ibmi.connections.update`
60
+ - `ibmi.connections.delete`
61
+
62
+ ### QSYS and Source Management
63
+ - `ibmi.qsys.libraries.list`
64
+ - `ibmi.qsys.objects.list`
65
+ - `ibmi.qsys.sourcefiles.list`
66
+ - `ibmi.qsys.members.list`
67
+ - `ibmi.qsys.members.read`
68
+ - `ibmi.qsys.members.write`
69
+ - `ibmi.qsys.members.create`
70
+ - `ibmi.qsys.members.rename`
71
+ - `ibmi.qsys.members.delete`
72
+ - `ibmi.qsys.members.copy`
73
+ - `ibmi.qsys.members.changeText`
74
+ - `ibmi.qsys.members.changeType`
75
+ - `ibmi.qsys.sourcefiles.create`
76
+ - `ibmi.qsys.libraries.create`
77
+ - `ibmi.objects.copy`, `ibmi.objects.move`, `ibmi.objects.rename`, `ibmi.objects.delete`, `ibmi.objects.changeDescription`
78
+ - `ibmi.libraries.copy`
79
+ - Legacy-compatible member list/read responses plus opt-in filtered paging, ranged reads, metadata, version/hash checks, caching, and complete fallback reads.
80
+
81
+ ### IFS Operations
82
+ - `ibmi.ifs.list`
83
+ - `ibmi.ifs.read`
84
+ - `ibmi.ifs.write`
85
+ - `ibmi.ifs.mkdir`
86
+ - `ibmi.ifs.delete`
87
+ - `ibmi.ifs.copy`
88
+ - `ibmi.ifs.move`
89
+ - `ibmi.ifs.upload`
90
+ - `ibmi.ifs.download`
91
+
92
+ ### Search and Resolution
93
+ - `ibmi.search.members`
94
+ - `ibmi.source.resolve`
95
+ - `ibmi.source.inspect`
96
+ - `ibmi.search.ifs`
97
+ - `ibmi.find.ifs`
98
+ - `ibmi.search.changedLines`
99
+ - `ibmi.resolve.path`
100
+
101
+ ### System Information
102
+ - `ibmi.system.info`
103
+
104
+ ### Official IBM i Documentation
105
+ - `ibmi.docs.search`
106
+ - `ibmi.docs.open` (any `https://www.ibm.com/docs/` page)
107
+ - MCP resources at `ibmi-docs://catalog` and `ibmi-docs://topic/{ref}`
108
+
109
+ ### Actions, Filters, Profiles, Library List
110
+ - `ibmi.actions.list`
111
+ - `ibmi.actions.run` (compiles members or streamfiles and returns EVFEVENT errors by file; see docs/tools.md "Compile and errors")
112
+ - `ibmi.actions.save`
113
+ - `ibmi.actions.delete`
114
+ - `ibmi.filters.list`
115
+ - `ibmi.filters.save`
116
+ - `ibmi.filters.delete`
117
+ - `ibmi.profiles.list`
118
+ - `ibmi.profiles.save`
119
+ - `ibmi.profiles.delete`
120
+ - `ibmi.profiles.activate`
121
+ - `ibmi.libl.get`
122
+ - `ibmi.libl.set`
123
+ - `ibmi.libl.add`
124
+ - `ibmi.libl.remove`
125
+ - `ibmi.libl.setCurrent`
126
+ - `ibmi.libl.validate`
127
+ - `ibmi.libl.move`
128
+ - `ibmi.libl.prune`
129
+ - `ibmi.libl.runProfileCommand`
130
+ - `ibmi.ifs.shortcuts.list`
131
+ - `ibmi.ifs.shortcuts.add`
132
+ - `ibmi.ifs.shortcuts.delete`
133
+
134
+ ### Compare and Inspection
135
+ - `ibmi.compare.text`
136
+ - `ibmi.objects.describe`
137
+ - `ibmi.members.describe`
138
+ - `ibmi.ifs.stat`
139
+ - `ibmi.programs.info`
140
+ - `ibmi.objects.whereUsed`
141
+ - `ibmi.tables.describe`
142
+ - `ibmi.routines.describe`
143
+
144
+ ### Deploy and File Sync
145
+ - `ibmi.deploy.compare`
146
+ - `ibmi.deploy.sync`
147
+ - `ibmi.deploy.uploadDirectory`
148
+ - `ibmi.deploy.uploadFiles`
149
+ - `ibmi.deploy.setCcsid`
150
+ - `ibmi.deploy.sync` methods: `all`, `changed` (SHA-256), `gitChanged`, `selection`
151
+
152
+ ### Bulk Source Members
153
+ - `ibmi.members.downloadAll`
154
+ - `ibmi.members.uploadChanged`
155
+
156
+ ### SQL, CL, Diagnostics, Spool, Debug
157
+ - `ibmi.sql.query`
158
+ - `ibmi.sql.execute`
159
+ - `ibmi.cl.run`
160
+ - `ibmi.diagnostics.parseEvfevent`
161
+ - `ibmi.compile.listing`
162
+ - `ibmi.joblog.get`
163
+ - `ibmi.spool.list`
164
+ - `ibmi.spool.read`
165
+ - `ibmi.spool.hold`
166
+ - `ibmi.spool.release`
167
+ - `ibmi.spool.delete`
168
+ - `ibmi.spool.move`
169
+ - `ibmi.jobs.list`
170
+ - `ibmi.jobs.hold`
171
+ - `ibmi.jobs.release`
172
+ - `ibmi.jobs.end`
173
+ - `ibmi.subsystems.list`
174
+ - `ibmi.subsystems.status`
175
+ - `ibmi.subsystems.start`
176
+ - `ibmi.subsystems.end`
177
+ - `ibmi.msgq.read`
178
+ - `ibmi.msgq.send`
179
+ - `ibmi.msgq.reply`
180
+ - `ibmi.locks.list`
181
+ - `ibmi.authority.object.get`
182
+ - `ibmi.dataqueue.send`
183
+ - `ibmi.dataqueue.receive`
184
+ - `ibmi.dataarea.read`
185
+ - `ibmi.dataarea.write`
186
+ - `ibmi.debug.status`
187
+ - `ibmi.debug.startService`
188
+ - `ibmi.debug.stopService`
189
+
190
+ ### Audit and Compliance
191
+ - `ibmi.audit.list`
192
+ - `ibmi.audit.verify`
193
+ - `ibmi.audit.export`
194
+ - `ibmi.audit.purge`
195
+ - `ibmi.compliance.report.generate`
196
+
197
+ ### Journaling
198
+ - `ibmi.journal.objects.list`
199
+ - `ibmi.journal.entries.query`
200
+ - `ibmi.qaudjrn.events.query`
201
+ - `ibmi.journal.receiver.create`
202
+ - `ibmi.journal.create`
203
+ - `ibmi.journal.receiver.change`
204
+ - `ibmi.journal.startPf`
205
+ - `ibmi.journal.endPf`
206
+ - `ibmi.journal.startIfs`
207
+ - `ibmi.journal.endIfs`
208
+ - `ibmi.journal.receivers.retention`
209
+
210
+ ### TN5250 (5250 green-screen sessions)
211
+ A real TN5250 client: connects to the saved connection's host on port 23 (or 992 with TLS), reads the actual screen and fields, fills fields and presses keys (Enter, F1-F24, PageUp/PageDown, Clear, Help, Attn/Esc, SysReq/Shift+Esc, plus local keys such as Field+/-, Dup, Insert and the arrows) and clicks like an emulator mouse. Supports 21 single-byte code pages. A live view on localhost (and an in-chat screen in MCP Apps clients) shows the session the agent drives, and the person can type and click in it at the same time. Optional sign-on uses the stored credentials. AID keys go through the write gate: read-only connections cannot press them, and text on a `===>` command line is checked against the command policy. See [tools](tools.md#tn5250-notes) for details and limits.
212
+
213
+ - `ibmi.tn5250.connect`
214
+ - `ibmi.tn5250.readScreen`
215
+ - `ibmi.tn5250.setField`
216
+ - `ibmi.tn5250.sendKeys`
217
+ - `ibmi.tn5250.click`
218
+ - `ibmi.tn5250.waitFor`
219
+ - `ibmi.tn5250.snapshot`
220
+ - `ibmi.tn5250.disconnect`
221
+
222
+ ## 3) High-Value Behaviors Users Often Miss
223
+
224
+ ### 3.1 Guarded Approvals
225
+ - In guarded policy, risky operations wait for the user to confirm them in the MCP client; the agent cannot approve them itself.
226
+ - With `approvalMode: "agent"` (for clients without prompts), `approve=true` from the agent is accepted instead.
227
+
228
+ ### 3.2 Audit Data Lifecycle
229
+ - Verify chain integrity with `ibmi.audit.verify`.
230
+ - Export evidence using `ibmi.audit.export` (`jsonl`, `json`, `csv`).
231
+ - Use `ibmi.audit.purge` for retention cleanup (`dryRun` supported).
232
+
233
+ ### 3.3 Journaling and QAUDJRN
234
+ - PF and IFS journaling lifecycle operations are supported.
235
+ - `ibmi.journal.entries.query` supports advanced filters (`journalCode`, `entryType`, `userName`, `jobName`, `programName`).
236
+ - `ibmi.qaudjrn.events.query` provides normalized QAUDJRN security/compliance event access.
237
+
238
+ ### 3.4 Compliance Report Bundles
239
+ - `ibmi.compliance.report.generate` can return in-memory report payload or write to `outputPath`.
240
+ - Optional signing creates:
241
+ - `<outputPath>.sig`
242
+ - `<outputPath>.sha256`
243
+
244
+ ## 4) Useful Local Paths and Env Knobs
245
+
246
+ ### 4.1 Config and Audit Storage
247
+ - Config base directory: from local MCP-for-i config store (`~/.mcp-for-i` on typical setups).
248
+ - Default audit log path:
249
+ - `<configDir>/audit/tool-audit.jsonl`
250
+
251
+ ### 4.2 Audit Environment Variables
252
+ - `MCP_FOR_I_AUDIT_ENABLED=0` disables audit append.
253
+ - `MCP_FOR_I_AUDIT_LOG_PATH=<path>` overrides default audit file location.
254
+
255
+ ### 4.3 Logging Environment Variables
256
+ - `MCP_FOR_I_LOG_ENABLED`
257
+ - `MCP_FOR_I_LOG_LEVEL`
258
+ - `MCP_FOR_I_LOG`
259
+ - `MCP_FOR_I_LOG_STDERR`
260
+
261
+ ## 5) Current Scope Boundary
262
+
263
+ Implemented through Phase 7.
264
+ Next roadmap items begin at Phase 8 (reliability/recovery/change assurance), then autonomy/distribution phases.
@@ -34,6 +34,10 @@ Default settings (editable in the config file):
34
34
  - `tn5250Port`: number. TN5250 telnet port (default 23, or 992 when `tn5250Tls` is true).
35
35
  - `tn5250Tls`: boolean. Use TLS for TN5250 (default true when the port is 992).
36
36
  - `tn5250DeviceName`: string. Virtual device name requested for TN5250 sessions (1-10 characters).
37
+ - `tn5250LiveView`: boolean. Serve the live 5250 view on localhost while a session is open (default true).
38
+ - `tn5250LiveViewPort`: number. Preferred port for the live 5250 view (default 3981; the next free port when taken, 0 for any).
39
+ - `tn5250AttnWaitMs`: number. How long Attn/SysReq wait for the host before unlocking the keyboard, in milliseconds (default 2000, range 250-15000).
40
+ - `tn5250Ccsid`: number. Single-byte EBCDIC code page for TN5250 screen text (default 37; also 273, 277, 278, 280, 284, 285, 297, 500, 871, 1047, 1140-1149).
37
41
 
38
42
  `tempLibrary` remains accepted for configuration compatibility. Source member reads and source-date writes now use job-local `QTEMP` objects and do not require a persistent `ILEDITOR` library.
39
43
 
package/docs/tools.md CHANGED
@@ -234,6 +234,7 @@ The documentation catalog is also exposed through MCP resources: `ibmi-docs://ca
234
234
  - `ibmi.tn5250.readScreen`
235
235
  - `ibmi.tn5250.setField`
236
236
  - `ibmi.tn5250.sendKeys`
237
+ - `ibmi.tn5250.click`
237
238
  - `ibmi.tn5250.waitFor`
238
239
  - `ibmi.tn5250.snapshot`
239
240
  - `ibmi.tn5250.disconnect`
@@ -241,16 +242,19 @@ The documentation catalog is also exposed through MCP resources: `ibmi-docs://ca
241
242
  ### TN5250 Notes
242
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.
243
244
 
244
- - **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). Calling connect again while the session is open returns the current screen with `reused: true`.
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`.
245
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.
246
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`.
247
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).
248
- - **sendKeys** types `text` at the cursor (optionally after moving it with `cursorRow`/`cursorCol`), then presses `keys`: local keys `Tab`, `BackTab`, `Home`, `Reset`, `EraseEOF`, `FieldExit`, and at most one AID key, last: `Enter`, `F1`-`F24`, `PageUp`/`PageDown` (Roll Down/Up), `Clear`, `Help`, `Print`, `Attn`, `SysReq`. 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`).
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.
249
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`.
250
254
  - **snapshot** returns `plainText` plus the structured screen. **disconnect** closes the session; `ibmi.disconnect` and `ibmi.session.terminate` close it too.
251
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).
252
256
  - Text typed into hidden fields is replaced by `***REDACTED***` in the server log and the audit record.
253
- - 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 CCSID 37. 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`.
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`.
254
258
 
255
259
  ## Object, Member and IFS Operations
256
260
  - `ibmi.objects.copy` - `CRTDUPOBJ` to `toLibrary` (default: same library) as `newObject` (default: same name); `data=true` adds `DATA(*YES)` for `*FILE`.