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.2

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.2
File Size Uploaded
custos_mcp-0.4.2.tar.gz 49.2 kB Details

Built distribution (wheel)

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

Total release size: 96.0 kB

Release files / custos_mcp-0.4.2.tar.gz

Download URL custos_mcp-0.4.2.tar.gz
Size 49.2 kB
Tags Source
SHA-256 checksum
How to use checksums
597f9da85c10f77b75f0e70a58221e4dcf88c0d82b460258f1f47697edbd3011
BLAKE2b-256 checksum
How to use checksums
2923063d7a9e68d3645a20fe0286229d39b4b3e0c29888818a0f6cfcc3f7fa65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

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

Download URL custos_mcp-0.4.2-py3-none-any.whl
Size 46.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccce64b0c6e981e37fbee5afa5c07218c41359147082112a5fd697129b9336b8
BLAKE2b-256 checksum
How to use checksums
c4a21865dd82b3126dfe18f2e74f9fc48cb6a9f16e147271cf5379b234d3fea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.0

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