Skip to main content

custos-mcp

PyPI version Python versions License

Runtime governance, policy enforcement, and cryptographic audit for MCP tool calls.

Every tools/call from an AI agent is evaluated against a policy, allowed or denied, timed, and appended to an Ed25519-signed hash-chained ledger. The ledger format is wire-compatible with the Node package — audit anywhere.

pip install custos-mcp[web]

Quickstart

from custos import Gate, Ledger, Actor, Server, generate_keypair, load_policy

kp = generate_keypair()
kp.save(".custos")
ledger = Ledger(".custos/ledger.jsonl", kp)
policy = load_policy("policy.yaml")

gate = Gate(policy, ledger, Actor("agent-1"), Server("fs"))

result = gate.call("read_file", {"path": "/workspace/x"}, fn=open_file)
if result.allowed:
    print(result.result)

CLI

custos keygen                            # write .custos/ledger.key + ledger.pub
custos proxy --policy policy.yaml -- python -m my_mcp_server
custos verify --ledger .custos/ledger.jsonl
custos bundle out.tar.gz                 # export portable evidence
custos verify-bundle out.tar.gz
custos serve                             # dashboard on :8787

Policy DSL

version: 1
id: default
default: deny
rules:
  - id: allow-read
    when:
      tool: read_file
      args.path: {prefix: "/workspace/"}
    decision: allow
    reason: workspace-only reads

See spec/POLICY.md for the full grammar.

Release files for custos-mcp 0.4.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 custos-mcp 0.4.0
File Size Uploaded
custos_mcp-0.4.0.tar.gz 48.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for custos-mcp 0.4.0
File Interpreter ABI Platform
custos_mcp-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 94.4 kB

Release files / custos_mcp-0.4.0.tar.gz

Download URL custos_mcp-0.4.0.tar.gz
Size 48.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b1e20ef1d2d2c9d35c138e881a29f5defc408ae744222e49a9b6142cfea2ff5d
BLAKE2b-256 checksum
How to use checksums
481caab9e5c3e50d731f2916564fdaba5e7db8081b118a4ae43f8e98ea171f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / custos_mcp-0.4.0-py3-none-any.whl

Download URL custos_mcp-0.4.0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
985a2314238a60c256b2ff5452ff90b8c545056262ff4395e91f76ee989ffb69
BLAKE2b-256 checksum
How to use checksums
e26b4692de573e8b5231d3e4a1a4164a1b6a0db053a70f65bffde98bb61175e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.2

2 release files

This release

0.4.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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