You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -200,6 +201,122 @@ Depending on your environment, you may have to delay updating to the minimum Nod
200
201
}
201
202
```
202
203
204
+
### Running via container (podman)
205
+
206
+
The server can also be launched from a container image instead of `npx`. This is useful when you want a pinned, sandboxed runtime that doesn't depend on the host's Node.js installation. Running with an MCP client simply spawns `podman` (or `docker`) instead of `npx`.
207
+
208
+
> **Prerequisites:**
209
+
> You can use Podman or Docker to run the container.
210
+
>
211
+
> We recommend using Podman Desktop for convenience:
You can confirm by running `$ podman images` from the terminal. View the [Containerfile](../Containerfile) for the image definition.
236
+
237
+
#### Running your local image, MCP client configuration
238
+
239
+
```json
240
+
{
241
+
"mcpServers": {
242
+
"patternfly-mcp": {
243
+
"command": "podman",
244
+
"args": [
245
+
"run", "--rm", "-i",
246
+
"--userns=keep-id",
247
+
"--security-opt=no-new-privileges",
248
+
"--cap-drop=ALL",
249
+
"localhost/patternfly-mcp:latest",
250
+
"--log-stderr"
251
+
],
252
+
"description": "PatternFly rules and documentation (local container)"
253
+
}
254
+
}
255
+
}
256
+
```
257
+
258
+
> **Important**:
259
+
> -`-i` (interactive stdin) is **required** for stdio MCP. Do **not** pass `-t`. Anything appended after the image name is forwarded verbatim to the CLI, so every flag (`--verbose`, `--http`, `--port`, `--tool`, ...) works without rebuilding.
260
+
> - The same configuration should work with `docker`, just replace `"command": "podman"` with `"command": "docker"`.
261
+
262
+
#### Smoke test
263
+
264
+
```bash
265
+
podman run --rm localhost/patternfly-mcp:latest node -e "console.log(process.versions.node)"# -> 24.x
266
+
```
267
+
268
+
#### Running in HTTP transport mode
269
+
270
+
The image's `ENTRYPOINT` forwards every argument straight to the CLI, so HTTP mode works against the **same image** with no rebuild — just publish a port and pass `--http --port`.
271
+
272
+
```bash
273
+
podman run --rm \
274
+
--userns=keep-id \
275
+
--security-opt=no-new-privileges \
276
+
--cap-drop=ALL \
277
+
--read-only \
278
+
--tmpfs /tmp:rw,size=64m \
279
+
-p 3030:8080 \
280
+
localhost/patternfly-mcp:latest \
281
+
--http --port 8080 \
282
+
--allowed-origins "http://127.0.0.1:3030" \
283
+
--allowed-hosts "127.0.0.1" \
284
+
--log-stderr
285
+
```
286
+
287
+
Notes:
288
+
-`-p <host>:<container>` publishes the port. The container-side port (`8080` above) must match `--port`. The host-side port is whatever you want clients to connect to.
289
+
-`8080` inside the container matches the port the UBI Node.js base already advertises via `EXPOSE`, and a non-root user can bind it without extra capabilities.
290
+
-`-i` (interactive stdin) is **not** required in HTTP mode and is omitted here.
291
+
-`--allowed-origins` and `--allowed-hosts` are required guardrails when the server is reachable beyond stdio; set them explicitly.
292
+
-`--read-only` is safe today because the server writes nothing to the rootfs (only `/tmp`, which is a tmpfs). When the persistent SQLite cache lands, you will need to either drop `--read-only` or mount a writable volume for the cache directory.
293
+
- TLS is out of scope for the image itself. For anything beyond `localhost`, terminate TLS at a reverse proxy (Caddy, nginx, an OpenShift route, etc.).
294
+
295
+
##### MCP client configuration (HTTP)
296
+
297
+
HTTP MCP clients connect via URL rather than spawning a process. Start the container separately (e.g. with the command above, `podman-compose`, or a systemd unit) and point the client at the published host port:
298
+
299
+
```json
300
+
{
301
+
"mcpServers": {
302
+
"patternfly-mcp": {
303
+
"url": "http://localhost:3030",
304
+
"description": "PatternFly rules and documentation (HTTP transport, containerized)"
305
+
}
306
+
}
307
+
}
308
+
```
309
+
310
+
> Stdio-only MCP clients should keep using the [stdio container configuration above](#running-your-local-image-mcp-client-configuration); the HTTP form requires a client that supports HTTP/SSE MCP transports.
311
+
312
+
##### Verify it's listening
313
+
314
+
```bash
315
+
curl -sS -i http://localhost:3030/ | head -20
316
+
```
317
+
318
+
`--log-stderr` will print the registered routes at startup, which is the easiest way to confirm the server bound the expected port.
319
+
203
320
## Custom MCP tool plugins
204
321
205
322
You can extend the server's capabilities by loading custom **Tool Plugins** at startup.
0 commit comments