mcp-braintree — Claude Code MCP server: what it does, how to install
Connects AI assistants to the Braintree GraphQL API. Lets agents process charges, store payment methods in the vault, and track payment disputes.
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-braintreeWhat mcp-braintree 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.
What it helps with
- 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 for the agent
- 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
How to install mcp-braintree
Platform CLI
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-braintreeReplace <…> with your own values
Platform CLI
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-braintreeReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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-braintreeReplace <…> 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-braintree
How to install mcp-braintree in Claude Code?
Run `claude mcp add mcp-braintree -e BRAINTREE_MERCHANT_ID=<BRAINTREE_MERCHANT_ID> -e BRAINTREE_PUBLIC_KEY=<BRAINTREE_PUBLIC_KEY> -e BRAINTREE_PRIVATE_KEY=<BRAINTREE_PRIVATE_KEY> -- npx -y @codespar/mcp-braintree`. Make sure to replace the bracketed placeholders with your actual API credentials.
What does mcp-braintree do?
It provides 22 tools to execute operations through the Braintree GraphQL API. Assistants can authorize charges, create customer profiles, and contest chargebacks.
Can agents process raw credit card numbers?
No, raw card numbers cannot be submitted. The API requires a paymentMethodId generated beforehand using Drop-in fields or the create_client_token tool.