Action surface compiler: turn observed web traffic into safe, versioned, agent-ready tools
Project description
Cask - Agent tool supply chain and verification
Turn any web API into a governed, agent-ready MCP server in one command.
Cask captures real API traffic, compiles it into governed tool definitions, and serves them through MCP with lockfile-based approval, drift detection, and verification contracts. Every tool your AI agent uses is auditable, versioned, and fail-closed by default.
See It Work (30 seconds)
pip install caskmcp
cask demo
What just happened:
- Compiled a governed toolpack from offline fixtures
- Enforced fail-closed lockfile governance (no lockfile = no runtime)
- Proved deterministic replay parity between two independent runs
- Emitted
prove_summary.json,prove_twice_report.md, andprove_twice_diff.json
Exit code 0 means governance held, parity passed, and everything is deterministic.
Quick Start (5 minutes)
# 1. Initialize cask in your project
cask init
# 2. Capture traffic and compile a governed toolpack
cask mint https://your-app.com -a api.your-app.com
# 3. Review what changed (risk-classified diff)
cask diff --toolpack .caskmcp/toolpacks/*/toolpack.yaml
# 4. Approve tools for use
cask gate allow --all
# 5. Start the governed MCP server
cask serve --toolpack .caskmcp/toolpacks/*/toolpack.yaml
Your AI agent now has governed, auditable access to your API.
How It Works
Capture ─── Compile ─── Review ─── Approve ─── Serve ─── Verify
│ │ │ │ │ │
HAR/OTEL tools.json cask diff lockfile MCP stdio contracts
OpenAPI policy.yaml signatures drift
Browser contracts evidence
Capture real traffic (HAR, OpenTelemetry, OpenAPI specs, or live browser sessions).
Compile into deterministic, versioned tool definitions with risk classification.
Review changes with cask diff -- every new tool, schema change, or host addition is risk-classified.
Approve via signed lockfile entries -- explicit human decisions, not silent defaults.
Serve through MCP with fail-closed enforcement -- unapproved tools never execute.
Verify with assertion-based contracts, drift detection, and evidence bundles for CI.
Traffic Capture
Start where you already are:
| You have | Command | Best for |
|---|---|---|
| Nothing (just exploring) | cask demo |
Fastest first run, no credentials needed |
| A web app to capture | cask mint https://app.example.com -a api.example.com |
Capturing real authorized behavior |
| HAR/OTEL files | cask capture import traffic.har -a api.example.com |
Adopting Cask without recapturing |
| An OpenAPI spec | cask capture import openapi.yaml -a api.example.com |
Generating tools from specs |
All paths converge to the same governed runtime.
Core Commands
| Command | What it does |
|---|---|
cask init |
Initialize Cask in your project |
cask mint <url> |
Capture traffic and compile a toolpack |
cask diff |
Generate a risk-classified change report |
cask gate allow |
Approve tools for use |
cask gate check |
CI gate: exit 0 only if all tools approved |
cask serve |
Start the governed MCP server (stdio) |
cask run |
Execute a toolpack with policy enforcement |
cask drift |
Detect capability surface changes |
cask verify |
Run verification contracts |
cask config |
Generate MCP client config snippet |
cask demo |
Prove governance works (offline, 30 seconds) |
Tip: Both
caskandcaskmcpwork as the CLI entry point.caskis preferred.
Run cask --help for the full command tree, or cask --help-all for advanced commands.
Why Cask?
Safe by default. Fail-closed lockfile enforcement means unapproved tools never run. No lockfile, no runtime. Period.
Auditable. Every approval is signed. Every runtime decision produces a trace. Every verification run creates an evidence bundle.
Deterministic. Same inputs produce identical artifacts and digests. Replay parity is a first-class contract, not an aspiration.
Zero friction. cask demo proves the entire governance loop offline in 30 seconds. cask mint captures and compiles in one command. OpenAPI specs are auto-detected on import.
CI-native. cask gate check gates deployments. cask drift catches API surface changes. cask verify runs assertion-based contracts. All exit codes are machine-readable.
MCP Client Config
Generate a config snippet for your AI client:
# For Claude Desktop
cask config --toolpack .caskmcp/toolpacks/*/toolpack.yaml --format json
# For Codex
cask config --toolpack .caskmcp/toolpacks/*/toolpack.yaml --format codex
Or add this to your Claude Desktop config (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"my-api": {
"command": "cask",
"args": ["serve", "--toolpack", "/path/to/toolpack.yaml"]
}
}
}
Verification Workflows
Cask integrates with Tide for structured, multi-step verification workflows:
# Create a starter workflow
cask workflow init
# Execute a workflow and emit evidence
cask workflow run tide.yaml
# Replay a previous run
cask workflow replay .tide/runs/<run_id>
# Compare two runs
cask workflow diff run_a/ run_b/
# Generate a report
cask workflow report .tide/runs/<run_id>
# Bundle a run into a portable zip
cask workflow pack .tide/runs/<run_id>
# Export evidence in a specific format
cask workflow export cask .tide/runs/<run_id>
# Check dependency status
cask workflow doctor
Workflows support shell, HTTP, browser, and MCP step types. Each run produces an evidence bundle with digests.
Installation
# Base install (includes offline demo)
pip install caskmcp
# With MCP server support
pip install "caskmcp[mcp]"
# With live browser capture
pip install "caskmcp[playwright]"
python -m playwright install chromium
# Everything
pip install "caskmcp[all]"
For development:
git clone https://github.com/caskmcp/CaskMCP.git
cd CaskMCP/cask
pip install -e ".[dev]"
The Problem Cask Solves
AI agents need tools. MCP gives them tools. But who governs what those tools can do?
MCP adoption is accelerating while trust and safety remain unsolved:
- OpenAI highlights tool-injection and trust risks
- Remote MCP requires strict allowlisting
- Registry moderation is intentionally permissive
- Real incidents are already happening
Cask provides the missing governance layer: local, deterministic, auditable, fail-closed.
Documentation
Development
pip install -e ".[dev,packaging-test]"
pytest tests/ -v
ruff check caskmcp tests
mypy caskmcp --ignore-missing-imports
Project details
Release history Release notifications | RSS feed
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 caskmcp-0.2.0rc1.tar.gz.
File metadata
- Download URL: caskmcp-0.2.0rc1.tar.gz
- Upload date:
- Size: 519.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b9a0eb83e8fa404497ffd8c228e9063203014953bf1df287d45528e72777c7c
|
|
| MD5 |
e090b1a3c0132f83b22cb5841723e206
|
|
| BLAKE2b-256 |
34616942c0f0f393d039232a26b521dfdc9357149e479aa614785cdb096ccfd1
|
Provenance
The following attestation bundles were made for caskmcp-0.2.0rc1.tar.gz:
Publisher:
publish-pypi.yaml on caskmcp/CaskMCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
caskmcp-0.2.0rc1.tar.gz -
Subject digest:
5b9a0eb83e8fa404497ffd8c228e9063203014953bf1df287d45528e72777c7c - Sigstore transparency entry: 975676440
- Sigstore integration time:
-
Permalink:
caskmcp/CaskMCP@85ac0209f19f99e51a53dbd70e89c02222474bcf -
Branch / Tag:
refs/tags/v0.2.0rc1 - Owner: https://github.com/caskmcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@85ac0209f19f99e51a53dbd70e89c02222474bcf -
Trigger Event:
push
-
Statement type:
File details
Details for the file caskmcp-0.2.0rc1-py3-none-any.whl.
File metadata
- Download URL: caskmcp-0.2.0rc1-py3-none-any.whl
- Upload date:
- Size: 313.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f20b6c658af18369d9f22d08a877f8bbc1449260735498ba1c8e6a01d6b5ff
|
|
| MD5 |
2236bf6e59c2ed02eff7e570ab3451ed
|
|
| BLAKE2b-256 |
9c7fdfe8eac1ab133ca6c63313ce744a1e8586e644d6ac53718353a44c409293
|
Provenance
The following attestation bundles were made for caskmcp-0.2.0rc1-py3-none-any.whl:
Publisher:
publish-pypi.yaml on caskmcp/CaskMCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
caskmcp-0.2.0rc1-py3-none-any.whl -
Subject digest:
23f20b6c658af18369d9f22d08a877f8bbc1449260735498ba1c8e6a01d6b5ff - Sigstore transparency entry: 975676441
- Sigstore integration time:
-
Permalink:
caskmcp/CaskMCP@85ac0209f19f99e51a53dbd70e89c02222474bcf -
Branch / Tag:
refs/tags/v0.2.0rc1 - Owner: https://github.com/caskmcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yaml@85ac0209f19f99e51a53dbd70e89c02222474bcf -
Trigger Event:
push
-
Statement type: