# paystage [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/base-buzz/paystage  
**GitHub Stars:** 9  
**npm Downloads (last month):** 10751  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/paystage

## Description
Your agent's wallet should not sign because a server asked it to. Preflight, policy and spend limits for x402 payments on Base. Free tier — no signup.

## Tools
Capabilities this server exposes over MCP:

- **evaluate_mcp_payment** — Call this BEFORE signing any x402 payment. Verdict is pay | review | do_not_pay, each with stable reason codes (e.g. 'amount 1.00 USDC exceeds max_amount 0.05 USDC'). Returns the decision plus a signed receipt you can verify offline with verify_receipt. Read-only: holds no keys, never signs, never moves funds. A refusal costs nothing.
- **list_outstanding_auths** — Call this when auditing what an agent could still spend without a new signature — ERC-20 allowances, Permit2 and EIP-3009 authorisations. Returns each authorisation with spender, amount and expiry. Read-only and needs only a public RPC; no key, no funds moved. Use it after an incident to see what remains exposed, not to revoke anything (this tool cannot revoke).
- **evaluate_outstanding_auths** — Call this when an agent already holds authorisations and you need to know which are dangerous. Verdict is pay | review | do_not_pay per authorisation, with reason codes naming the rule that fired (unlimited allowance, expiry already passed, spender not on the allow-list). Returns per-authorisation decisions plus a summary action. Read-only: never revokes, never signs. Revocation is a transaction you send yourself.
- **evaluate_hip3_trade** — Call this BEFORE an agent places a HIP-3 / trade.xyz order. Verdict is allow | review | do_not_trade, with the rule that fired (notional above cap, market not allowed, leverage too high). Returns the decision and a one-line reason. Local policy only: this is not financial advice, holds no keys, and cannot place or cancel an order. Prices come from a read-only market query.
- **evaluate_velocity** — Call this when an agent is about to make its Nth payment and you need to know whether the rate itself is the risk. Verdict is pay | review | do_not_pay over a rolling window (per-hour and per-day spend, count of payees). Returns the decision plus which window was breached. Read-only: it reads the history you pass in, holds no keys, and calls no external service.
- **verify_receipt** — Call this when you have a receipt and want to know whether it is genuine, without trusting the server that issued it. Returns VALID with the verdict it attests to, INVALID if the payload was altered, or UNVERIFIABLE when the key cannot be fetched — and UNVERIFIABLE is a refusal, not a pass. Needs only the receipt JSON and a network connection; no account, no shared secret. Fetches the signing key from a published URL you can pin with key_url.
- **decode_payment_required** — Call this first when a 402 response arrives and you cannot read the payment-required header. Returns the decoded x402 v2 challenge: scheme, network, asset, atomic amount, payee, resource and timeout. Pure decoding: no network call, no signature, no verdict — use evaluate_mcp_payment when you want a decision. Fails closed with a named error if the header is malformed or not base64.
- **validate_policy** — Call this before wiring a policy into anything: a policy that fails validation makes every evaluation refuse, which looks like a product bug and is not one. Returns valid: true, or the exact field and message that is wrong. No payment needed, no network call, no key. Use it in CI on the policy file your agent ships with.
- **evaluate_batch** — Call this when an agent might pay several times in one turn and you want one policy decision covering all of them. Verdict is pay | review | do_not_pay per item, in input order, with reason codes — so the agent can stop at the first refusal rather than discovering it after three payments. Read-only, holds no keys, never signs. Cheaper and more consistent than calling evaluate_mcp_payment in a loop: same policy, one round trip.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation

## What paystage does

paystage places a decision layer before payment signing. It evaluates an x402 challenge against a policy and returns one of three outcomes: `pay`, `review`, or `do_not_pay`. The result includes the rule that produced the verdict and a receipt that can be retained. The wallet remains the only component that signs transactions; paystage does not hold keys, sign, or move funds.

The policy can constrain payment details such as the payee, amount, and asset. The same approach covers HIP-3 and trade.xyz orders, where the outcomes are `allow`, `review`, or `do_not_trade`. Review is an instruction for the caller to handle: a policy can treat it as permission or as a refusal.

## How it works

The local package communicates with an agent application over stdio. It can read a policy file for convenience, while policies may also be supplied as arguments to individual tool calls. A hosted endpoint is available at `https://api.paystage.xyz/mcp` over Streamable HTTP, and a direct HTTP evaluation endpoint is available for `evaluate_mcp_payment`.

All nine MCP tools are read-only. Evaluation can run without network access in local examples, while on-chain checks may use an RPC endpoint. The local CLI defaults to a public Base RPC when an RPC URL is not supplied.

## Setup and configuration

Run the server without a local installation with:

```bash
npx -y -p @paystage/mcp paystage-mcp
```

For a local dependency, install `@paystage/mcp` and run its `paystage-mcp` binary. The process waits for an MCP client connection. The MCP server itself starts with an empty environment and does not require configuration to complete its handshake or list tools.

The stdio CLI accepts two optional environment variables:

- `PAYSTAGE_POLICY_PATH` points to a local `policy.json` file.
- `PAYSTAGE_RPC_URL` selects the RPC endpoint used for on-chain checks.

To use the remote service, configure an MCP client with `https://api.paystage.xyz/mcp`. Claude Code and Cursor examples are included in the project, and Claude Desktop can use the same MCP configuration pattern. The hosted endpoint offers the first 1,000 calls per IP per day without an account or payment.

## Tools and capabilities

- `evaluate_mcp_payment` decides whether an x402 payment should be signed.
- `list_outstanding_auths` finds pending ERC-20, Permit2, and EIP-3009 authorisations.
- `evaluate_outstanding_auths` identifies authorisations needing attention before payment.
- `evaluate_hip3_trade` evaluates HIP-3 and trade.xyz orders.
- `evaluate_velocity` detects bursts, spikes, and runaway spending cadence.
- `verify_receipt` checks that a receipt belongs to the expected payment and remains valid.
- `decode_payment_required` decodes a base64-encoded 402 payment header.
- `validate_policy` reports whether a policy is valid and identifies an invalid field.
- `evaluate_batch` evaluates multiple payments and returns a verdict for each.

## Limitations and notes

paystage is a preflight gate, not a settlement monitor or a guarantee that a seller will deliver. It cannot reverse payments that have already settled, identify every legitimate-looking but unreliable payee, or cover payments made outside the wrapper. Review the project’s stated boundaries before relying on it for unattended funds movement. The agent or another wallet component still performs the final signing decision.

_Full upstream README: https://allmcps.com/mcp/paystage/readme_

