Setoff

Developers

For AI agents

Setoff ships an MCP server with 16 tools, so any AI agent can bill other agents, approve what it owes, fund its net, settle disputes, manage credit and opt in to currency netting, in plain language.

Why agents need netting

Agents that buy services from other agents run up many small bills in both directions: an agent pays for search, gets paid for summaries, pays for compute. Settling each one separately is wasteful. With Setoff, an agent records what it owes and is owed as it goes, and one cycle settles it all, moving only the net.

Tools

ToolWhat it doesOnchain?
setoff_infoNetwork, contract, tokens, and this agent's wallet and limitRead
get_positionWhat an address owes and is owed, its net, its deposit, and what to deposit nextRead
list_billsBills, filtered by party and statusRead
preview_next_cycleWhat would settle, and how much would move, if a cycle ran nowRead
create_invoiceBill someone; returns a link they approve for freeNo
approve_invoiceSign an invoice billed to this agent; optionally post itFree signature (+ post)
post_invoicePut an approved invoice onchainYes
record_iouRecord a bill this agent owesYes
depositFund this agent's net positionYes
withdrawTake this agent's balance back to its walletYes
dispute_billFreeze a bill this agent is part ofYes
propose_amountPropose what's still owed on a disputed bill; matching offers resolve itYes
set_credit_lineLet a trusted party overdraw up to a limit from this agent's depositYes
repay_creditRepay a lender from this agent's balanceYes

Invoice links are the same format as the web app's, so an agent can bill a person, a person can bill an agent, and either side can open the link in the app.

Set it up

Clone the repository and install the server's dependencies (plus the solver's, which it reuses):

bash
git clone --recursive https://github.com/Anshv784/setoff && cd setoff
(cd solver && npm install) && (cd mcp && npm install)

Claude Code:

bash
claude mcp add setoff \
  -e SETOFF_NETWORK=mainnet \
  -e SETOFF_AGENT_PK=0xYOUR_AGENT_KEY \
  -e SETOFF_MAX_AMOUNT=10 \
  -- npx tsx /path/to/setoff/mcp/src/server.ts

Claude Desktop, Cursor and other MCP clients (mcpServers in the client's config file):

json
{
  "mcpServers": {
    "setoff": {
      "command": "npx",
      "args": ["tsx", "/path/to/setoff/mcp/src/server.ts"],
      "env": {
        "SETOFF_NETWORK": "mainnet",
        "SETOFF_AGENT_PK": "0xYOUR_AGENT_KEY",
        "SETOFF_MAX_AMOUNT": "10"
      }
    }
  }
}
VariableMeaning
SETOFF_NETWORKmainnet, testnet or local
SETOFF_AGENT_PKThe agent's own wallet key. Leave it out for read-only tools.
SETOFF_MAX_AMOUNTLargest amount the agent may bill, approve, record or deposit in one action. Default 10.
SETOFF_APP_URLWhere invoice links should open. Default https://setoff.anshverma.tech.

Safety

Try asking