mcp-payway — Claude Code MCP server: card payments in Argentina
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.
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-paywayWhat mcp-payway 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.
What it helps with
- 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
siteOperationIdor merchant
Example prompts for the agent
- 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
How to install mcp-payway
Platform CLI
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-paywayReplace <…> with your own values
Platform CLI
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-paywayReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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-paywayReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-payway
How do I install mcp-payway in Claude Code?
Run `claude mcp add mcp-payway -e PAYWAY_PUBLIC_API_KEY=<PAYWAY_PUBLIC_API_KEY> -e PAYWAY_PRIVATE_API_KEY=<PAYWAY_PRIVATE_API_KEY> -- npx -y @codespar/mcp-payway` with your own keys filled in.
What does mcp-payway do?
It connects an AI agent to the Payway payment gateway: card tokenization, charges, captures, payment lookups and refunds. Six tools sit on top of the Payway API.
Which API keys does the server need?
Two. Use PAYWAY_PUBLIC_API_KEY for tokenization and PAYWAY_PRIVATE_API_KEY for charges, captures, refunds and queries. Both go in the apikey header.