All projects

Debt-collection agent over MCP

An agent that proposes one explained action per customer and hands claims to a collector over MCP – only after a human approves.

2026 · Python, MCP, Claude API, pytest · 40 tests, incl. end-to-end over MCP

Terminal demo of the agent proposing actions and waiting for approval

How it works

The agent reads overdue invoices, builds a snapshot per customer (overdue amount, payment history, promises, disputes) and recommends exactly one action: call the customer, send a reminder, offer a payment plan, pause on a dispute, or hand over to collection. Every recommendation shows its evidence and why the alternatives were ruled out. Nothing is sent until a human approves, and every decision and tool call is logged.

Key design choices

  • A rule engine picks the action. Claude only writes the explanation, and the text is rejected if it contains numbers that aren't in the evidence.
  • "Why not" matters as much as "why": each recommendation explains the alternatives it ruled out.
  • Reads and writes are separated: no claim is created before a human says yes.
  • Works against a mock MCP server today and can be pointed at a real one through config.

Stack

  • Python
  • MCP
  • Claude API
  • pytest

Tests: 40 tests, incl. end-to-end over MCP