mcp-rede — Claude Code MCP server: Rede payments from an agent
Wires 22 tools of Brazilian acquirer Rede into your AI agent: authorizations, captures, refunds, card tokens, recurrences, 3DS and boleto.
claude mcp add --env REDE_PV=<REDE_PV> --env REDE_TOKEN=<REDE_TOKEN> --env REDE_ENV=<REDE_ENV> --transport stdio rede -- npx -y @codespar/mcp-redeWhat mcp-rede does
The server exposes eRede to the agent. authorize_transaction runs a card charge, capture_transaction settles one that was authorized with capture off, and two more calls void or refund it. Separate tools validate a card with no charge (zero_auth), store a reusable token (tokenize_card, plus get_token and delete_token), and manage subscriptions through create_recurrence, update_recurrence, disable_recurrence. You also get transaction listings by date range, 3DS authentication, and boleto issuing.
Every request carries HTTP Basic credentials built from PV and token, so the agent never touches the header itself. You supply REDE_PV and REDE_TOKEN from a Rede merchant contract; REDE_ENV picks sandbox or production and defaults to sandbox. No working pair means no live calls, so confirm the contract before wiring anything into an app.
It runs with npx over stdio. Set MCP_HTTP=true and MCP_PORT to switch to HTTP.
What it helps with
- charge a card through Rede without leaving the chat
- refund a payment that has already been captured
- store a card token instead of keeping the number in code
- start a subscription and pause it later
- issue a boleto and cancel it if unpaid
Example prompts for the agent
- Authorize a 150 BRL payment for order 4821 and give me the tid
- List Rede transactions from last week that were never captured
- Create a recurrence of 59.90 BRL using customer 7712's card token
How to install mcp-rede
Platform CLI
claude mcp add --env REDE_PV=<REDE_PV> --env REDE_TOKEN=<REDE_TOKEN> --env REDE_ENV=<REDE_ENV> --transport stdio rede -- npx -y @codespar/mcp-redeReplace <…> with your own values
Platform CLI
codex mcp add rede --env REDE_PV=<REDE_PV> --env REDE_TOKEN=<REDE_TOKEN> --env REDE_ENV=<REDE_ENV> -- npx -y @codespar/mcp-redeReplace <…> with your own values
Config file
{
"mcpServers": {
"rede": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-rede"
],
"env": {
"REDE_PV": "<REDE_PV>",
"REDE_TOKEN": "<REDE_TOKEN>",
"REDE_ENV": "<REDE_ENV>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"rede": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-rede"
],
"env": {
"REDE_PV": "<REDE_PV>",
"REDE_TOKEN": "<REDE_TOKEN>",
"REDE_ENV": "<REDE_ENV>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e REDE_PV=<REDE_PV> -e REDE_TOKEN=<REDE_TOKEN> -e REDE_ENV=<REDE_ENV> rede npx -y @codespar/mcp-redeReplace <…> 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-rede
How do I install mcp-rede in Claude Code?
Run claude mcp add mcp-rede -e REDE_PV=<REDE_PV> -e REDE_TOKEN=<REDE_TOKEN> -- npx -y @codespar/mcp-rede. Put your own credentials in place of the placeholders. A second form adds --env REDE_ENV=<REDE_ENV> and --transport stdio when you need another environment.
What does mcp-rede do?
It gives an AI agent the Rede payment toolkit: authorizations, captures, refunds, card tokens, recurrences, 3DS and boleto. The agent calls those tools directly, with no glue code in between.
What does the server need to run?
A REDE_PV and REDE_TOKEN pair from your Rede contract, which the server turns into a Basic auth header. REDE_ENV chooses sandbox or production.