feat(examples): mcp gateway records with policy decisions and content digests#834
Merged
Conversation
…group clarity for mcp gateway records
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 registeredaccessandcorrelationextensions, content digests (sha256over a deterministic serialization of input and redacted result), deny records, top-level_metacarrier, offline verification, and two tamper checks (content-binding digest mismatch with a still-valid signature, and an invalid Ed25519 signature).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.tests/tooling/mcp-gateway-receipts-example.test.ts: imports the example's exportedrunGatewayDemo()in-process (no build, no network) and asserts the verification outcomes, the deny record, the unknown-extension warning, and both tamper detections.docs/SOLUTIONS/README.mdandexamples/README.md.docs/releases/facts.jsonbuild_targets104 -> 105 (the new example adds one turbo build target; CI machine-validates this metric againstturbo run build --dry).Explicitly not changed: wire format, schemas, registries, signing, CLI, server behavior, published packages.
Notes
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/accessandorg.peacprotocol/correlationare registered extension groups;org.peacprotocol/mcpandcom.example/gatewayare well-formed but unregistered and surface an informationalunknown_extension_preservedwarning (documented as such).result_sha256check.Validation
pnpm demo,pnpm demo:tamper,pnpm demo:show-recordall 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.buildandtypecheckpass; prettier clean;git diff --checkclean.