Skip to main content
Glama
agent-insurance-mcp-server

agent-insurance-mcp-server

by AiAgentKarl

agent-insurance-mcp-server

MCP server for AI agent transaction insurance and escrow — protect agent-to-agent payments with smart escrow, dispute resolution, and risk scoring.

PyPI version License: MIT

What it does

When AI agents transact with each other — paying for data, code, analysis, or content — there's no guarantee of delivery. This server adds a trust layer:

  1. Buyer agent creates an escrow → funds are locked

  2. Seller agent completes the task

  3. Buyer agent releases escrow → seller receives payment

  4. If something goes wrong → dispute opens, auto-verdict runs

Related MCP server: trust-mcp

Tools (11)

Tool

Description

create_escrow

Lock funds between buyer/seller agent for a task

release_escrow

Release funds after task completion (success/partial)

open_dispute

Open a dispute if something goes wrong

get_insurance_quote

Get risk score + premium before transacting

process_claim

Resolve a dispute (buyer_wins/seller_wins/split)

get_escrow_status

Check current status and all details of an escrow

get_insurance_info

System stats: active escrows, disputes, protected amounts

list_escrows

NEW Browse and filter all escrows (by status, agent, etc.)

get_agent_history

NEW Full transaction history + trust score for any agent

auto_resolve_expired

NEW Automatically resolve expired escrows (buyer refund)

insurance_analytics

NEW System analytics: volume, risk distribution, top agents

Installation

pip install agent-insurance-mcp-server

Claude Desktop Configuration

{
  "mcpServers": {
    "agent-insurance": {
      "command": "agent-insurance-mcp-server"
    }
  }
}

Example Usage

# 1. Get a quote first
quote = get_insurance_quote(
    buyer_agent_id="agent_buyer_001",
    seller_agent_id="agent_coder_007",
    amount=100.0,
    task_type="code"
)
# → risk_score: 35, premium: 2.8%, premium_amount: 2.80

# 2. Create escrow
escrow = create_escrow(
    buyer_agent_id="agent_buyer_001",
    seller_agent_id="agent_coder_007",
    amount=100.0,
    task_description="Build a REST API endpoint for user authentication",
    deadline_hours=48
)
# → escrow_id: "escrow_abc123def456", status: "active"

# 3a. Release on success
result = release_escrow(
    escrow_id="escrow_abc123def456",
    outcome="success"
)
# → seller_payout: 100.0, buyer_refund: 0.0

# 3b. Or open a dispute
dispute = open_dispute(
    escrow_id="escrow_abc123def456",
    reason="Task not delivered as agreed — API is missing auth logic"
)
# → auto_verdict: "buyer_favored", buyer_protection: 80%

# 4. Check agent trust (NEW in v0.2.0)
history = get_agent_history(agent_id="agent_coder_007")
# → trust_score: 72, completion_rate: 90%, dispute_rate: 5%

How Risk Scoring Works

  • Base risk: 30 points

  • Seller dispute history: +0-40 points based on past disputes

  • Transaction size: +5-15 points for large amounts

  • Experience bonus: -2 points per completed escrow (max -20)

  • Premium range: 1-5% of transaction amount

Changelog

v0.2.0 (April 2026)

  • 4 new tools: list_escrows, get_agent_history, auto_resolve_expired, insurance_analytics

  • Agent trust scoring (0-100) based on transaction history

  • Expired escrow auto-resolution with buyer refund

  • System-wide analytics (volume, risk distribution, top agents)

  • 11 tools total (up from 7)

v0.1.0

  • Initial release with 7 core tools

License

MIT — built by AiAgentKarl

Available Tools

11 tools
auto_resolve_expiredA

Automatically resolve all expired escrows.

Escrows past their deadline are resolved in favor of the buyer (full refund), since the seller failed to deliver on time. Run this periodically to keep the system clean.

Inputs: no named parameters.

create_escrowA

Erstellt einen neuen Escrow fuer eine Agent-Transaktion.

Sperrt den angegebenen Betrag sicher zwischen Buyer und Seller Agent. Der Betrag wird erst freigegeben, wenn die Aufgabe abgeschlossen ist oder ein Streitfall geloest wurde. Risikobasierte Praemie wird berechnet.

Args: buyer_agent_id: ID des zahlenden Agents (z.B. 'agent_weather_v2') seller_agent_id: ID des leistungserbringenden Agents (z.B. 'agent_code_gen') amount: Betrag der abzusichernden Transaktion (z.B. 50.0) task_description: Beschreibung der zu erbringenden Leistung deadline_hours: Frist in Stunden bis zur automatischen Aufloesung (1-720, Standard: 24)

Inputs: amount (required), buyer_agent_id (required), seller_agent_id (required), task_description (required), +1 more.

get_agent_historyA

Get full transaction history and trust metrics for an agent.

Shows all escrows (as buyer and seller), dispute rate, completion rate, average quality score, and a computed trust score (0-100). Useful for evaluating agent reliability before transacting.

