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.
Files changed (72) hide show
  1. package/README.md +27 -0
  2. package/dist/config/store.js +229 -109
  3. package/dist/controlplane/auth.js +128 -0
  4. package/dist/controlplane/clientIntegrationService.js +83 -4
  5. package/dist/controlplane/commands.js +52 -11
  6. package/dist/controlplane/connectionService.js +110 -5
  7. package/dist/controlplane/connectionTest.js +329 -0
  8. package/dist/controlplane/errors.js +12 -0
  9. package/dist/controlplane/runtimeService.js +98 -26
  10. package/dist/controlplane/server.js +178 -11
  11. package/dist/controlplane/serverShared.js +25 -6
  12. package/dist/controlplane/serviceManager.js +147 -100
  13. package/dist/controlplane/ui.js +1783 -920
  14. package/dist/ibmi/CompileTools.js +29 -1
  15. package/dist/ibmi/IBMiContent.js +435 -63
  16. package/dist/ibmi/IbmDocs.js +685 -0
  17. package/dist/ibmi/LocalLanguageActions.js +129 -3
  18. package/dist/ibmi/Search.js +158 -52
  19. package/dist/ibmi/Tools.js +7 -10
  20. package/dist/ibmi/client.js +220 -31
  21. package/dist/ibmi/evfevent.js +256 -0
  22. package/dist/ibmi/knownHosts.js +190 -0
  23. package/dist/ibmi/libraryList.js +93 -0
  24. package/dist/ibmi/sourceInspect.js +815 -0
  25. package/dist/ibmi/sqlJob.js +888 -0
  26. package/dist/ibmi/sqlParse.js +317 -0
  27. package/dist/ibmi/tn5250/certTrust.js +59 -0
  28. package/dist/ibmi/tn5250/client.js +334 -0
  29. package/dist/ibmi/tn5250/datastream.js +109 -0
  30. package/dist/ibmi/tn5250/ebcdic.js +93 -0
  31. package/dist/ibmi/tn5250/ebcdicTables.js +27 -0
  32. package/dist/ibmi/tn5250/index.js +6 -0
  33. package/dist/ibmi/tn5250/screen.js +1033 -0
  34. package/dist/ibmi/tn5250/telnet.js +186 -0
  35. package/dist/ibmi/variables.js +18 -7
  36. package/dist/index.js +79 -24
  37. package/dist/mcp/annotations.js +155 -0
  38. package/dist/mcp/audit.js +490 -133
  39. package/dist/mcp/confirm.js +48 -0
  40. package/dist/mcp/context.js +43 -5
  41. package/dist/mcp/deployMethods.js +192 -0
  42. package/dist/mcp/logger.js +5 -10
  43. package/dist/mcp/modules/bulkMembers.js +476 -0
  44. package/dist/mcp/modules/changedLines.js +189 -0
  45. package/dist/mcp/modules/compare.js +198 -0
  46. package/dist/mcp/modules/compile.js +515 -0
  47. package/dist/mcp/modules/ifsOps.js +123 -0
  48. package/dist/mcp/modules/index.js +38 -0
  49. package/dist/mcp/modules/inspect.js +811 -0
  50. package/dist/mcp/modules/libl.js +246 -0
  51. package/dist/mcp/modules/members.js +171 -0
  52. package/dist/mcp/modules/objects.js +339 -0
  53. package/dist/mcp/modules/system.js +266 -0
  54. package/dist/mcp/modules/tn5250.js +800 -0
  55. package/dist/mcp/modules/tn5250App.js +194 -0
  56. package/dist/mcp/modules/tn5250Font.js +8 -0
  57. package/dist/mcp/modules/tn5250Live.js +221 -0
  58. package/dist/mcp/modules/tn5250LivePage.js +480 -0
  59. package/dist/mcp/policy.js +412 -0
  60. package/dist/mcp/tools.js +1719 -698
  61. package/dist/security/credentialStore.js +62 -13
  62. package/dist/security/localPaths.js +138 -0
  63. package/dist/security/redact.js +79 -0
  64. package/dist/util/atomicWrite.js +101 -0
  65. package/dist/util/fileLock.js +206 -0
  66. package/docs/capabilities.md +264 -220
  67. package/docs/configuration.md +193 -60
  68. package/docs/examples.md +109 -73
  69. package/docs/overview.md +15 -15
  70. package/docs/security.md +101 -16
  71. package/docs/tools.md +367 -188
  72. package/package.json +5 -2
