# PayStage Preflight MCP server

> Evaluates x402 PaymentRequired requests against local spending policies to determine if an AI agent should proceed, review, or stop a payment.

- Repository: https://github.com/base-buzz/paystage
- Page: https://hostedmcp.org/servers/base-buzz/preflight
- Transport: stdio
- Stars: 5
- License: MIT
- Latest version: 0.2.2

## Install

### Claude Code

```sh
claude mcp add preflight -- npx -y @paystage/preflight
```

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

```json
{
  "mcpServers": {
    "preflight": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/preflight"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "preflight": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@paystage/preflight"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"preflight","type":"stdio","command":"npx","args":["-y","@paystage/preflight"]}'
```

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

```json
{
  "mcpServers": {
    "preflight": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/preflight"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add preflight -- npx -y @paystage/preflight
```

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

```toml
[mcp_servers.preflight]
command = "npx"
args = ["-y", "@paystage/preflight"]
```

### Gemini CLI

```sh
gemini mcp add -s user preflight npx -- -y @paystage/preflight
```

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

```json
{
  "mcpServers": {
    "preflight": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/preflight"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `PAYSTAGE_POLICY_PATH` | no | no | Path to policy.json spending rules |

## FAQ

### What are the possible verdicts from the server?

The server returns one of three verdicts: pay (safe to proceed), review (requires human intervention), or do_not_pay (violates policy).

### How is the spending policy stored and accessed?

The policy is stored locally in a JSON file on your machine, ensuring no secrets or network calls are needed to make a decision.

### Does this server require network access to evaluate policies?

No, the package itself does not use network access or URL strings for policy evaluation.

### Can I use this with Claude Desktop or Cursor?

Yes, it runs as a stdio MCP server that can be integrated into Claude Desktop and Cursor via their respective configuration files.
