Problem
MCP server implementations (Express, Hono, Cloudflare Workers) need a simple way to add receipt signing without adopting the full protect-mcp gateway. Developers want app.use(receiptMiddleware()) — not a separate proxy process.
Proposal
A lightweight middleware that plugs into existing MCP server frameworks:
import { receiptMiddleware } from 'protect-mcp/middleware';
// Express
app.use('/mcp', receiptMiddleware({
keyPath: './keys/gateway.json',
policy: './protect-mcp.json'
}));
// Hono
app.use('/mcp/*', receiptMiddleware({ ... }));
What the middleware does
- Intercepts
tools/call requests
- Evaluates against policy (JSON, Cedar, or external PDP)
- Signs the decision as an Ed25519 receipt
- Attaches the receipt to the response headers
- Logs to
.protect-mcp-receipts.jsonl
What it doesn't do
- No process wrapping — runs in-process
- No stdio proxying — HTTP only
- No approval gates — those require the full gateway
Verification
npx @veritasacta/verify .protect-mcp-receipts.jsonl
Related
Problem
MCP server implementations (Express, Hono, Cloudflare Workers) need a simple way to add receipt signing without adopting the full protect-mcp gateway. Developers want
app.use(receiptMiddleware())— not a separate proxy process.Proposal
A lightweight middleware that plugs into existing MCP server frameworks:
What the middleware does
tools/callrequests.protect-mcp-receipts.jsonlWhat it doesn't do
Verification
Related