# TollWarden

Screens an outgoing x402 payment before it settles and answers allow, flag or block. Built for agents that pay for data and APIs.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 2
- Author: tollwarden
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/tollwarden/tollwarden
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/tollwarden

## What it does

TollWarden sits between the agent's decision to pay and the wallet signature. The agent posts the payment to `POST /v1/scan/outgoing` and gets a verdict with per-check reasons: allow lets the wallet settle, flag tells the agent to pause and confirm intent, block stops the signature. Nothing is held on the server side — keys, wallets and funds stay with you, and the verdict is advice only.

Several failure modes are covered. Secrets leaking through payment metadata: EVM private keys, seed phrases, cloud and AI service keys, JWTs, credentials embedded in URLs. A nonce that has already been used. The same purchase authorized twice — an x402 client signs a fresh authorization for every 402 it meets, so a retried request arrives as a second valid payment. A quoted price far above the expected one. And payments whose decision came from a page or tool result the agent had just read rather than from its own plan.

An API key is required; the `@tollwarden/client` package mints one on its own and includes 100 free scans. SDKs exist for TypeScript and Python, with integrations for LangChain, CrewAI, NeMo Agent Toolkit, Coinbase AgentKit and Vercel AI SDK. Wallet authors can use `TollWardenEnforcer`, which wraps a viem or ethers signer and refuses to sign an authorization unless a fresh allow-verdict bound to that payment is present.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add tollwarden -- npx -y tollwarden
```

### Codex

**Platform CLI**
```bash
codex mcp add tollwarden -- npx -y tollwarden
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "tollwarden": {
            "command": "npx",
            "args": [
                "-y",
                "tollwarden"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "tollwarden": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "tollwarden"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add tollwarden npx -y tollwarden
```

## When to use it
- catch a leaked private key or API key in payment metadata before it goes out
- reject a payment authorization whose nonce was already spent
- spot a second signature for a purchase that was already paid
- stop a payment triggered by content the agent just read
- block a payment priced above the expected amount

## Example prompts
- Run this x402 payment through TollWarden before signing it
- Tag the page text the agent just read and check whether it pushes toward a payment
- Wire TollWarden into the wallet so it won't sign without an allow verdict

## Similar
- [Agent Wormhole](https://affpapa.org/en/nevibecode/mcp/agent-wormhole.md) — MCP server · ★ 5
- [okx-agent-payments-protocol](https://affpapa.org/en/nevibecode/skills/okx-agent-payments-protocol.md) — skill · 13700 installs
- [agentwallet](https://affpapa.org/en/nevibecode/skills/agentwallet.md) — skill · 2600 installs
- [x402](https://affpapa.org/en/nevibecode/skills/starchild-x402.md) — skill · 1200 installs
- [pay-with-app](https://affpapa.org/en/nevibecode/skills/pay-with-app.md) — skill · 524 installs
- [x402-payments](https://affpapa.org/en/nevibecode/skills/x402-payments.md) — skill · 462 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
