@joomengine/joomla-mcp 0.7.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 (243) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +349 -0
  3. package/README.md +279 -0
  4. package/SECURITY.md +39 -0
  5. package/config/live-test.default.json +1206 -0
  6. package/config/sites.example.json +53 -0
  7. package/config/sites.single-site-readonly.example.json +24 -0
  8. package/dist/application/joomla-service.d.ts +72 -0
  9. package/dist/application/joomla-service.d.ts.map +1 -0
  10. package/dist/application/joomla-service.js +484 -0
  11. package/dist/application/joomla-service.js.map +1 -0
  12. package/dist/application/joomla-write-service.d.ts +109 -0
  13. package/dist/application/joomla-write-service.d.ts.map +1 -0
  14. package/dist/application/joomla-write-service.js +628 -0
  15. package/dist/application/joomla-write-service.js.map +1 -0
  16. package/dist/application/site-registry.d.ts +17 -0
  17. package/dist/application/site-registry.d.ts.map +1 -0
  18. package/dist/application/site-registry.js +31 -0
  19. package/dist/application/site-registry.js.map +1 -0
  20. package/dist/audit/audit-sink.d.ts +24 -0
  21. package/dist/audit/audit-sink.d.ts.map +1 -0
  22. package/dist/audit/audit-sink.js +10 -0
  23. package/dist/audit/audit-sink.js.map +1 -0
  24. package/dist/bin/joomla-mcp-http.d.ts +3 -0
  25. package/dist/bin/joomla-mcp-http.d.ts.map +1 -0
  26. package/dist/bin/joomla-mcp-http.js +65 -0
  27. package/dist/bin/joomla-mcp-http.js.map +1 -0
  28. package/dist/bin/joomla-mcp-live-test.d.ts +3 -0
  29. package/dist/bin/joomla-mcp-live-test.d.ts.map +1 -0
  30. package/dist/bin/joomla-mcp-live-test.js +10 -0
  31. package/dist/bin/joomla-mcp-live-test.js.map +1 -0
  32. package/dist/bin/joomla-mcp.d.ts +3 -0
  33. package/dist/bin/joomla-mcp.d.ts.map +1 -0
  34. package/dist/bin/joomla-mcp.js +18 -0
  35. package/dist/bin/joomla-mcp.js.map +1 -0
  36. package/dist/catalog/action-catalog.d.ts +35 -0
  37. package/dist/catalog/action-catalog.d.ts.map +1 -0
  38. package/dist/catalog/action-catalog.js +525 -0
  39. package/dist/catalog/action-catalog.js.map +1 -0
  40. package/dist/catalog/action-gates.d.ts +10 -0
  41. package/dist/catalog/action-gates.d.ts.map +1 -0
  42. package/dist/catalog/action-gates.js +18 -0
  43. package/dist/catalog/action-gates.js.map +1 -0
  44. package/dist/catalog/cli-command-targets.d.ts +20 -0
  45. package/dist/catalog/cli-command-targets.d.ts.map +1 -0
  46. package/dist/catalog/cli-command-targets.js +60 -0
  47. package/dist/catalog/cli-command-targets.js.map +1 -0
  48. package/dist/catalog/companion-actions.d.ts +30 -0
  49. package/dist/catalog/companion-actions.d.ts.map +1 -0
  50. package/dist/catalog/companion-actions.js +374 -0
  51. package/dist/catalog/companion-actions.js.map +1 -0
  52. package/dist/catalog/core.d.ts +17 -0
  53. package/dist/catalog/core.d.ts.map +1 -0
  54. package/dist/catalog/core.js +115 -0
  55. package/dist/catalog/core.js.map +1 -0
  56. package/dist/catalog/crud-bases.d.ts +8 -0
  57. package/dist/catalog/crud-bases.d.ts.map +1 -0
  58. package/dist/catalog/crud-bases.js +203 -0
  59. package/dist/catalog/crud-bases.js.map +1 -0
  60. package/dist/catalog/crud-write-fields.d.ts +11 -0
  61. package/dist/catalog/crud-write-fields.d.ts.map +1 -0
  62. package/dist/catalog/crud-write-fields.js +110 -0
  63. package/dist/catalog/crud-write-fields.js.map +1 -0
  64. package/dist/catalog/index.d.ts +7 -0
  65. package/dist/catalog/index.d.ts.map +1 -0
  66. package/dist/catalog/index.js +7 -0
  67. package/dist/catalog/index.js.map +1 -0
  68. package/dist/catalog/source-metadata.d.ts +8 -0
  69. package/dist/catalog/source-metadata.d.ts.map +1 -0
  70. package/dist/catalog/source-metadata.js +73 -0
  71. package/dist/catalog/source-metadata.js.map +1 -0
  72. package/dist/catalog/special-reads.d.ts +4 -0
  73. package/dist/catalog/special-reads.d.ts.map +1 -0
  74. package/dist/catalog/special-reads.js +243 -0
  75. package/dist/catalog/special-reads.js.map +1 -0
  76. package/dist/catalog/special-writes.d.ts +8 -0
  77. package/dist/catalog/special-writes.d.ts.map +1 -0
  78. package/dist/catalog/special-writes.js +370 -0
  79. package/dist/catalog/special-writes.js.map +1 -0
  80. package/dist/config/index.d.ts +3 -0
  81. package/dist/config/index.d.ts.map +1 -0
  82. package/dist/config/index.js +3 -0
  83. package/dist/config/index.js.map +1 -0
  84. package/dist/config/load.d.ts +20 -0
  85. package/dist/config/load.d.ts.map +1 -0
  86. package/dist/config/load.js +156 -0
  87. package/dist/config/load.js.map +1 -0
  88. package/dist/config/schema.d.ts +171 -0
  89. package/dist/config/schema.d.ts.map +1 -0
  90. package/dist/config/schema.js +169 -0
  91. package/dist/config/schema.js.map +1 -0
  92. package/dist/contracts/action-catalog.d.ts +134 -0
  93. package/dist/contracts/action-catalog.d.ts.map +1 -0
  94. package/dist/contracts/action-catalog.js +2 -0
  95. package/dist/contracts/action-catalog.js.map +1 -0
  96. package/dist/contracts/bounded-query.d.ts +27 -0
  97. package/dist/contracts/bounded-query.d.ts.map +1 -0
  98. package/dist/contracts/bounded-query.js +59 -0
  99. package/dist/contracts/bounded-query.js.map +1 -0
  100. package/dist/contracts/route-resolution.d.ts +3 -0
  101. package/dist/contracts/route-resolution.d.ts.map +1 -0
  102. package/dist/contracts/route-resolution.js +71 -0
  103. package/dist/contracts/route-resolution.js.map +1 -0
  104. package/dist/http/access-limits.d.ts +24 -0
  105. package/dist/http/access-limits.d.ts.map +1 -0
  106. package/dist/http/access-limits.js +86 -0
  107. package/dist/http/access-limits.js.map +1 -0
  108. package/dist/http/audit.d.ts +19 -0
  109. package/dist/http/audit.d.ts.map +1 -0
  110. package/dist/http/audit.js +10 -0
  111. package/dist/http/audit.js.map +1 -0
  112. package/dist/http/auth.d.ts +33 -0
  113. package/dist/http/auth.d.ts.map +1 -0
  114. package/dist/http/auth.js +123 -0
  115. package/dist/http/auth.js.map +1 -0
  116. package/dist/http/index.d.ts +6 -0
  117. package/dist/http/index.d.ts.map +1 -0
  118. package/dist/http/index.js +6 -0
  119. package/dist/http/index.js.map +1 -0
  120. package/dist/http/remote-http.d.ts +47 -0
  121. package/dist/http/remote-http.d.ts.map +1 -0
  122. package/dist/http/remote-http.js +552 -0
  123. package/dist/http/remote-http.js.map +1 -0
  124. package/dist/http/request-policy.d.ts +19 -0
  125. package/dist/http/request-policy.d.ts.map +1 -0
  126. package/dist/http/request-policy.js +137 -0
  127. package/dist/http/request-policy.js.map +1 -0
  128. package/dist/index.d.ts +11 -0
  129. package/dist/index.d.ts.map +1 -0
  130. package/dist/index.js +11 -0
  131. package/dist/index.js.map +1 -0
  132. package/dist/infrastructure/api/joomla-api-client.d.ts +26 -0
  133. package/dist/infrastructure/api/joomla-api-client.d.ts.map +1 -0
  134. package/dist/infrastructure/api/joomla-api-client.js +139 -0
  135. package/dist/infrastructure/api/joomla-api-client.js.map +1 -0
  136. package/dist/infrastructure/cli/joomla-cli-client.d.ts +30 -0
  137. package/dist/infrastructure/cli/joomla-cli-client.d.ts.map +1 -0
  138. package/dist/infrastructure/cli/joomla-cli-client.js +163 -0
  139. package/dist/infrastructure/cli/joomla-cli-client.js.map +1 -0
  140. package/dist/infrastructure/index.d.ts +3 -0
  141. package/dist/infrastructure/index.d.ts.map +1 -0
  142. package/dist/infrastructure/index.js +3 -0
  143. package/dist/infrastructure/index.js.map +1 -0
  144. package/dist/library.d.ts +33 -0
  145. package/dist/library.d.ts.map +1 -0
  146. package/dist/library.js +22 -0
  147. package/dist/library.js.map +1 -0
  148. package/dist/live-test/catalog.d.ts +4 -0
  149. package/dist/live-test/catalog.d.ts.map +1 -0
  150. package/dist/live-test/catalog.js +62 -0
  151. package/dist/live-test/catalog.js.map +1 -0
  152. package/dist/live-test/cli.d.ts +2 -0
  153. package/dist/live-test/cli.d.ts.map +1 -0
  154. package/dist/live-test/cli.js +305 -0
  155. package/dist/live-test/cli.js.map +1 -0
  156. package/dist/live-test/console-report.d.ts +3 -0
  157. package/dist/live-test/console-report.d.ts.map +1 -0
  158. package/dist/live-test/console-report.js +75 -0
  159. package/dist/live-test/console-report.js.map +1 -0
  160. package/dist/live-test/fixtures.d.ts +22 -0
  161. package/dist/live-test/fixtures.d.ts.map +1 -0
  162. package/dist/live-test/fixtures.js +371 -0
  163. package/dist/live-test/fixtures.js.map +1 -0
  164. package/dist/live-test/index.d.ts +9 -0
  165. package/dist/live-test/index.d.ts.map +1 -0
  166. package/dist/live-test/index.js +8 -0
  167. package/dist/live-test/index.js.map +1 -0
  168. package/dist/live-test/known-limitations.d.ts +13 -0
  169. package/dist/live-test/known-limitations.d.ts.map +1 -0
  170. package/dist/live-test/known-limitations.js +186 -0
  171. package/dist/live-test/known-limitations.js.map +1 -0
  172. package/dist/live-test/progress.d.ts +60 -0
  173. package/dist/live-test/progress.d.ts.map +1 -0
  174. package/dist/live-test/progress.js +141 -0
  175. package/dist/live-test/progress.js.map +1 -0
  176. package/dist/live-test/reporting.d.ts +7 -0
  177. package/dist/live-test/reporting.d.ts.map +1 -0
  178. package/dist/live-test/reporting.js +181 -0
  179. package/dist/live-test/reporting.js.map +1 -0
  180. package/dist/live-test/runner.d.ts +19 -0
  181. package/dist/live-test/runner.d.ts.map +1 -0
  182. package/dist/live-test/runner.js +2680 -0
  183. package/dist/live-test/runner.js.map +1 -0
  184. package/dist/live-test/scenario-config.d.ts +82 -0
  185. package/dist/live-test/scenario-config.d.ts.map +1 -0
  186. package/dist/live-test/scenario-config.js +384 -0
  187. package/dist/live-test/scenario-config.js.map +1 -0
  188. package/dist/live-test/transports.d.ts +13 -0
  189. package/dist/live-test/transports.d.ts.map +1 -0
  190. package/dist/live-test/transports.js +162 -0
  191. package/dist/live-test/transports.js.map +1 -0
  192. package/dist/live-test/types.d.ts +140 -0
  193. package/dist/live-test/types.d.ts.map +1 -0
  194. package/dist/live-test/types.js +10 -0
  195. package/dist/live-test/types.js.map +1 -0
  196. package/dist/mcp/create-server.d.ts +36 -0
  197. package/dist/mcp/create-server.d.ts.map +1 -0
  198. package/dist/mcp/create-server.js +472 -0
  199. package/dist/mcp/create-server.js.map +1 -0
  200. package/dist/security/confirmation-service.d.ts +51 -0
  201. package/dist/security/confirmation-service.d.ts.map +1 -0
  202. package/dist/security/confirmation-service.js +153 -0
  203. package/dist/security/confirmation-service.js.map +1 -0
  204. package/dist/security/index.d.ts +4 -0
  205. package/dist/security/index.d.ts.map +1 -0
  206. package/dist/security/index.js +4 -0
  207. package/dist/security/index.js.map +1 -0
  208. package/dist/security/jwks-jwt-verifier.d.ts +15 -0
  209. package/dist/security/jwks-jwt-verifier.d.ts.map +1 -0
  210. package/dist/security/jwks-jwt-verifier.js +196 -0
  211. package/dist/security/jwks-jwt-verifier.js.map +1 -0
  212. package/dist/security/permission-grant-service.d.ts +55 -0
  213. package/dist/security/permission-grant-service.d.ts.map +1 -0
  214. package/dist/security/permission-grant-service.js +321 -0
  215. package/dist/security/permission-grant-service.js.map +1 -0
  216. package/dist/version.d.ts +7 -0
  217. package/dist/version.d.ts.map +1 -0
  218. package/dist/version.js +7 -0
  219. package/dist/version.js.map +1 -0
  220. package/docs/API_ACTIONS.md +350 -0
  221. package/docs/ARCHITECTURE.md +114 -0
  222. package/docs/CLI.md +99 -0
  223. package/docs/CLIENTS.md +269 -0
  224. package/docs/COVERAGE.md +182 -0
  225. package/docs/DEPLOYMENT.md +272 -0
  226. package/docs/FIXTURES.md +210 -0
  227. package/docs/LIBRARY.md +246 -0
  228. package/docs/LIVE_TESTING.md +409 -0
  229. package/docs/OPERATIONS.md +138 -0
  230. package/docs/PHP_COMPANION.md +221 -0
  231. package/docs/RECONNAISSANCE.md +104 -0
  232. package/docs/RELEASING.md +233 -0
  233. package/docs/REMOTE_HTTP.md +126 -0
  234. package/docs/SECURITY.md +138 -0
  235. package/docs/SINGLE_SITE.md +223 -0
  236. package/docs/TESTING.md +160 -0
  237. package/docs/TROUBLESHOOTING.md +98 -0
  238. package/docs/USAGE.md +208 -0
  239. package/examples/embedded-host/README.md +33 -0
  240. package/examples/embedded-host/http.mjs +68 -0
  241. package/examples/embedded-host/package.json +13 -0
  242. package/examples/embedded-host/stdio.mjs +24 -0
  243. package/package.json +119 -0
