@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
package/README.md ADDED
@@ -0,0 +1,279 @@
1
+ # JoomEngine MCP for Joomla
2
+
3
+ An embeddable library and self-hosted Model Context Protocol (MCP) server for
4
+ administering Joomla 6.x through bounded, auditable semantic actions.
5
+
6
+ The server has two Joomla integration paths:
7
+
8
+ - **Joomla Web Services API:** remote HTTPS access with a dedicated Joomla API identity.
9
+ - **Joomla-native companion:** local access through an installable console plugin, Joomla dependency injection, ACL checks, and core models.
10
+
11
+ Native Joomla capabilities are the authority. The companion adapts native Joomla services and models to a structured JSON contract; it does not replace or reimplement Joomla functionality. There is no generic HTTP, CLI, shell, PHP, SQL, filesystem, model, method, or URL passthrough.
12
+
13
+ Joomla 6.1 is the implementation baseline, Joomla 6.2 is the compatibility target, and Joomla 7 is tested as a canary.
14
+
15
+ > **Production status:** all 236 Joomla 6.1 core Web Services route templates are source-catalogued, but five are explicitly source-only and no family has completed the required live Joomla 6.1/6.2 success, denial, postcondition, and recovery matrix. Production certification remains gated on that evidence, deeper value/output contracts, privileged recovery tests, and shared coordination for multi-replica writes. See [coverage and release status](docs/COVERAGE.md).
16
+
17
+ ## Why this stack
18
+
19
+ TypeScript is a Tier 1 MCP SDK while PHP is Tier 3. For convenience, TypeScript is used and PHP where possible.
20
+
21
+ ## Capabilities
22
+
23
+ - Source-backed semantic catalogue for all 236 Joomla 6.1 core Web Services route templates.
24
+ - CRUD actions for the 36 core resource bases, including articles, banners, users, contacts, categories, menus, modules, tags, redirects, fields, templates, languages, messages, and newsfeeds.
25
+ - Reviewed field allowlists for every CRUD mutation family and exact schemas for fixed-shape media, privacy, plugin, language-override, application-configuration, and Joomla Update mutations.
26
+ - Explicit source-only gates for routes that are defective in Joomla 6.1 or require unimplemented runtime secret/schema discovery.
27
+ - Joomla-native local actions through a fixed companion allowlist.
28
+ - Read-only discovery, safe configuration filtering, and immutable multi-site aliases.
29
+ - Guarded writes using explicit principal-bound operator grants (`once`, `30-minutes`, or `indefinite`), preview, signed one-time plans, idempotency, locks, audit events, and verification where supported.
30
+ - MCP over stdio or authenticated Streamable HTTP.
31
+ - Versioned ESM package with typed root and subpath exports for host applications.
32
+ - OCI image, Docker Compose, and systemd deployment foundations.
33
+ - Interactive and unattended catalogue-complete live validation with
34
+ deterministic Joomla fixtures, safety confirmation, and redacted
35
+ Markdown/JSON/JUnit failure evidence.
36
+
37
+ The generated [API action reference](docs/API_ACTIONS.md) lists every route, semantic ID, accepted field set, transport, risk, and source-only gate. The release truth table is in [docs/COVERAGE.md](docs/COVERAGE.md). An implemented action is not described as production-verified until it has passed the corresponding live Joomla matrix.
38
+
39
+ ## Requirements
40
+
41
+ - Node.js 22.12 or newer.
42
+ - Joomla 6.1 or newer for companion use; a Joomla 6.x site for API use.
43
+ - PHP 8.3 or newer on a host using the companion.
44
+ - HTTPS and a dedicated least-privilege Joomla API user for remote API access.
45
+ - An OAuth/OIDC authorization server with a HTTPS JWKS endpoint for remote MCP access.
46
+
47
+ ## Use as a library dependency
48
+
49
+ Install the public, versioned package:
50
+
51
+ ```bash
52
+ npm install @joomengine/joomla-mcp@^0.7.0
53
+ ```
54
+
55
+ Create a transport-neutral application without starting a process or binding a
56
+ port:
57
+
58
+ ```js
59
+ import {
60
+ createJoomlaMcp,
61
+ loadConfiguration,
62
+ } from '@joomengine/joomla-mcp';
63
+
64
+ const configuration = await loadConfiguration('/etc/joomla-mcp/sites.json');
65
+ const application = createJoomlaMcp({ configuration });
66
+ const mcpServer = application.createServer();
67
+ ```
68
+
69
+ The package retains the complete catalogue, reads, guarded writes,
70
+ administration actions, grant workflow, Joomla API and companion transports,
71
+ stdio and authenticated HTTP support. Host applications may inject secret
72
+ resolution, audit, API, and CLI adapters while the action and security
73
+ boundaries remain controlled by this package.
74
+
75
+ See [library integration](docs/LIBRARY.md) for every public entry point,
76
+ configuration and secret-manager integration, stdio/HTTP lifecycle, adapter
77
+ contracts, isolation rules, executable examples, and compatibility policy.
78
+
79
+ ## Install and validate
80
+
81
+ ```bash
82
+ git clone https://github.com/joomengine/joomla-mcp.git
83
+ cd joomla-mcp
84
+ npm ci
85
+ cp config/sites.example.json config/sites.json
86
+ npm run validate
87
+ ```
88
+
89
+ Edit `config/sites.json`, then export every secret named by `tokenEnv`, `updateTokenEnv`, and `approval.secretEnv`. Tokens and approval secrets are never stored in the site file.
90
+
91
+ For write-enabled sites, generate an approval secret of at least 32 random characters:
92
+
93
+ ```bash
94
+ export JOOMLA_MCP_APPROVAL_SECRET="$(openssl rand -hex 32)"
95
+ ```
96
+
97
+ Do not put production secrets in shell history, source control, client configuration, or command arguments. Use the operating-system service manager or a secret store.
98
+
99
+ To build the companion and prove a fresh installation plus the complete live
100
+ MCP matrix against the repository's disposable Joomla 6.1/JoomEngine fixture:
101
+
102
+ ```bash
103
+ php companion/build.php
104
+ npm run test:fixture:joomengine
105
+ ```
106
+
107
+ This requires Docker with Compose v2. The fixture uses fresh isolated volumes,
108
+ publishes Joomla only on a random loopback port, generates throwaway
109
+ credentials and an ephemeral API token, inventories installed CLI contracts,
110
+ then exercises the full action catalogue through API/companion and
111
+ stdio/Streamable HTTP before removing the site and database. Failures upload
112
+ redacted Markdown, JSON, JUnit, per-action evidence, and runtime logs before
113
+ teardown. See [live validation](docs/LIVE_TESTING.md).
114
+
115
+ The packaged declarative scenario is `config/live-test.default.json`. It
116
+ creates and independently verifies several categories, articles, user groups,
117
+ users, banner categories, banners, menus, article menu items, and custom HTML
118
+ modules. Relationships use named references in JSON; Joomla IDs are resolved
119
+ only after the referenced record has been created and independently observed.
120
+ Private-message tests likewise resolve each path's authenticated account from
121
+ the human-readable `target.actorUsernames` scenario setting before sending.
122
+ Pass `--scenario /path/to/override.json` to replace the packaged scenario, or
123
+ omit a resource family from the override to skip that family.
124
+
125
+ To retain every created record for inspection in Joomla without issuing any
126
+ delete or trash operation:
127
+
128
+ ```bash
129
+ npm run test:live -- \
130
+ --scenario ./config/live-test.default.json \
131
+ --config /absolute/path/to/config/sites.json \
132
+ --site demo \
133
+ --profile crud \
134
+ --non-interactive \
135
+ --confirm-mutations \
136
+ --cleanup never
137
+ ```
138
+
139
+ The runner writes `START`, `WAIT`, and terminal status lines to standard output
140
+ as each phase runs, while preserving the full Markdown, JSON, JUnit, per-action,
141
+ and fixture-log artifacts.
142
+
143
+ To select a live demo site interactively:
144
+
145
+ ```bash
146
+ npm run build
147
+ npx joomla-mcp-live-test
148
+ ```
149
+
150
+ Mutation profiles print the exact target and require a typed hostname/run-seed
151
+ acknowledgement. Unattended mutation runs require explicit
152
+ `--confirm-mutations`; the full privileged profile additionally requires
153
+ `--disposable`.
154
+
155
+ ## Use over stdio
156
+
157
+ Build and start the server:
158
+
159
+ ```bash
160
+ npm run build
161
+ JOOMLA_MCP_CONFIG=/absolute/path/to/config/sites.json npm start
162
+ ```
163
+
164
+ Example MCP client entry:
165
+
166
+ ```json
167
+ {
168
+ "mcpServers": {
169
+ "joomla": {
170
+ "command": "node",
171
+ "args": ["/opt/joomla-mcp/dist/bin/joomla-mcp.js"],
172
+ "env": {
173
+ "JOOMLA_MCP_CONFIG": "/etc/joomla-mcp/sites.json"
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ The process environment must also contain the token and approval-secret variables referenced by the site file. Stdio inherits the permissions of the local MCP client, so use a dedicated operating-system account for production.
181
+
182
+ ## Use over Streamable HTTP
183
+
184
+ Add the `http` block shown in `config/sites.example.json`, then run:
185
+
186
+ ```bash
187
+ npm run build
188
+ JOOMLA_MCP_CONFIG=/etc/joomla-mcp/sites.json npm run start:http
189
+ ```
190
+
191
+ The HTTP entry point requires cryptographically verified JWTs and validates issuer, audience, scopes, exact `Host`, optional `Origin`, request limits, and principal-bound sessions. `/healthz` is shallow process liveness; `/readyz` warms and validates the configured JWKS dependency before the instance receives MCP traffic. Graceful shutdown stops new admission, closes idle connections, waits for active connections up to `shutdownGraceMs`, and then force-closes them. Terminate TLS at a trusted reverse proxy and keep the Node listener on a private interface. See [remote HTTP](docs/REMOTE_HTTP.md) and [deployment](docs/DEPLOYMENT.md).
192
+
193
+ ## Use the Joomla companion
194
+
195
+ Build and test the installable package:
196
+
197
+ ```bash
198
+ php companion/tests/run.php
199
+ php companion/build.php
200
+ ```
201
+
202
+ Install the generated `companion/dist/pkg_joomlamcp-*.zip` with Joomla's extension installer. A first installation enables **Console - JoomEngine MCP for Joomla Companion** through Joomla's native installer lifecycle; package updates preserve the operator's enabled/disabled state. Select a dedicated least-privilege **MCP actor user**, and configure the site's fixed Joomla root and PHP executable in `config/sites.json`.
203
+
204
+ Verify from the Joomla root:
205
+
206
+ ```bash
207
+ php cli/joomla.php joomla:mcp:describe --format=json --no-interaction --no-ansi
208
+ ```
209
+
210
+ The edge invokes only the companion's named, schema-validated actions over JSON stdin. See [PHP companion](docs/PHP_COMPANION.md).
211
+
212
+ ## Joomla API setup
213
+
214
+ For each site:
215
+
216
+ 1. Enable **API Authentication - Web Services Joomla Token**.
217
+ 2. Enable **User - Joomla API Token** and permit a dedicated automation group.
218
+ 3. Give the automation group `core.login.api` and only the component permissions required by its enabled toolsets.
219
+ 4. Enable only the Web Services plugins needed by those toolsets.
220
+ 5. Create the user's Joomla API token and place it in the environment variable named by `tokenEnv`.
221
+ 6. Confirm that `https://your-site.example/api/index.php/v1/content/articles` responds using that token.
222
+
223
+ Joomla Update uses a separate token referenced by `updateTokenEnv`. Do not reuse or expose either token to MCP clients.
224
+
225
+ ## Writes
226
+
227
+ Writes are disabled unless the relevant site toolset and approval configuration are enabled. The normal flow is:
228
+
229
+ 1. Search the catalogue and select a fixed semantic action.
230
+ 2. Call `joomla_action_describe` to inspect its complete schema, source, configured transport availability, and certification state.
231
+ 3. Call `joomla_action_write_plan` with a UUID idempotency key and `dryRun: true` to inspect the operation. Companion plans execute Joomla's native non-mutating preflight and bind its redacted result into the plan.
232
+ 4. Call `joomla_permission_request` for the exact site, write/administration toolsets, reason, and duration.
233
+ 5. Show the returned acknowledgement phrase to the operator. Submit it to `joomla_permission_approve` only after the operator supplies it exactly.
234
+ 6. Repeat the write plan with `dryRun: false`; an active matching grant is required and the returned token is bound to that grant.
235
+ 7. Call `joomla_write_apply` with the token. Apply rechecks the authenticated principal, site/toolset scopes, grant, stored plan, and Joomla preconditions before executing.
236
+ 8. Verify the resulting resource and the permission/plan/apply audit events.
237
+
238
+ One-operation grants are consumed by one apply attempt. Thirty-minute grants expire exactly 30 minutes after approval. Indefinite grants are disabled by default, require an integrity-protected persistent store, and remain active only until explicitly revoked. Grants never override site configuration, OAuth scopes, Joomla token permissions, or Joomla ACL.
239
+
240
+ Do not enable destructive or privileged toolsets until their live and recovery gates in [docs/COVERAGE.md](docs/COVERAGE.md) have passed for your environment.
241
+
242
+ ## Documentation
243
+
244
+ - [Architecture and native-first rules](docs/ARCHITECTURE.md)
245
+ - [Library and host-application integration](docs/LIBRARY.md)
246
+ - [Versioning and coordinated package releases](docs/RELEASING.md)
247
+ - [Single-company, single-site deployment](docs/SINGLE_SITE.md)
248
+ - [ChatGPT, Codex, Claude, Gemini, and Grok connections](docs/CLIENTS.md)
249
+ - [Generated Joomla API action reference](docs/API_ACTIONS.md)
250
+ - [Action coverage and release status](docs/COVERAGE.md)
251
+ - [Deployment, upgrades, and rollback](docs/DEPLOYMENT.md)
252
+ - [Fixture setup and live verification](docs/FIXTURES.md)
253
+ - [Interactive, unattended, and CI live validation](docs/LIVE_TESTING.md)
254
+ - [Operations and monitoring](docs/OPERATIONS.md)
255
+ - [PHP companion](docs/PHP_COMPANION.md)
256
+ - [Remote Streamable HTTP](docs/REMOTE_HTTP.md)
257
+ - [Security model](docs/SECURITY.md)
258
+ - [Testing](docs/TESTING.md)
259
+ - [Troubleshooting](docs/TROUBLESHOOTING.md)
260
+ - [MCP tools and use cases](docs/USAGE.md)
261
+ - [Joomla CLI inventory and integration mapping](docs/CLI.md)
262
+
263
+ ## Development and contribution
264
+
265
+ ```bash
266
+ npm run check
267
+ npm test
268
+ npm run build
269
+ php companion/tests/run.php
270
+ php companion/build.php
271
+ ```
272
+
273
+ `npm run validate` runs TypeScript checking, the offline test suite, and the production build. See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution requirements and [SECURITY.md](SECURITY.md) for private vulnerability reporting.
274
+
275
+ ## License
276
+
277
+ Copyright (C) 2026 Vast Development Method.
278
+
279
+ JoomEngine MCP for Joomla is free software licensed under the **GNU General Public License, version 2 or, at your option, any later version** (`GPL-2.0-or-later`). You may use, modify, and redistribute it under those terms. The complete license text is in [LICENSE](LICENSE).
package/SECURITY.md ADDED
@@ -0,0 +1,39 @@
1
+ # Security policy
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ Do not disclose a suspected vulnerability in a public issue, discussion, pull
6
+ request, log, or test fixture.
7
+
8
+ Use GitHub's private vulnerability reporting flow for this repository:
9
+
10
+ 1. Open the repository's **Security** tab.
11
+ 2. Select **Advisories** and **Report a vulnerability**.
12
+ 3. Include the affected commit or release, deployment mode, reproduction steps,
13
+ impact, and a minimal redacted proof of concept.
14
+ 4. Remove Joomla tokens, OAuth tokens, approval secrets, passwords, private URLs,
15
+ user data, and production content.
16
+
17
+ If private vulnerability reporting is unavailable, open a public issue that
18
+ asks a maintainer for a private reporting channel without including security
19
+ details.
20
+
21
+ Maintainers will acknowledge the report through the private channel, validate
22
+ its scope, coordinate a fix and release, and credit the reporter if requested.
23
+ Do not test against a Joomla installation you do not own or have explicit
24
+ permission to assess.
25
+
26
+ ## Supported code
27
+
28
+ Until stable versioned releases are published, security fixes target the latest
29
+ `main` branch. After versioned releases begin, the repository release notes will
30
+ identify supported release lines. Unsupported snapshots should be upgraded
31
+ before reporting behavior already corrected on `main`.
32
+
33
+ ## Deployment responsibility
34
+
35
+ This project is not yet production-certified. Operators are responsible for
36
+ keeping privileged toolsets disabled until the relevant live and recovery gates
37
+ in [docs/COVERAGE.md](docs/COVERAGE.md) pass in their environment. Follow the
38
+ [security model](docs/SECURITY.md), use dedicated least-privilege Joomla actors,
39
+ and keep the Node listener and companion process off untrusted networks.