# mcp-payway

Gives an AI agent access to the Payway gateway: tokenize a card, charge it, capture or refund. Built for teams wiring payments into an Argentine merchant setup.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/argentina/payway
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-payway

## What it does

Six tools cover the payment flow. `create_token` swaps card details for a single-use token. `create_payment` charges that token, either as a plain sale or split across recipients, with installments. `confirm_payment` captures an authorized payment in the two-step flow. Lookups go through `get_payment` and `list_payments`, while `refund_payment` handles a full or partial return.

Two API keys sit behind the tools, and they are not equal. The public one reaches tokenization only. Everything else — charges, captures, refunds, queries — needs the private key. Both travel in a header called `apikey`; `Authorization: Bearer` will not work. `PAYWAY_ENV` picks `sandbox` or `production`, and it defaults to sandbox on the Decidir host.

Amounts arrive as integers in minor units, so `50000` means ARS 500.00. Agents have no card data of their own — PAN, expiry and CVV must come from the user or a vault. Card brand goes in `payment_method_id`: 1 is Visa, 31 Mastercard, 15 Maestro. The merchant-side idempotency anchor is `site_transaction_id`, unique per sale.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `PAYWAY_PUBLIC_API_KEY`, `PAYWAY_PRIVATE_API_KEY`, `PAYWAY_ENV` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env PAYWAY_PUBLIC_API_KEY=<PAYWAY_PUBLIC_API_KEY> --env PAYWAY_PRIVATE_API_KEY=<PAYWAY_PRIVATE_API_KEY> --env PAYWAY_ENV=<PAYWAY_ENV> --transport stdio payway -- npx -y @codespar/mcp-payway
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add payway --env PAYWAY_PUBLIC_API_KEY=<PAYWAY_PUBLIC_API_KEY> --env PAYWAY_PRIVATE_API_KEY=<PAYWAY_PRIVATE_API_KEY> --env PAYWAY_ENV=<PAYWAY_ENV> -- npx -y @codespar/mcp-payway
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "payway": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-payway"
            ],
            "env": {
                "PAYWAY_PUBLIC_API_KEY": "<PAYWAY_PUBLIC_API_KEY>",
                "PAYWAY_PRIVATE_API_KEY": "<PAYWAY_PRIVATE_API_KEY>",
                "PAYWAY_ENV": "<PAYWAY_ENV>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "payway": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-payway"
            ],
            "env": {
                "PAYWAY_PUBLIC_API_KEY": "<PAYWAY_PUBLIC_API_KEY>",
                "PAYWAY_PRIVATE_API_KEY": "<PAYWAY_PRIVATE_API_KEY>",
                "PAYWAY_ENV": "<PAYWAY_ENV>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PAYWAY_PUBLIC_API_KEY=<PAYWAY_PUBLIC_API_KEY> -e PAYWAY_PRIVATE_API_KEY=<PAYWAY_PRIVATE_API_KEY> -e PAYWAY_ENV=<PAYWAY_ENV> payway npx -y @codespar/mcp-payway
```
Replace <…> with your own values

## When to use it
- turn raw card details into a single-use token
- charge a card with installments through Payway
- capture a payment after a two-step authorization
- issue a partial refund against a payment
- pull payments by `siteOperationId` or merchant

## Example prompts
- Tokenize this card in Payway, then charge 50000 in sandbox
- List payments for the merchant over the last period
- Refund half of the last payment with `refund_payment`

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
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