@@ -0,0 +1,138 @@
1
+ # Operations
2
+
3
+ ## Startup checks
4
+
5
+ At every start or deployment, confirm:
6
+
7
+ - configuration parses and every referenced secret exists;
8
+ - configured Joomla roots, PHP binaries, and CLI launchers resolve to the
9
+ expected fixed files;
10
+ - the HTTP listener is private and its `Host`/`Origin` policy matches the proxy;
11
+ - `/healthz` returns shallow liveness and `/readyz` successfully warms/validates
12
+ the configured JWKS;
13
+ - token validation works with the expected issuer, audience, and scopes;
14
+ - each API origin is HTTPS and answers a safe bounded read;
15
+ - `joomla:mcp:describe` reports the expected companion version, action IDs, and
16
+ actor permissions for local sites;
17
+ - the audit destination is writable and protected;
18
+ - the permission grant store is mode `0600`, writable only by the service
19
+ account, and passes integrity validation;
20
+ - write toolsets remain disabled unless their release and site-specific gates
21
+ passed.
22
+
23
+ ## Health and readiness
24
+
25
+ `GET` or `HEAD /healthz` is deliberately shallow. It establishes that the
26
+ process can serve HTTP after Host/Origin policy; it does not probe dependencies.
27
+
28
+ `GET` or `HEAD /readyz` passes the same Host/Origin policy and warms/validates
29
+ the configured JWKS dependency. It returns `200` with `{"status":"ready"}` on
30
+ success. Any dependency failure returns a generic `503` reason `not_ready`
31
+ without disclosing the JWKS URL, keys, or internal error. Remove an instance
32
+ from MCP traffic while readiness fails, but do not restart it solely because an
33
+ external authorization service is temporarily unavailable.
34
+
35
+ Use separate probes for:
36
+
37
+ - a safe read with the dedicated API actor;
38
+ - companion description with the dedicated local actor;
39
+ - audit event delivery;
40
+ - Joomla's own application and database health.
41
+
42
+ Do not place downstream mutation probes in liveness or readiness checks.
43
+
44
+ ## Logs and audit
45
+
46
+ The HTTP process emits operational and audit JSON to stderr. With systemd:
47
+
48
+ ```bash
49
+ journalctl -u joomla-mcp.service --since today
50
+ journalctl -u joomla-mcp.service -f
51
+ ```
52
+
53
+ With Compose:
54
+
55
+ ```bash
56
+ docker compose --project-directory deploy --env-file deploy/.release.env -f deploy/compose.yaml logs --tail=200 joomla-mcp
57
+ ```
58
+
59
+ Restrict log access and retention. Logs must not contain authorization headers,
60
+ Joomla/update tokens, passwords, approval secrets, confirmation tokens, full
61
+ request bodies, or unbounded Joomla content. Alert on repeated authentication
62
+ or scope denials, rate/session exhaustion, companion capability changes, write
63
+ verification failures, process timeout/truncation, JWKS failures, and audit-sink
64
+ failure. Retain and alert on permission request, approval, use, and revocation
65
+ events.
66
+
67
+ ## Routine maintenance
68
+
69
+ - Apply supported Node base-image, operating-system, Joomla, PHP, and dependency
70
+ security updates through the tested upgrade procedure.
71
+ - Rotate Joomla API/update tokens, OAuth client credentials, and approval
72
+ secrets on a documented schedule and after personnel or trust changes.
73
+ - Re-run companion description after Joomla, companion, actor ACL, or plugin
74
+ configuration changes.
75
+ - Review site toolsets and OAuth scopes; remove unused permissions.
76
+ - Exercise Joomla filesystem/database restore and edge rollback regularly.
77
+ - Re-run the supported live matrix before promoting an action or runtime update.
78
+ - Verify release artifact digests, SBOM, and provenance before deployment.
79
+
80
+ ## Secret rotation
81
+
82
+ 1. Create the replacement credential at its authority.
83
+ 2. Update the secret store/environment without changing the public site file
84
+ unless the variable name itself changes.
85
+ 3. Restart or roll the single edge process.
86
+ 4. Verify a safe read and required denial cases.
87
+ 5. Revoke the old credential.
88
+
89
+ Before rotating the approval secret, revoke active grants, preserve the old
90
+ grant store as restricted incident/change evidence, and install a new empty
91
+ mode `0600` store. Rotation intentionally invalidates pending write plans and
92
+ old persistent grant signatures.
93
+ Rotating a Joomla token does not alter inbound MCP authorization, and rotating
94
+ OAuth signing keys does not alter the downstream Joomla identity.
95
+
96
+ ## Backup boundaries
97
+
98
+ The MCP edge is not a Joomla backup system. Back up and restore Joomla through a
99
+ tested native/site-operations procedure that includes the filesystem, database,
100
+ configuration, media, and extension state. Edge configuration, the signed
101
+ permission grant store, and secret-store metadata need their own protected
102
+ backup, but raw secrets should follow the secret manager's recovery process.
103
+
104
+ ## Safe shutdown and restart
105
+
106
+ Drain write traffic before stopping. `SIGTERM` initiates HTTP server shutdown:
107
+ new request admission stops, idle connections close, and active connections may
108
+ finish for at most `http.shutdownGraceMs`. The default is 30 seconds; the
109
+ accepted range is 1–120 seconds. When the grace expires, remaining connections
110
+ are force-closed. Configure the service/container stop timeout above the chosen
111
+ grace so it does not terminate the process first.
112
+
113
+ Restart discards in-process sessions, pending permission requests, pending
114
+ confirmation plans, locks, idempotency state, and rate state. Active grants
115
+ survive only when `grantStorePath` is configured. Clients reconnect and
116
+ re-plan; they must not assume an interrupted write failed without checking
117
+ Joomla's postcondition.
118
+
119
+ ## Multi-replica boundary
120
+
121
+ The current process-local coordination is a production boundary. Read-only
122
+ replicas may be deployed with an explicit session strategy, but write-enabled
123
+ horizontal scaling remains gated until shared locks, idempotency, confirmation,
124
+ rate state, replay behavior, session handling, and failure recovery pass the
125
+ matrix. Do not rely on best-effort sticky sessions as write integrity.
126
+
127
+ ## Incident runbook
128
+
129
+ For suspected compromise or unauthorized mutation:
130
+
131
+ 1. disable remote access or the affected toolsets;
132
+ 2. revoke inbound and downstream credentials;
133
+ 3. revoke all permission grants, archive and reset the grant store, then rotate the approval secret;
134
+ 4. preserve redacted proxy, edge, operating-system, Joomla, and database logs;
135
+ 5. compare deployed artifact digests with release attestations;
136
+ 6. verify Joomla state through an independent administrator/native path;
137
+ 7. restore the tested Joomla backup if integrity cannot be established;
138
+ 8. correct and test the root cause on disposable fixtures before reactivation.
@@ -0,0 +1,221 @@
1
+ # Joomla PHP companion
2
+
3
+ `pkg_joomlamcp` is an installable Joomla 6.1+ console package for the local MCP
4
+ path. It does not implement MCP transport. It adapts fixed semantic actions to
5
+ Joomla's native console runtime, dependency-injection container, actor ACL,
6
+ services, and administrator models.
7
+
8
+ Joomla remains the implementation authority. The companion does not recreate
9
+ Joomla validation, persistence, events, state transitions, extension discovery,
10
+ scheduling, sessions, or configuration behavior.
11
+
12
+ ## Build and install
13
+
14
+ PHP 8.3 or newer and the PHP `zip` extension are required:
15
+
16
+ ```bash
17
+ php companion/tests/run.php
18
+ php companion/build.php
19
+ ```
20
+
21
+ The build produces `companion/dist/pkg_joomlamcp-0.7.0.zip`. Install or upgrade
22
+ it through Joomla's native extension installer. First installation enables the
23
+ console plugin through Joomla's extension table lifecycle; upgrades preserve
24
+ the operator's enabled/disabled state. Then:
25
+
26
+ 1. verify **Console - JoomEngine MCP for Joomla Companion** is enabled;
27
+ 2. select a dedicated least-privilege Joomla user under **MCP actor user**;
28
+ 3. run the verification command from the Joomla root as the dedicated
29
+ deployment account:
30
+
31
+ ```bash
32
+ php cli/joomla.php joomla:mcp:describe --format=json --no-interaction --no-ansi
33
+ php cli/joomla.php joomla:mcp:self-test --format=json --no-interaction --no-ansi
34
+ php cli/joomla.php joomla:mcp:cli-inventory --format=json --no-interaction --no-ansi
35
+ ```
36
+
37
+ Leaving the actor unset fails closed: actions with Joomla ACL requirements are
38
+ described as unavailable and dispatch returns `ACCESS_DENIED`. Do not select a
39
+ human Super User as a shortcut.
40
+
41
+ ## Native command contract
42
+
43
+ The package registers only:
44
+
45
+ ```text
46
+ joomla:mcp:describe --format=json --no-interaction --no-ansi
47
+ joomla:mcp:dispatch --input=- --format=json --no-interaction --no-ansi
48
+ joomla:mcp:self-test --format=json --no-interaction --no-ansi
49
+ joomla:mcp:cli-inventory --format=json --no-interaction --no-ansi
50
+ ```
51
+
52
+ `joomla:mcp:self-test` accepts no action or payload. It checks that the plugin
53
+ is active, the reviewed catalogue is available, and the fixed read-only
54
+ `system.info` action dispatches successfully. Any failed check returns nonzero
55
+ with a bounded generic error.
56
+
57
+ `joomla:mcp:cli-inventory` returns the installed Joomla command registry as
58
+ bounded JSON, including definitions for arguments and options. It reads
59
+ `ConsoleApplication::getAllCommands()` and does not execute any discovered
60
+ command. The TypeScript edge exposes this through `joomla_cli_inventory` under
61
+ the `cli.discovery` toolset.
62
+
63
+ The TypeScript edge starts the configured PHP executable and fixed
64
+ `<joomla-root>/cli/joomla.php` with an argument array and no shell. Requests use
65
+ stdin so content and secrets never appear in process arguments.
66
+
67
+ One-shot read request:
68
+
69
+ ```bash
70
+ printf '%s' '{"protocol":"joomla-mcp/1","id":"smoke-1","action":"system.info","input":{}}' \
71
+ | php cli/joomla.php joomla:mcp:dispatch --input=- --format=json --no-interaction --no-ansi
72
+ ```
73
+
74
+ Success envelope:
75
+
76
+ ```json
77
+ {
78
+ "protocol": "joomla-mcp/1",
79
+ "id": "smoke-1",
80
+ "ok": true,
81
+ "result": {
82
+ "joomlaVersion": "6.1.0",
83
+ "phpVersion": "8.3.0"
84
+ }
85
+ }
86
+ ```
87
+
88
+ Error envelope:
89
+
90
+ ```json
91
+ {
92
+ "protocol": "joomla-mcp/1",
93
+ "id": "smoke-2",
94
+ "ok": false,
95
+ "error": {
96
+ "code": "UNKNOWN_ACTION",
97
+ "message": "Action is not registered."
98
+ }
99
+ }
100
+ ```
101
+
102
+ NDJSON mode consumes and emits one object per line, accepts at most 1,000
103
+ requests per process, and caps each request at 1 MiB. The edge normally uses one
104
+ isolated process per MCP operation with its own stricter time and output limits.
105
+
106
+ ## Capability description
107
+
108
+ `joomla:mcp:describe` returns protocol/package version, action IDs, schemas,
109
+ risk, supported Joomla range, declared ACL, and effective permission for the
110
+ configured actor. Refresh it after package installation/upgrade, Joomla upgrade,
111
+ actor ACL changes, or plugin configuration changes.
112
+
113
+ The companion 0.7.0 allowlist contains 231 actions:
114
+
115
+ - 180 list/get/create/update/delete actions for the 36 fixed core entity bases;
116
+ - 28 model-state actions where the fixed Joomla model supports state changes;
117
+ - 23 supplemental/alias actions for system/safe configuration, extensions,
118
+ cache, scheduler, site state, sessions, and core-update status.
119
+
120
+ Every entity definition fixes its component, model, context, fields, ACL, and
121
+ supported operations. There is no caller-selected command, component, model,
122
+ method, path, URL, shell, PHP, SQL, or filesystem primitive.
123
+
124
+ ## Native operational actions
125
+
126
+ Companion 0.7.0 includes these fixed Joomla-native adapters:
127
+
128
+ | Action | Native Joomla capability |
129
+ |---|---|
130
+ | `cache.expired.purge` | Cache model `purge()` |
131
+ | `extensions.discovered.refresh` | Installer Discover model `discover()` |
132
+ | `extensions.updates.refresh` | Installer Update model `purge()` and `findUpdates()` |
133
+ | `extensions.update-sites.list` | Installer Update Sites model `getItems()` |
134
+ | `extensions.update-sites.state.set` | Installer Update Sites model `publish()` |
135
+ | `extensions.state.set` | Installer Manage model `publish()` |
136
+ | `scheduler.tasks.state.set` | Native single-task `scheduler:state` behavior |
137
+ | `scheduler.tasks.run` | Native single-task `scheduler:run --id` behavior |
138
+ | `site.state.get`, `site.state.set` | Joomla configuration with native site up/down behavior |
139
+ | `sessions.data.gc` | Native `session:gc`, restricted to site/administrator clients |
140
+ | `sessions.metadata.gc` | Native `session:metadata:gc` |
141
+
142
+ These are not generic Joomla command wrappers. Inputs are typed and bounded;
143
+ extension identifiers, update-site identifiers, task identifiers, state,
144
+ session client, and other choices are validated. High-risk results include
145
+ pre/post state, verification, and recovery metadata where Joomla provides a
146
+ reliable read-back.
147
+
148
+ The four new reversible setters (installed extension, update site, scheduled
149
+ task, and site availability) and all 28 generated core model-state actions mark
150
+ `applied: true` only after the native operation succeeds and a fresh read-back
151
+ matches the requested state. A mismatch fails with `POSTCONDITION_FAILED`.
152
+
153
+ The twelve actions above are described by the TypeScript edge and execute
154
+ through generic read or guarded plan/apply with matching schemas, toolsets,
155
+ scopes, and audit. They remain gated until their live Joomla allowed/denied,
156
+ postcondition, interruption, rollback, and recovery tests pass. See
157
+ [Coverage](COVERAGE.md).
158
+
159
+ ## Writes and recovery
160
+
161
+ Companion writes preview by default. Execution requires both `dryRun: false`
162
+ and the edge-internal `_edgeConfirmed: true` marker after a successful MCP
163
+ plan/apply confirmation. The companion trusts that local marker and does not
164
+ verify the edge HMAC. Anyone who can invoke Joomla CLI as the deployment account
165
+ is inside a trusted administrative boundary and could construct a confirmed
166
+ request. Restrict operating-system/CLI access; production MCP writes must go
167
+ through the edge plan/apply flow.
168
+
169
+ The companion delegates the actual change to Joomla, then returns structured
170
+ application/verification evidence. Before state, update, scheduler, site,
171
+ session, cache, user, extension, configuration, or destructive operations,
172
+ retain the Joomla backup and action-specific recovery procedure. An interrupted
173
+ operation has uncertain outcome until the native Joomla state is read back.
174
+
175
+ ## Edge site configuration
176
+
177
+ A local site entry fixes:
178
+
179
+ - Joomla root;
180
+ - PHP executable;
181
+ - allowed toolsets;
182
+ - process timeout;
183
+ - maximum output bytes.
184
+
185
+ The effective invocation is always:
186
+
187
+ ```text
188
+ <php> <joomla-root>/cli/joomla.php joomla:mcp:dispatch --input=- --format=json --no-interaction --no-ansi
189
+ ```
190
+
191
+ Tool calls cannot replace those paths or supply process environment. Run the
192
+ edge/companion under a dedicated operating-system account, never root. The
193
+ standard OCI edge contains neither PHP nor Joomla and is API-only. Use the host
194
+ systemd/bare deployment for native local actions and grant only the filesystem
195
+ access described in [Deployment](DEPLOYMENT.md).
196
+
197
+ ## Upgrade and rollback
198
+
199
+ Before upgrade, retain the previous companion ZIP and a tested Joomla
200
+ filesystem/database backup. Validate the new package on matching disposable
201
+ fixtures, install it with Joomla's extension installer, and compare the complete
202
+ description and actor permissions before re-enabling writes.
203
+
204
+ To roll back code, reinstall the retained previous ZIP through Joomla's native
205
+ installer and verify its description. Rolling back package files does not undo
206
+ Joomla state changes made by an action; apply the recorded native recovery
207
+ input or restore the tested Joomla backup.
208
+
209
+ ## Tests and remaining evidence
210
+
211
+ `php companion/tests/run.php` is dependency-free. It checks protocol framing,
212
+ strict envelopes, duplicate/unknown action rejection, pre-execution ACL denial,
213
+ fixed counts/schemas, field filtering, preview/confirmation, manifests,
214
+ native-adapter mappings, and the absence of generic command/caller-selected
215
+ execution primitives. The current suite has 23 checks and the package build is
216
+ validated in CI.
217
+
218
+ These are offline boundary checks. Native models and operational actions still
219
+ require installation, allowed/denied actor, mutation, postcondition, cleanup,
220
+ upgrade, rollback, and recovery tests on live Joomla 6.1 and 6.2 fixtures across
221
+ supported databases before production approval.
@@ -0,0 +1,104 @@
1
+ # Joomla 6.x reconnaissance
2
+
3
+ Examined on 22 July 2026 using Joomla source as the authority and the Manual as supporting documentation.
4
+
5
+ ## Branches
6
+
7
+ | Branch | Examined head | Role |
8
+ |---|---|---|
9
+ | `6.1-dev` | [`071afb7`](https://github.com/joomla/joomla-cms/tree/071afb7ad305c02983a653ccfc301b5c8360264b) | Implementation baseline |
10
+ | `6.2-dev` | [`df0e57d`](https://github.com/joomla/joomla-cms/tree/df0e57da1cf3febfd8d4da0c522b87f3d5c6aec5) | Forward compatibility |
11
+ | `7.0-dev` | [`b3a08ce`](https://github.com/joomla/joomla-cms/tree/b3a08ce4cbca0c77ff34c9b1abe1c431536dbb3f) | Canary only |
12
+
13
+ The Web Services route registrations and installed-site command names are effectively unchanged across these heads. Joomla 7 has active API and ACL refactoring and removes deprecated application-property access, so integration code must use getters and dependency injection.
14
+
15
+ ## CLI path
16
+
17
+ The installed-site entry point [`cli/joomla.php`](https://github.com/joomla/joomla-cms/blob/071afb7ad305c02983a653ccfc301b5c8360264b/cli/joomla.php) requires PHP 8.3, loads Joomla's framework and DI container, aliases CLI session services, obtains `Joomla\Console\Application`, and executes it.
18
+
19
+ Core commands are assembled from eager defaults in [`ConsoleApplication`](https://github.com/joomla/joomla-cms/blob/071afb7ad305c02983a653ccfc301b5c8360264b/libraries/src/Application/ConsoleApplication.php) and lazy service mappings in the [`Application` provider](https://github.com/joomla/joomla-cms/blob/071afb7ad305c02983a653ccfc301b5c8360264b/libraries/src/Service/Provider/Application.php). Enabled console plugins can add or shadow commands during `ApplicationEvents::BEFORE_EXECUTE`.
20
+
21
+ ### Installed-site command inventory
22
+
23
+ - Framework: `list`, `help`.
24
+ - Cache/config/site: `cache:clean`, `config:get`, `config:set`, `site:down`, `site:up`, `site:create-public-folder`.
25
+ - Core/update/extensions: `core:autoupdate:register`, `core:autoupdate:unregister`, `core:update`, `core:update:check`, `core:update:channel`, `update:extensions:check`, `update:joomla:remove-old-files`, `extension:list`, `extension:enable`, `extension:disable`, `extension:remove`, `extension:install`, `extension:discover`, `extension:discover:list`, `extension:discover:install`.
26
+ - Users: `user:list`, `user:add`, `user:addtogroup`, `user:removefromgroup`, `user:reset-password`, `user:delete`.
27
+ - Scheduler/search/maintenance/session: `scheduler:list`, `scheduler:run`, `scheduler:state`, `finder:index`, `maintenance:database`, `session:gc`, `session:metadata:gc`.
28
+ - Database: `database:export`, `database:import`.
29
+
30
+ Fresh installation through `installation/joomla.php install` is a separate provisioning concern.
31
+
32
+ ### CLI conclusions
33
+
34
+ - Output is human-oriented Symfony console output, not a stable JSON contract.
35
+ - CLI has no API-token ACL boundary; MCP policy must authorize every operation.
36
+ - `config:get` can disclose database and SMTP credentials and must never be exposed raw.
37
+ - `--no-interaction` skips confirmation in high-risk commands; it is automation behavior, not approval.
38
+ - Password arguments leak through process lists; the PHP bridge must accept secrets over stdin.
39
+ - URL extension installation is code execution and an SSRF surface.
40
+ - Database import drops tables before recreation.
41
+ - Run under a dedicated site deployment account, never root.
42
+
43
+ ## API path
44
+
45
+ Routes are registered by enabled plugins under [`plugins/webservices`](https://github.com/joomla/joomla-cms/tree/6.1-dev/plugins/webservices). [`ApiRouter::createCRUDRoutes`](https://github.com/joomla/joomla-cms/blob/6.1-dev/libraries/src/Router/ApiRouter.php) expands each base into list, get, create, patch, and delete routes.
46
+
47
+ Core currently declares 36 CRUD bases, producing 180 generic routes, plus 46 static special routes and 10 dynamic language-override routes per configured content language.
48
+
49
+ ### CRUD bases by domain
50
+
51
+ | Domain | Base paths |
52
+ |---|---|
53
+ | Content | `v1/content/articles`, `v1/content/categories` |
54
+ | Banners | `v1/banners`, `v1/banners/clients`, `v1/banners/categories` |
55
+ | Contacts | `v1/contacts`, `v1/contacts/categories` |
56
+ | Menus | `v1/menus/site`, `v1/menus/administrator`, site/admin item routes |
57
+ | Modules | `v1/modules/site`, `v1/modules/administrator` |
58
+ | Users | `v1/users`, `v1/users/groups`, `v1/users/levels` |
59
+ | Tags/templates/languages/messages | Tags, site/admin template styles, content languages, messages |
60
+ | Newsfeeds/redirects | `v1/newsfeeds/feeds`, `v1/newsfeeds/categories`, `v1/redirects` |
61
+ | Fields | Content, contact, and user field and field-group contexts |
62
+
63
+ Special routes cover contact submission, menu/module types, plugin state, media, configuration, installed extensions, privacy, language packages/overrides, limited content history, and Joomla Update.
64
+
65
+ ### API contract
66
+
67
+ - URL: `https://site.example/api/index.php/v1/...`.
68
+ - Authentication: `Authorization: Bearer TOKEN` or `X-Joomla-Token`; bearer form is used here.
69
+ - Normal API users require `core.login.api` plus component ACL.
70
+ - Responses use JSON:API-style resources.
71
+ - POST/PATCH bodies are flat Joomla form JSON, not a JSON:API `data.attributes` envelope.
72
+ - Default pagination is `page[offset]=0&page[limit]=20`; core has no clear generic maximum, so MCP imposes one.
73
+ - There is no OpenAPI, route-discovery, or capability endpoint.
74
+ - Joomla Update is separate: it uses `X-JUpdate-Token` and Auto Update configuration, not the normal API token.
75
+
76
+ ### Corrections to the supplied action inventory
77
+
78
+ - There is no standalone Web Services - Fields plugin; Content, Contact, and Users plugins register those routes.
79
+ - Content history is limited to articles, contacts, and banners, and its keep/delete ID semantics need contract tests.
80
+ - Contact-form submission still requires API authentication.
81
+ - Language-override routes are dynamically generated per content language.
82
+ - `GET v1/extensions` only lists extensions; it cannot install, update, remove, discover, or repair them.
83
+ - Plugin patching accepts only a narrow field set.
84
+ - Media identifiers are greedy paths, not numeric IDs.
85
+ - Delete lifecycle is model-specific; trash-first is not universal.
86
+ - Messages and template styles are direct-delete exceptions, with additional model rules.
87
+ - Joomla Update needs its own credential and separately enabled high-risk toolset.
88
+
89
+ ## Integration decisions derived from core
90
+
91
+ The implementation uses the Web Services route when core provides the needed
92
+ remote operation. A local semantic action is added only when structured output,
93
+ stdin-only secret handling, an effective actor ACL check, or a missing remote
94
+ administration capability requires it.
95
+
96
+ The companion must call native Joomla services or fixed administrator models;
97
+ it must not reproduce their domain behavior. Stock CLI commands are not exposed
98
+ through a generic executor. Each accepted local operation needs a named schema,
99
+ fixed native target, explicit permission and risk, bounded result, postcondition,
100
+ and recovery contract. Arbitrary shell, PHP, SQL, filesystem paths, Joomla roots,
101
+ models, methods, commands, or outbound URLs remain outside the architecture.
102
+
103
+ See [Architecture](ARCHITECTURE.md) for the decision rules and
104
+ [Coverage](COVERAGE.md) for the implemented and verified status of each family.