custos-mcp
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file custos_mcp-0.1.0.tar.gz.
File metadata
- Download URL: custos_mcp-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dc560858d32661dce1638a985483bb0c3daa0b4d849c5e616532d0905190ffc
|
|
| MD5 |
175bf5bae048a22f97cb166e50574790
|
|
| BLAKE2b-256 |
2a2f2f2f3172ae088aff99314307c913b2fd03b87f6e2c1cce4d7203bf2f30a7
|
File details
Details for the file custos_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: custos_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8950451a7208a981ec6c6cededbbb20ba9fb3d5daeb6a41ec8aa7648008016a2
|
|
| MD5 |
f21ed84f767661cbc3be181cc8d8337b
|
|
| BLAKE2b-256 |
3d224198392ea5bf090cc2acbc6ceec488ca1b7a193950ce11e92425ea4fbb08
|