Skip to main content

MCP Receipt Governed

MCP tool-call receipt signing integration for Agent Governance Toolkit.

Every MCP tool invocation optionally produces a signed governance receipt linking the Cedar policy decision to the tool call, providing a cryptographically verifiable audit trail for agent operations.

Quick Start

from mcp_receipt_governed import McpReceiptAdapter

adapter = McpReceiptAdapter(
    cedar_policy="""
        permit(principal, action == Action::"ReadData", resource);
        forbid(principal, action == Action::"DeleteFile", resource);
    """,
    cedar_policy_id="policy:mcp-tools:v1",
    signing_key_hex="a" * 64,  # Replace with real Ed25519 seed
)

# Govern a tool call — produces a signed receipt
receipt = adapter.govern_tool_call(
    agent_did="did:mesh:agent-1",
    tool_name="ReadData",
    tool_args={"path": "/data/report.csv"},
)

print(f"Decision: {receipt.cedar_decision}")
print(f"Receipt ID: {receipt.receipt_id}")
print(f"Signed: {receipt.signature is not None}")

Features

  • Cedar policy binding: Receipt payload includes the Cedar policy ID and allow/deny decision
  • Ed25519 signatures: Non-repudiable receipt signing with HMAC-SHA256 fallback
  • Canonical JSON hashing: JCS-style deterministic serialization for verifiable receipts
  • Receipt store: In-memory audit trail with filtering by agent, tool, or decision
  • Zero required dependencies: Works with stdlib only; Ed25519 signing available via pip install agentmesh-mcp-receipts[crypto]

Installation

# From the repository root
pip install -e agent-governance-python/agentmesh-integrations/mcp-receipt-governed

# With Ed25519 signing support
pip install -e "agent-governance-python/agentmesh-integrations/mcp-receipt-governed[crypto]"

Testing

cd agent-governance-python/agentmesh-integrations/mcp-receipt-governed
pip install -e ".[dev]"
pytest tests/ -v

Architecture

MCP Tool Call
     │
     ▼
┌────────────────────┐
│  McpReceiptAdapter │
│  ┌──────────────┐  │
│  │ Cedar Policy │──┼──▶ allow / deny
│  │  Evaluator   │  │
│  └──────────────┘  │
│  ┌──────────────┐  │
│  │  Receipt     │──┼──▶ GovernanceReceipt
│  │  Generator   │  │    (tool, agent, policy, decision)
│  └──────────────┘  │
│  ┌──────────────┐  │
│  │  Ed25519     │──┼──▶ Signed receipt
│  │  Signer      │  │
│  └──────────────┘  │
│  ┌──────────────┐  │
│  │ ReceiptStore │──┼──▶ Audit trail
│  └──────────────┘  │
└────────────────────┘

License

MIT — see LICENSE.

Metadata

Release files for agentmesh_mcp_receipts 3.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentmesh_mcp_receipts 3.7.0
File Size Uploaded Provenance Actions
agentmesh_mcp_receipts-3.7.0.tar.gz 11.7 kB Without provenance Details for agentmesh_mcp_receipts-3.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentmesh_mcp_receipts 3.7.0
File Interpreter ABI Platform Actions
agentmesh_mcp_receipts-3.7.0-py3-none-any.whl Python 3 none any Details for agentmesh_mcp_receipts-3.7.0-py3-none-any.whl

Total release size: 19.8 kB

Release files / agentmesh_mcp_receipts-3.7.0.tar.gz

Download URL agentmesh_mcp_receipts-3.7.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec2453956a6568f4144cd3247e51f48f402e32012f43efd38f60a2183ed0b0e2
BLAKE2b-256 checksum
How to use checksums
c540f36b6452476bc362841acb9f8eb7ba37dbe344d6bf338f49ffed56924627
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release files / agentmesh_mcp_receipts-3.7.0-py3-none-any.whl

Download URL agentmesh_mcp_receipts-3.7.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3073dcc2f70b5d043b072a9aa5b0b406f90a9e98047154fb9a45a72027db6230
BLAKE2b-256 checksum
How to use checksums
934cec4d07d2efda6429087577e9261874901795ec8be878e75a82339d1855af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Security for agentmesh_mcp_receipts 3.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page