openterms-mcp

by jstibal

Not rated
GitHub

About

Ed25519-signed consent receipts + programmable policy engine for AI agents before they take actions.

Details

Author
jstibal
Categories
Other, AI, Security

Setup

Install openterms-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/jstibal/openterms-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

Open source cryptographic consent receipts + programmable guardrails + provider verification for AI agents.

Your agent proves what it agreed to. Your policy controls what it's allowed to do. The API provider can verify both.

Live Demo · Quickstart · Self-Host · MCP Server · Contributing · Open Receipt Spec

What It Does Openterms sits between your AI agent and the actions it takes. Three layers:
-

Receipts — Before your agent calls an API, it gets an Ed25519-signed receipt. Canonical JSON (RFC 8785), SHA-256 hash, real cryptography. Anyone can verify it using public keys — no API key needed, no trust in the server required.

Policy Engine — Daily spending caps, action type whitelists, escalation thresholds. The policy engine evaluates before the receipt is signed. Denied actions never get a receipt.

Provider Verification — API providers register their terms URL and verify agent consent before serving requests. One public GET call. Both sides of the transaction trust the proof.

Quickstart 60 seconds to your first receipt:

git clonehttps://github.com/jstibal/openterms.gitcd openterms pip install flask pyjwt cryptography pyyaml bash quickstart.sh Or with Docker:

git clonehttps://github.com/jstibal/openterms.gitcd openterms docker compose up --build

bash quickstart.sh Receipt issuance is free — no wallet, no deposit, no payment required.

Self-Host Run your own Openterms instance:

pip install flask pyjwt cryptography pyyaml python run.py

Option 3: Point MCP server at your instance

export OPENTERMS_API_URL=http://localhost:5000python openterms_mcp_server.py Everything runs locally. SQLite database, no external dependencies.

Hosted Service Don't want to self-host? Use the hosted instance at openterms.com — same open source code, managed for you.

Tool What it does issue_receipt Signed receipt before any action, with provider verification headers verify_receipt Verify receipt cryptographic integrity (public) verify_receipt_by_hash Look up and verify by canonical hash (public) check_balance Workspace balance get_pricing Per-receipt pricing list_receipts Recent receipts get_policy Active guardrails — call on startup simulate_policy Pre-check: would this action be allowed? policy_decisions Audit trail of every allow/deny/escalate provider_activity Receipt stats for your API (provider auth) MCP Config { "mcpServers": { "openterms": { "command": "python3", "args": ["openterms_mcp_server.py"], "env": { "OPENTERMS_API_URL": "https://openterms.com", "OPENTERMS_API_KEY": "openterms_your_key_here" } } } }

How Provider Verification Works Agent Openterms API Provider | | | |-- issue_receipt ------->| | |<-- receipt + headers ---| | | |-- webhook notification -->| | | | |-- API call + headers ---|-------------------------->| | |<-- verify/{hash} ---------| | |-- receipt data ---------->| |<--------- response -----|---------------------------|

Agent issues receipt → gets X-Openterms-Receipt header Agent includes header in API call Provider calls GET /v1/receipts/verify/{hash} — public, no auth Valid → serve. Invalid → reject.

Core Method Path Auth Description POST /v1/receipts Bearer Issue signed receipt POST /v1/receipts/verify None Verify receipt GET /v1/receipts/verify/{hash} None Verify by hash GET /v1/receipts Bearer List receipts GET /.well-known/jwks.json None Public signing keys Policy Engine Method Path Auth Description GET /v1/policy Bearer Active policy PUT /v1/policy Admin Create/update policy POST /v1/policy/simulate Bearer Test hypothetical action GET /v1/policy/decisions Bearer Decision audit trail Provider Verification Method Path Auth Description POST /v1/providers None Register as provider POST /v1/providers/verify Provider Verify domain GET /v1/provider/stats Provider Receipt stats GET /v1/provider/receipts Provider Recent receipts

120 tests passing (80 core + 40 provider verification)

Architecture openterms/ ├── app.py # Flask API (1135 lines) ├── db.py # SQLite database (15 tables) ├── openterms_mcp_server.py # MCP server + CLI (10 tools) ├── core/ │ ├── canonical.py # RFC 8785 canonicalization │ └── signing.py # Ed25519 signing + JWKS ├── services/ │ ├── receipt_service.py # Receipt pipeline │ ├── ledger_service.py # Balance tracking │ └── policy_engine.py # Rule evaluation ├── tests/ │ ├── test_core.py # 80 tests │ └── test_mvp3.py # 40 tests ├── Dockerfile ├── docker-compose.yml ├── quickstart.sh └── .env.example

Phase Status What it does MVP1 ✅ Shipped Signed receipts — record what happened MVP2 ✅ Shipped Policy engine — enforce what's allowed MVP3 ✅ Shipped Provider verification — both sides trust the proof

ORS Spec 🔄 In progress Open Receipt Specification — portable format

Integrations 🔄 In progress LangChain, CrewAI one-line callbacks

MVP4 Planned Receipt chaining, agent certification

See CONTRIBUTING.md. We especially welcome framework integrations, language SDKs, and feedback on the Open Receipt Specification.

ALTER - identity infrastructure for the AI economy

KHEPRA MCP Server smithery badge MCP Registry License Container PQC Sovereign compliance engine with 36,195 STIG/CCI/NIST/CMMC mappings. Air-gappable. Zero token costs. Run ert_scan → get a Godfather Report with dollar-denominated business impact. The only MCP compliance server that runs on your metal — with the World's First DoD PQC STIG built in. PQC-01-STIG-V1R1 — Full Whitepaper → 17 controls covering CNSA 2.0, FIPS 203/204/205, and the NSA's May 2026 MCP security advisory. The world's first DoD-style Post-Quantum Cryptography STIG, including the first PQC controls for agentic AI and MCP deployments.

Cryptographic runtime governance for AI agents. 20 tools. Sealed policy artifacts, continuous measurement, tamper-evident proof. Ed25519 + SHA-256.

Auth0, but for agents. Identity and authentication service for AI agents.

AI Agent Supply Chain Security - Intercepts and validates every package installation, git clone, and script download triggered by AI coding agents before it executes.

AgentTrust is a pure MCP-only reputation and trust scoring server for AI agents.

Structured AI incident reporting for EU AI Act Article 62 — generates mandatory incident reports, severity classification, root cause analysis, and regulator-ready submissions for serious AI incidents.

Enforces organisational AI usage policies at the agent layer — blocks prohibited model calls, enforces data residency rules, logs policy violations, and ensures AI governance policies are machine-executable.

AI agent governance with quantum-safe audit trails and three-tier policy enforcement

It connects Agents to data wallet with DID and verifiable credentials

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.