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
Add timeout/logging/audit/CLI features for 0.5.0 release
MCP_TIMEOUT wasn't applied to HTTP transport, OAuth callback used a
hardcoded port range, audit logs were ephemeral in containers, and
there was no structured logging or shell completions.
Apply MCP_TIMEOUT to reqwest client builder, make OAuth callback port
configurable via MCP_OAUTH_CALLBACK_PORT (single, range, or OS-assigned),
add tracing-based structured logging with MCP_LOG_LEVEL/MCP_LOG_FORMAT,
add MCP_AUDIT_OUTPUT=stdout/stderr for container log drivers, and
introduce mcp config path/edit and mcp completions commands.
Fixes#13Fixes#16Fixes#76Fixes#71Fixes#9Fixes#8Fixes#5
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
When disabled, the logger is a no-op and the database is not initialized — zero overhead, no files created, no filesystem writes. This is the default in the Docker image.
218
219
220
+
## Streaming to stdout/stderr (containers)
221
+
222
+
In containers, writing audit to ChronDB is often impractical — the filesystem may be read-only, ephemeral, or you want logs flowing to your container log driver (CloudWatch, Datadog, etc.).
223
+
224
+
Set `output` to `stdout` or `stderr` to emit audit entries as newline-delimited JSON (one JSON object per line):
When using `stdout` or `stderr` mode, `mcp logs` queries are not available (no database to query). Use your log aggregation pipeline instead.
247
+
248
+
Set `output` to `none` to disable audit entirely without touching the `enabled` flag.
249
+
219
250
## Environment variable overrides
220
251
221
252
All audit settings can be overridden via environment variables, which take priority over the config file. This is useful for container deployments where editing the config JSON is impractical.
222
253
223
254
| Variable | Overrides | Description |
224
255
|---|---|---|
225
256
|`MCP_AUDIT_ENABLED`|`audit.enabled`| Set to `false` or `0` to disable |
257
+
|`MCP_AUDIT_OUTPUT`|`audit.output`|`file`, `stdout`, `stderr`, or `none`|
226
258
|`MCP_AUDIT_PATH`|`audit.path`| ChronDB data directory |
227
259
|`MCP_AUDIT_INDEX_PATH`|`audit.index_path`| ChronDB index directory |
228
260
@@ -237,4 +269,12 @@ docker run -d \
237
269
ghcr.io/avelino/mcp serve --http 0.0.0.0:8080
238
270
```
239
271
272
+
Example: stream audit to container stdout (no volume needed):
273
+
274
+
```bash
275
+
docker run -d \
276
+
-e MCP_AUDIT_OUTPUT=stdout \
277
+
ghcr.io/avelino/mcp serve --http 0.0.0.0:8080
278
+
```
279
+
240
280
See the full list of variables in the [environment variables reference](../reference/environment-variables.md).
Copy file name to clipboardExpand all lines: docs/howto/docker.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,21 @@ docker run -d \
115
115
116
116
### With audit logging
117
117
118
-
The default image disables audit logging (`MCP_AUDIT_ENABLED=false`) because `scratch` images have no writable filesystem. To enable it, mount a volume and override:
118
+
The default image disables audit logging (`MCP_AUDIT_ENABLED=false`) because `scratch` images have no writable filesystem. You have two options:
@@ -194,4 +211,4 @@ docker run --rm ghcr.io/avelino/mcp:0.1.0 --help
194
211
195
212
-**Stdio servers only work if the runtime is available inside the container.** The default image includes only the `mcp` binary and `ca-certificates`. Servers that require `npx`, `python`, or other runtimes won't work unless you build a custom image. HTTP servers (configured with `url`) work out of the box.
196
213
-**OAuth browser flow doesn't work in Docker.** For HTTP servers that need OAuth, run `mcp add <server>` on your host first to complete authentication, then mount the config directory (which includes `auth.json`), or set `MCP_AUTH_PATH` to a mounted volume.
197
-
-**Audit logging is disabled by default** in the Docker image because `scratch` images have no writable filesystem. Enable it with `MCP_AUDIT_ENABLED=true` and mount a volume for the data.
214
+
-**Audit logging is disabled by default** in the Docker image because `scratch` images have no writable filesystem. Use `MCP_AUDIT_OUTPUT=stdout` to stream to the container log driver, or mount a volume and set `MCP_AUDIT_ENABLED=true`.
Copy file name to clipboardExpand all lines: docs/howto/kubernetes.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,11 @@ The proxy exposes `GET /health` returning:
124
124
125
125
By default, audit logging is disabled (`MCP_AUDIT_ENABLED=false`) because the scratch-based image has no writable filesystem.
126
126
127
-
To enable:
127
+
**Option A: Stream to stdout (no PVC needed)**
128
+
129
+
Set `MCP_AUDIT_OUTPUT=stdout` in the Deployment env. Audit entries are emitted as JSON lines to stdout and captured by your cluster's log pipeline (Fluentd, Loki, CloudWatch, etc.). No persistent storage required.
130
+
131
+
**Option B: Persist to a PVC**
128
132
129
133
1. Set `MCP_AUDIT_ENABLED=true` in the Deployment env
130
134
2. Mount persistent storage at `/data`:
@@ -207,6 +211,7 @@ When Kubernetes sends `SIGTERM` (during rolling updates or scale-down):
0 commit comments