@@ -1,220 +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.1.8` codebase.
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 (`approve=true`) for sensitive operations.
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
- - Sliding inactivity timeout.
25
- - Heartbeat and reconnect behavior.
26
-
27
- ### 1.4 Agent-Safe Structured Results
28
- - Tool responses expose structured payloads for automation.
29
- - SQL/CL/diagnostic outputs normalized where applicable.
30
- - TN5250 state model includes machine-readable fields/history.
31
-
32
- ### 1.5 Auditing and Compliance Foundations
33
- - Tamper-evident hash-chain audit record for tool calls.
34
- - Audit verification, export, and retention purge controls.
35
- - Compliance report generation with optional signed evidence bundle.
36
-
37
- ### 1.6 IBM i Operations Control (Phase 7)
38
- - Spool lifecycle controls (hold/release/delete/move by job/file/number).
39
- - Job lifecycle controls (list/hold/release/end).
40
- - Subsystem lifecycle controls (list/status/start/end).
41
- - Message queue operations (read/send/reply).
42
- - Preflight operational visibility (lock contention + object authority lookup).
43
- - Data queue and data area operations for integration and runbook workflows.
44
-
45
- ## 2) Complete MCP Tool Catalog
46
-
47
- ### Connection and Session
48
- - `ibmi.connect`
49
- - `ibmi.disconnect`
50
- - `ibmi.session.list`
51
- - `ibmi.session.status`
52
- - `ibmi.session.keepalive`
53
- - `ibmi.session.terminate`
54
- - `ibmi.connections.list`
55
- - `ibmi.connections.add`
56
- - `ibmi.connections.update`
57
- - `ibmi.connections.delete`
58
-
59
- ### QSYS and Source Management
60
- - `ibmi.qsys.libraries.list`
61
- - `ibmi.qsys.objects.list`
62
- - `ibmi.qsys.sourcefiles.list`
63
- - `ibmi.qsys.members.list`
64
- - `ibmi.qsys.members.read`
65
- - `ibmi.qsys.members.write`
66
- - `ibmi.qsys.members.create`
67
- - `ibmi.qsys.members.rename`
68
- - `ibmi.qsys.members.delete`
69
- - `ibmi.qsys.sourcefiles.create`
70
- - `ibmi.qsys.libraries.create`
71
-
72
- ### IFS Operations
73
- - `ibmi.ifs.list`
74
- - `ibmi.ifs.read`
75
- - `ibmi.ifs.write`
76
- - `ibmi.ifs.mkdir`
77
- - `ibmi.ifs.delete`
78
- - `ibmi.ifs.upload`
79
- - `ibmi.ifs.download`
80
-
81
- ### Search and Resolution
82
- - `ibmi.search.members`
83
- - `ibmi.search.ifs`
84
- - `ibmi.find.ifs`
85
- - `ibmi.resolve.path`
86
-
87
- ### Actions, Filters, Profiles, Library List
88
- - `ibmi.actions.list`
89
- - `ibmi.actions.run`
90
- - `ibmi.actions.save`
91
- - `ibmi.actions.delete`
92
- - `ibmi.filters.list`
93
- - `ibmi.filters.save`
94
- - `ibmi.filters.delete`
95
- - `ibmi.profiles.list`
96
- - `ibmi.profiles.save`
97
- - `ibmi.profiles.delete`
98
- - `ibmi.profiles.activate`
99
- - `ibmi.libl.get`
100
- - `ibmi.libl.set`
101
- - `ibmi.libl.add`
102
- - `ibmi.libl.remove`
103
- - `ibmi.libl.setCurrent`
104
- - `ibmi.libl.validate`
105
- - `ibmi.ifs.shortcuts.list`
106
- - `ibmi.ifs.shortcuts.add`
107
- - `ibmi.ifs.shortcuts.delete`
108
-
109
- ### Deploy and File Sync
110
- - `ibmi.deploy.compare`
111
- - `ibmi.deploy.sync`
112
- - `ibmi.deploy.uploadDirectory`
113
- - `ibmi.deploy.uploadFiles`
114
- - `ibmi.deploy.setCcsid`
115
-
116
- ### SQL, CL, Diagnostics, Spool, Debug
117
- - `ibmi.sql.query`
118
- - `ibmi.sql.execute`
119
- - `ibmi.cl.run`
120
- - `ibmi.diagnostics.parseEvfevent`
121
- - `ibmi.joblog.get`
122
- - `ibmi.spool.list`
123
- - `ibmi.spool.read`
124
- - `ibmi.spool.hold`
125
- - `ibmi.spool.release`
126
- - `ibmi.spool.delete`
127
- - `ibmi.spool.move`
128
- - `ibmi.jobs.list`
129
- - `ibmi.jobs.hold`
130
- - `ibmi.jobs.release`
131
- - `ibmi.jobs.end`
132
- - `ibmi.subsystems.list`
133
- - `ibmi.subsystems.status`
134
- - `ibmi.subsystems.start`
135
- - `ibmi.subsystems.end`
136
- - `ibmi.msgq.read`
137
- - `ibmi.msgq.send`
138
- - `ibmi.msgq.reply`
139
- - `ibmi.locks.list`
140
- - `ibmi.authority.object.get`
141
- - `ibmi.dataqueue.send`
142
- - `ibmi.dataqueue.receive`
143
- - `ibmi.dataarea.read`
144
- - `ibmi.dataarea.write`
145
- - `ibmi.debug.status`
146
- - `ibmi.debug.startService`
147
- - `ibmi.debug.stopService`
148
-
149
- ### Audit and Compliance
150
- - `ibmi.audit.list`
151
- - `ibmi.audit.verify`
152
- - `ibmi.audit.export`
153
- - `ibmi.audit.purge`
154
- - `ibmi.compliance.report.generate`
155
-
156
- ### Journaling
157
- - `ibmi.journal.objects.list`
158
- - `ibmi.journal.entries.query`
159
- - `ibmi.qaudjrn.events.query`
160
- - `ibmi.journal.receiver.create`
161
- - `ibmi.journal.create`
162
- - `ibmi.journal.receiver.change`
163
- - `ibmi.journal.startPf`
164
- - `ibmi.journal.endPf`
165
- - `ibmi.journal.startIfs`
166
- - `ibmi.journal.endIfs`
167
- - `ibmi.journal.receivers.retention`
168
-
169
- ### TN5250 Command Session
170
- - `ibmi.tn5250.connect`
171
- - `ibmi.tn5250.readScreen`
172
- - `ibmi.tn5250.setField`
173
- - `ibmi.tn5250.sendKeys`
174
- - `ibmi.tn5250.waitFor`
175
- - `ibmi.tn5250.snapshot`
176
- - `ibmi.tn5250.disconnect`
177
-
178
- ## 3) High-Value Behaviors Users Often Miss
179
-
180
- ### 3.1 Guarded Approvals
181
- - Many destructive/risky tools accept `approve=true`.
182
- - In guarded policy, write operations may be blocked until approved.
183
-
184
- ### 3.2 Audit Data Lifecycle
185
- - Verify chain integrity with `ibmi.audit.verify`.
186
- - Export evidence using `ibmi.audit.export` (`jsonl`, `json`, `csv`).
187
- - Use `ibmi.audit.purge` for retention cleanup (`dryRun` supported).
188
-
189
- ### 3.3 Journaling and QAUDJRN
190
- - PF and IFS journaling lifecycle operations are supported.
191
- - `ibmi.journal.entries.query` supports advanced filters (`journalCode`, `entryType`, `userName`, `jobName`, `programName`).
192
- - `ibmi.qaudjrn.events.query` provides normalized QAUDJRN security/compliance event access.
193
-
194
- ### 3.4 Compliance Report Bundles
195
- - `ibmi.compliance.report.generate` can return in-memory report payload or write to `outputPath`.
196
- - Optional signing creates:
197
- - `<outputPath>.sig`
198
- - `<outputPath>.sha256`
199
-
200
- ## 4) Useful Local Paths and Env Knobs
201
-
202
- ### 4.1 Config and Audit Storage
203
- - Config base directory: from local MCP-for-i config store (`~/.mcp-for-i` on typical setups).
204
- - Default audit log path:
205
- - `<configDir>/audit/tool-audit.jsonl`
206
-
207
- ### 4.2 Audit Environment Variables
208
- - `MCP_FOR_I_AUDIT_ENABLED=0` disables audit append.
209
- - `MCP_FOR_I_AUDIT_LOG_PATH=<path>` overrides default audit file location.
210
-
211
- ### 4.3 Logging Environment Variables
212
- - `MCP_FOR_I_LOG_ENABLED`
213
- - `MCP_FOR_I_LOG_LEVEL`
214
- - `MCP_FOR_I_LOG`
215
- - `MCP_FOR_I_LOG_STDERR`
216
-
217
- ## 5) Current Scope Boundary
218
-
219
- Implemented through Phase 7.
220
- 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.