Args: agent_id: ID of the agent to check (e.g. 'agent_weather_v2')

Inputs: agent_id (required).

get_escrow_statusA

Gibt den aktuellen Status und alle Details eines Escrows zurueck.

Zeigt Betrag, Parteien, Frist, Risiko-Score und alle Auszahlungsdetails. Erkennt abgelaufene Escrows automatisch.

Args: escrow_id: ID des Escrows (z.B. 'escrow_abc123def456')

Inputs: escrow_id (required).

get_insurance_infoA

Gibt Systeminformationen und Statistiken ueber das Insurance-System zurueck.

Zeigt Gesamtanzahl der Escrows, aktive Disputes, geschuetzte Betraege und verfuegbare Tools. Nuetzlich fuer einen Ueberblick ueber das System.

Inputs: no named parameters.

get_insurance_quoteA

Erstellt eine Versicherungsquote vor einer Agent-Transaktion.

Berechnet den Risiko-Score und die Praemie fuer eine geplante Transaktion. Empfohlen vor jeder create_escrow-Anfrage um die Kosten zu kennen.

Args: buyer_agent_id: ID des Buyers seller_agent_id: ID des Sellers amount: Geplanter Transaktionsbetrag task_type: Art der Aufgabe ('general', 'code', 'data', 'content', 'analysis')

Inputs: amount (required), buyer_agent_id (required), seller_agent_id (required), task_type.

insurance_analyticsA

Get detailed analytics about the insurance system.

Shows volume trends, top agents by volume, risk distribution, dispute rates, quality scores, and status breakdown. Useful for monitoring system health and agent economy trends.

Inputs: no named parameters.

list_escrowsA

List and filter all escrows in the system.

Browse all escrow transactions with optional filters. Shows escrow ID, status, parties, amount, and risk score. Expired escrows are automatically detected.

Args: status: Filter by status ('active', 'released', 'disputed', 'expired', 'claim_resolved'). Empty string returns all escrows. agent_id: Filter by agent ID (matches buyer OR seller). Empty = all agents. limit: Maximum results to return (1-100, default: 20)

Inputs: limit, status, agent_id.

open_disputeA

Eroeffnet einen Streitfall fuer einen Escrow.

Startet einen automatischen Bewertungsprozess und setzt den Escrow auf 'disputed'. Die automatische Erstbewertung basiert auf Schluesselwoertern in der Begruendung.

Args: escrow_id: ID des bestrittenen Escrows reason: Begruendung fuer den Streitfall (z.B. 'Task not delivered as agreed') evidence: Optionale Beweise oder Details (z.B. API-Responses, Logs)

Inputs: reason (required), escrow_id (required), evidence.

process_claimA

Verarbeitet einen Schadensfall und schliesst den Streitfall.

Loest einen offenen Dispute auf und verteilt den Escrow-Betrag gemaess der Entscheidung. Benoetigt manuelle Eingabe nach Pruefung der Beweise.

Args: dispute_id: ID des zu loesenden Streitfalls resolution: Entscheidung ('buyer_wins', 'seller_wins', 'split') buyer_pct: Prozentsatz fuer den Buyer bei 'split'-Entscheidung (0-100, Standard: 50)

Inputs: dispute_id (required), resolution (required), buyer_pct.

release_escrowB

Gibt den Escrow frei und zahlt den Seller aus.

Beendet einen aktiven Escrow nach Abschluss der Aufgabe. Bei 'success' erhaelt der Seller den vollen Betrag. Bei 'partial' wird anteilig nach quality_score ausgezahlt.

Args: escrow_id: ID des freizugebenden Escrows (z.B. 'escrow_abc123def456') outcome: Ergebnis der Transaktion ('success' oder 'partial') quality_score: Qualitaet der Leistung von 1-10 (nur bei 'partial' relevant, Standard: 8)

Inputs: outcome (required), escrow_id (required), quality_score.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 11 tools

    Disambiguation5/5

    All 11 tools have clearly distinct purposes: creating escrows, releasing them, handling disputes, auto-resolving expired ones, checking status, getting quotes, viewing history, analytics, etc. No two tools overlap in function.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern (create_escrow, get_agent_history, open_dispute, etc.), but 'insurance_analytics' breaks the pattern (should be get_analytics). Additionally, descriptions are mixed English and German, but names are consistently snake_case.

    Tool Count5/5

    11 tools is well-scoped for an entity insurance / escrow system. Each tool covers a necessary action (create, release, dispute, claim, auto-resolve, status, listings, quotes, history, analytics, system info) without bloat.

    Completeness4/5

    The tool set covers the full lifecycle: creation, release, dispute, claim resolution, auto-resolution, and supporting functions (quotes, history, analytics). Missing perhaps an explicit 'cancel' or 'modify' tool, but the core workflows are complete.

    Related MCP Connectors

    Related MCP Servers