# PayPilot MCP server

> An agentic system that diagnoses failed subscription payments, determines retry strategies, and drafts dunning emails using deterministic rules and RAG.

- Repository: https://github.com/IvanSFlowGit/paypilot
- Page: https://hostedmcp.org/servers/ivansflowgit/paypilot
- Transport: stdio
- Stars: 0
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add paypilot -- uvx paypilot-ach-returns-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "paypilot": {
      "command": "uvx",
      "args": [
        "paypilot-ach-returns-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "paypilot": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "paypilot-ach-returns-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"paypilot","type":"stdio","command":"uvx","args":["paypilot-ach-returns-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "paypilot": {
      "command": "uvx",
      "args": [
        "paypilot-ach-returns-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add paypilot -- uvx paypilot-ach-returns-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.paypilot]
command = "uvx"
args = ["paypilot-ach-returns-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user paypilot uvx -- paypilot-ach-returns-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "paypilot": {
      "command": "uvx",
      "args": [
        "paypilot-ach-returns-mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `PAYPILOT_CONTRACT_BASE_URL` | no | no |  |
| `PAYPILOT_CONTRACT_TOKEN` | no | no |  |
| `PAYPILOT_DEMO_EMAIL` | no | no |  |
| `PAYPILOT_TENANT` | no | no |  |

## Tools (3)

- `lookup_return_code`
- `list_decisions`
- `explain`

## FAQ

### Does PayPilot automatically send emails?

No, it does not send emails unless sending is explicitly switched on, a person has approved the message, and the recipient is on the allowlist.

### How does the system decide on a retry strategy?

The strategy is determined by a deterministic rules table that maps failure codes to specific actions and retry cadences, rather than using an LLM for policy decisions.

### Can it handle Stripe webhooks?

Yes, it can accept real Stripe invoice.payment_failed events and verify them using the Stripe-Signature header.

### What happens if a failure code is not recognized?

If a code is not in the table, it fires a row named 'default' and the decision receipt indicates it fell through rather than matched.
