SuperAPI AI Directory

openterms-mcp

Ed25519-signed consent receipts and a policy engine for agents: spending caps, action allowlists, escalation thresholds and JWKS-backed provider verification.

Open website

About this tool

Purpose

Openterms sits between an AI agent and the actions it performs, to prove what the agent agreed to and to control what it is allowed to do. It consists of three layers: Receipts, Policy Engine, and Provider Verification.

Main Capabilities

  • Receipts: Before an agent calls an API, it receives an Ed25519-signed receipt. It uses RFC 8785 canonical JSON, SHA-256 hashing, and real cryptography. Anyone can verify it with a public key, with no API key and no need to trust a server.
  • Policy Engine: Supports daily spending limits, operation type allowlists, and escalation thresholds. The policy engine evaluates before the receipt is signed, and rejected operations never receive a receipt.
  • Provider Verification: API providers register their terms URL and verify agent consent before processing requests. With just one public GET call, both parties to the transaction trust the proof.

Usage

Quick start (get your first receipt in 60 seconds):

git clone https://github.com/jstibal/openterms.git cd openterms pip install flask pyjwt cryptography pyyaml bash quickstart.sh

Or use Docker:

git clone https://github.com/jstibal/openterms.git cd openterms docker compose up --build

In another terminal, run:

bash quickstart.sh

Receipt issuance is free, with no wallet, deposit, or payment required.

Self-Hosting

Option 1: Run directly

pip install flask pyjwt cryptography pyyaml python run.py

The server is located at http://localhost:5000

Option 2: Docker

docker compose up --build

Option 3: Point the MCP server to your instance

export OPENTERMS_API_URL=http://localhost:5000 python openterms_mcp_server.py

Everything runs locally. It uses a SQLite database with no external dependencies.

Hosted Service

If you do not want to self-host, you can use the hosted instance at openterms.com—the same open-source code, officially hosted.

MCP Server

Provides 10 tools for AI agents:

  • issue_receipt: Issue a signed receipt before any operation, with provider verification headers
  • verify_receipt: Verify the cryptographic integrity of a receipt (public)
  • verify_receipt_by_hash: Look up and verify by canonical hash (public)
  • check_balance: Workspace balance
  • get_pricing: Pricing list per receipt
  • list_receipts: Recent receipts
  • get_policy: Currently effective guardrails—call at startup
  • simulate_policy: Pre-check: would this operation be allowed?
  • policy_decisions: Audit record of every allow/deny/escalate
  • provider_activity: Receipt statistics for your API (provider authentication)

MCP configuration:

{ "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 flow:

  1. Agent calls issue_receipt, gets receipt + headers
  2. Agent includes the X-Openterms-Receipt header in the API call
  3. Provider calls GET /v1/receipts/verify/{hash} (public, no authentication required)
  4. If valid, service is provided; if invalid, it is rejected.

Core methods:

  • POST /v1/receipts (Bearer): issue a signed receipt
  • POST /v1/receipts/verify (none): verify a 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 methods:

  • GET /v1/policy (Bearer): current policy
  • PUT /v1/policy (Admin): create/update policy
  • POST /v1/policy/simulate (Bearer): test hypothetical actions
  • GET /v1/policy/decisions (Bearer): decision audit records

Provider verification methods:

  • POST /v1/providers (none): register as a provider
  • POST /v1/providers/verify (Provider): verify domain
  • GET /v1/provider/stats (Provider): receipt statistics
  • GET /v1/provider/receipts (Provider): recent receipts

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

A total of 120 tests pass (80 core + 40 provider verification).

Phase Status

  • MVP1 (released): signed receipts—record what happened
  • MVP2 (released): policy engine—enforce permitted actions
  • MVP3 (released): provider verification—both parties trust the proof
  • ORS specification (in progress): open receipt specification—portable format
  • Integrations (in progress): LangChain, CrewAI one-line callbacks
  • MVP4 (planned): receipt chains, agent authentication

License

Apache 2.0, see LICENSE. Copyright 2026 Staticlabs Inc.

Limitations

The above materials do not provide specific information about pricing, fees, platform compatibility, performance metrics, or effectiveness guarantees. The ORS specification, framework integrations, and MVP4 are still in progress or planned, and no completion dates are provided.