Skip to content

feat(examples): mcp gateway records with policy decisions and content digests#834

Merged
jithinraj merged 2 commits into
mainfrom
feat/mcp-gateway-receipts
Jun 11, 2026
Merged

feat(examples): mcp gateway records with policy decisions and content digests#834
jithinraj merged 2 commits into
mainfrom
feat/mcp-gateway-receipts

Conversation

@jithinraj

@jithinraj jithinraj commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Adds a runnable example and an outcome-led recipe for the gateway sign-point: an MCP gateway that mediates tool calls issues a portable signed record per call, and a counterparty verifies it offline with the issuer public key. No protocol surface changes; existing types, extensions, and carrier machinery only.

Scope

  • New example examples/mcp-gateway-receipts/ (private workspace package, never published): signed tool-definition manifest record (org.peacprotocol/provenance-record), per-call records (org.peacprotocol/access-decision) with the registered access and correlation extensions, content digests (sha256 over a deterministic serialization of input and redacted result), deny records, top-level _meta carrier, offline verification, and two tamper checks (content-binding digest mismatch with a still-valid signature, and an invalid Ed25519 signature).
  • New recipe docs/SOLUTIONS/mcp-gateway-receipts.md: what to sign, how it is carried, the five offline verification checks, deny records, registered vs unregistered extension groups, and composition boundaries.
  • Runtime smoke test tests/tooling/mcp-gateway-receipts-example.test.ts: imports the example's exported runGatewayDemo() in-process (no build, no network) and asserts the verification outcomes, the deny record, the unknown-extension warning, and both tamper detections.
  • Index rows in docs/SOLUTIONS/README.md and examples/README.md.
  • docs/releases/facts.json build_targets 104 -> 105 (the new example adds one turbo build target; CI machine-validates this metric against turbo run build --dry).

Explicitly not changed: wire format, schemas, registries, signing, CLI, server behavior, published packages.

Notes

  • Digests use a small deterministic stableStringify (recursive key sort) so an independent verifier recomputes the same bytes; the recipe notes a production profile should pin a canonicalization rule such as RFC 8785 JCS.
  • org.peacprotocol/access and org.peacprotocol/correlation are registered extension groups; org.peacprotocol/mcp and com.example/gateway are well-formed but unregistered and surface an informational unknown_extension_preserved warning (documented as such).
  • The example demonstrates that a valid signature does not extend to unbound content: modifying the delivered result keeps the signature valid but fails the bound result_sha256 check.

Validation

  • pnpm demo, pnpm demo:tamper, pnpm demo:show-record all green from a clean install.
  • pnpm vitest run tests/tooling: 955 passed (37 files).
  • node scripts/verify-release.mjs: all checks pass; build_targets matches turbo dry-run: 105.
  • Example build and typecheck pass; prettier clean; git diff --check clean.

@jithinraj jithinraj merged commit 9e3f51e into main Jun 11, 2026
28 checks passed
@jithinraj jithinraj deleted the feat/mcp-gateway-receipts branch June 11, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant