Repository navigation
mcp-test-v1.1.1
Highlights
This release closes two subtasks from the audit-inspection roadmap (#8): the notification recorder and the PR #5 review-fix cleanup. Together with the bundled hardening they make the full request/response capture pipeline production-ready.
What you get:
- Server-initiated notifications now land in
audit_payloads.notifications. Everynotifications/progress,notifications/message, and any futurenotifications/*your tools dispatch viareq.Session.NotifyProgress/LogMessageis captured during the call window and stored alongside the request and response. The portal will surface these in the upcoming inspection drawer; today they're queryable directly viaGET /api/v1/portal/audit/events/{id}. - Redaction extended to notifications.
audit.redact_keysnow applies to notification params, not just tool params. A tool that emits a token in a progress message no longer bypasses the operator's redact list. - Notifications are byte-bounded. A
LogMessagewith a largedatablob can't blow pastaudit.max_payload_bytes; the captured slice is trimmed from the tail withnotifications_truncatedset so operators can tell. - Content annotations preserved.
audit_payloads.response_result.content[]round-trips image, audio, embedded resource, and resource-link blocks through their SDK MarshalJSON, so annotations on those blocks survive into the captured payload (previously they were dropped to{type: unknown}). error_categoryis consistent. The indexedaudit_events.error_categoryand the detail row'sresponse_error.categorynow always agree acrossauth,tool, andhandlererrors. The portal can filter on the indexed column without string-matching against the message.- CI tooling pinned in
make verify. Local lint and security checks now install and use the exact versions CI runs (golangci-lint v2.11.4, gosec v2.25.0) intobin/tools/instead of relying on$PATH. A pre-mergemake verifywill no longer green-light something that fails CI minutes later.
Breaking changes
None at the API or wire level. The schema cleanup migration drops three columns (jsonrpc_id, request_method, request_path) that the audit middleware never populated since v1.1.0; if you had ad-hoc tooling reading those, they were always empty.
Schema migration
A new migration 0003_audit_payloads_cleanup runs on first start after upgrade. It:
DROP COLUMN IF EXISTS jsonrpc_idDROP COLUMN IF EXISTS request_methodDROP COLUMN IF EXISTS request_pathADD COLUMN IF NOT EXISTS notifications_truncated BOOLEAN NOT NULL DEFAULT false
Migration 0002 was deliberately not edited in place; v1.1.0 operators get the same final shape via 0003, greenfield installs apply 0001 + 0002 (v1.1.0 schema) + 0003 and converge there.
Configuration
No required changes. Two existing knobs got new effective scope:
| Setting | Default | Notes |
|---|---|---|
audit.capture_payloads |
true (when unset) |
Enables the sibling audit_payloads row, including the new notifications array. Set to false to keep summary-only behavior. |
audit.max_payload_bytes |
65536 |
Now also bounds the notifications slice as a unit, in addition to request / response sides. |
audit.max_notifications |
100 |
Existing knob; per-call count cap on the recorder. |
audit.redact_keys |
[] |
Substrings (case-insensitive) of param keys to redact. Now applies to notification params too. |
What changed
pkg/mcpmw
- New
mcpmw.Notifications()sending-side middleware. Wired alongsidemcpmw.Audit(...)at server boot viasrv.AddSendingMiddleware(...). Records everynotifications/*method dispatched while a tool-call window is open into a per-request recorder seeded by the receiving Audit middleware. notificationRecorderis concurrency-safe; tools that fan out goroutines and callNotifyProgressfrom each can do so without external synchronization. JSON marshal and redaction run outside the recorder mutex so concurrent calls don't serialize.- The recorder applies
redactKeysat append time. Once the tool-call window closes, the snapshot is taken; goroutines that fire later are silently dropped from that snapshot (this is documented and tested). - Payload assembly trims notifications from the tail with a single linear pass to fit
max_payload_bytes;audit_payloads.notifications_truncatedflags the trim. error_categoryis assigned once after the call returns, soev.ErrorCategoryandpayload.response_error.categoryare always equal. Auth-failure category propagates to both fields.
pkg/audit
audit.Notificationstruct:{ts, method, params}.audit.PayloadgainsNotifications []NotificationandNotificationsTruncated bool.audit.SanitizeParametersshort-circuits whenredactKeysis empty (returns the input map without a deep copy). Hot-path optimization that affects every audit row.
pkg/httpsrv
GET /api/v1/portal/audit/events/{id}validates the id as a UUID at the boundary. Anything else returns 400, blocking the gosec G706 (log injection) flow on the soft-fail WARN log if the payload fetch errors.
CI / verify
Makefile: newtools-installtarget installs golangci-lint v2.11.4 and gosec v2.25.0 intobin/tools/with a version-stamped sentinel for idempotent reinstalls.lint,gosec,govulncheckusebin/tools/<binary>instead of whateverwhichfinds first.tools-checkshows resolved tool versions instead of just confirming presence.
Tests added
pkg/mcpmw/notifications_test.go: recorder concurrency, count cap, redact-keys propagation, post-snapshot append behavior, sending middleware wiring.pkg/mcpmw/audit_payload_test.go: end-to-end notification capture; byte cap trimming withNotificationsTruncatedassertion; redact-keys end-to-end; handler-error category consistency between event and payload; auth-failure category.pkg/audit/postgres/store_test.go: testcontainer-backed Postgres store roundtrip exercising every captured column includingNotificationsTruncated; cascade delete of payload row when the parent event is deleted.tests/audit_notifications_test.go: full HTTP-stack integration test that calls the streamingprogresstool with aProgressTokenand asserts the resulting audit row carries the notifications. Locks the SDK contract thatServer.AddSendingMiddlewarefires onServerSession.NotifyProgress.
Upgrade
docker pull ghcr.io/plexara/mcp-test:v1.1.1The 0003_audit_payloads_cleanup migration runs automatically on start. No restart-time downtime expected; the migration only touches audit_payloads, not the indexed audit_events summary table.
Roadmap
Remaining subtasks from #8 will land in subsequent releases:
- Replay endpoint (
POST /audit/events/{id}/replay) - SSE live tail (
GET /audit/stream) - JSONB path filter compiler (
?param.<path>=...,?has=...) - NDJSON export
- Portal UI inspection drawer (Overview / Request / Response / Notifications tabs)
- Side-by-side comparison page
docs/operations/inspection.mdwalkthrough
Changelog
Features
Bug Fixes
- 0b8452f: fix(audit): address PR #5 critical review (@cjimti)
- 34ee489: fix(audit): address PR #9 critical review (@cjimti)
- c1489ed: fix(audit): address PR #9 second review and CI lint/security failures (@cjimti)
Installation
Container
docker pull ghcr.io/plexara/mcp-test:v1.1.1Binary (macOS / Linux)
curl -L -o mcp-test.tar.gz \
https://github.com/plexara/mcp-test/releases/download/v1.1.1/mcp-test_1.1.1_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz
tar -xzf mcp-test.tar.gz
./mcp-test --versionDocumentation
Full docs at https://mcp-test.plexara.io.
Open source by Plexara, the commercial MCP server with configurable enrichment built in.