# mcp-braintree

Connects AI assistants to the Braintree GraphQL API. Lets agents process charges, store payment methods in the vault, and track payment disputes.

- 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/payments/braintree
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-braintree

## What it does

This MCP server exposes 22 operations on top of Braintree GraphQL endpoints. An assistant can charge transactions and process refunds directly in conversation. It also covers dispute handling, including evidence submission to card networks.

Raw card numbers are never accepted. Every payment mutation demands an existing `paymentMethodId` generated by Braintree client SDKs or minted via `create_client_token`. Charge amounts must be passed as strings such as `"10.50"` rather than numeric values.

Connection requires three environment variables: `BRAINTREE_MERCHANT_ID`, `BRAINTREE_PUBLIC_KEY`, and `BRAINTREE_PRIVATE_KEY`. It routes calls to the `sandbox` endpoint by default using API version `2019-01-01`. While `stdio` is the standard transport, an HTTP server mode is available on port 3000.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `BRAINTREE_MERCHANT_ID`, `BRAINTREE_PUBLIC_KEY`, `BRAINTREE_PRIVATE_KEY`, `BRAINTREE_ENV`, `BRAINTREE_API_VERSION` — 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 BRAINTREE_MERCHANT_ID=<BRAINTREE_MERCHANT_ID> --env BRAINTREE_PUBLIC_KEY=<BRAINTREE_PUBLIC_KEY> --env BRAINTREE_PRIVATE_KEY=<BRAINTREE_PRIVATE_KEY> --env BRAINTREE_ENV=<BRAINTREE_ENV> --env BRAINTREE_API_VERSION=<BRAINTREE_API_VERSION> --transport stdio braintree -- npx -y @codespar/mcp-braintree
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add braintree --env BRAINTREE_MERCHANT_ID=<BRAINTREE_MERCHANT_ID> --env BRAINTREE_PUBLIC_KEY=<BRAINTREE_PUBLIC_KEY> --env BRAINTREE_PRIVATE_KEY=<BRAINTREE_PRIVATE_KEY> --env BRAINTREE_ENV=<BRAINTREE_ENV> --env BRAINTREE_API_VERSION=<BRAINTREE_API_VERSION> -- npx -y @codespar/mcp-braintree
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "braintree": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-braintree"
            ],
            "env": {
                "BRAINTREE_MERCHANT_ID": "<BRAINTREE_MERCHANT_ID>",
                "BRAINTREE_PUBLIC_KEY": "<BRAINTREE_PUBLIC_KEY>",
                "BRAINTREE_PRIVATE_KEY": "<BRAINTREE_PRIVATE_KEY>",
                "BRAINTREE_ENV": "<BRAINTREE_ENV>",
                "BRAINTREE_API_VERSION": "<BRAINTREE_API_VERSION>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "braintree": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-braintree"
            ],
            "env": {
                "BRAINTREE_MERCHANT_ID": "<BRAINTREE_MERCHANT_ID>",
                "BRAINTREE_PUBLIC_KEY": "<BRAINTREE_PUBLIC_KEY>",
                "BRAINTREE_PRIVATE_KEY": "<BRAINTREE_PRIVATE_KEY>",
                "BRAINTREE_ENV": "<BRAINTREE_ENV>",
                "BRAINTREE_API_VERSION": "<BRAINTREE_API_VERSION>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e BRAINTREE_MERCHANT_ID=<BRAINTREE_MERCHANT_ID> -e BRAINTREE_PUBLIC_KEY=<BRAINTREE_PUBLIC_KEY> -e BRAINTREE_PRIVATE_KEY=<BRAINTREE_PRIVATE_KEY> -e BRAINTREE_ENV=<BRAINTREE_ENV> -e BRAINTREE_API_VERSION=<BRAINTREE_API_VERSION> braintree npx -y @codespar/mcp-braintree
```
Replace <…> with your own values

## When to use it
- authorize and capture payments via Braintree
- store payment methods securely in the customer vault
- mint client tokens for frontend and mobile SDKs
- submit dispute evidence to card networks

## Example prompts
- Generate a Braintree client token for the checkout page
- Look up transaction sub_123 and refund the amount "10.50"
- Check details for dispute dsp_456 and submit evidence

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

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
