About mcp-braintree
mcp-braintree is an MCP server for Braintree (PayPal) that handles card payments through the Braintree GraphQL API, including authorization, capture, refunds, and vaulting. It is aimed at LatAm SaaS companies selling to US and EU buyers that already hold a Braintree merchant account. Card data is tokenized client-side, and the server does not accept raw card numbers.
Key features
- 01Authorize, capture, charge, refund, and void transactions
- 02Vault storage and deletion of payment methods
- 03Customer creation, update, search, and deletion
- 04Dispute lookup, acceptance, and evidence finalization
- 05Client token generation for front-end tokenization
Use cases
- 01Charging and refunding SaaS subscriptions through an agent
- 02Managing customers with vaulted payment methods
- 03Tracking and responding to credit card disputes
MCP support
The project is an MCP server that exposes 22 tools to MCP clients for payment and customer operations via the Braintree GraphQL API.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y @codespar/mcp-braintreeBRAINTREE_MERCHANT_IDBraintree merchant id (from the Control Panel > API).BRAINTREE_PUBLIC_KEYSecretBraintree public API key — Basic auth username.BRAINTREE_PRIVATE_KEYSecretBraintree private API key — Basic auth password (secret).BRAINTREE_ENVBraintree environment. 'sandbox' (default, https://payments.sandbox.braintree-api.com/graphql) or 'production' (https://payments.braintree-api.com/graphql).BRAINTREE_API_VERSIONBraintree-Version header value (YYYY-MM-DD). Defaults to 2019-01-01.Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
22Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | string | Yes | Amount as a decimal string (e.g. '10.50'). Braintree amounts are strings. |
| orderId | string | No | Merchant-side order reference. |
| transaction | object | No | Additional TransactionInput fields (customerDetails, billingAddress, shippingAddress, descriptor, customFields, riskData, lineItems, etc). Merged with amount/orderId/merchantAccountId. |
| paymentMethodId | string | Yes | Tokenized payment method id or nonce (from client SDK). |
| merchantAccountId | string | No | Optional merchant account id (for multi-currency / multi-account merchants). |
Details
From the project README@codespar/mcp-braintree
MCP server for Braintree (PayPal) — global card processing via the Braintree GraphQL API.
Target customer: LatAm SaaS selling to US/EU buyers who already hold a Braintree merchant account and want agent-driven payments, vaulting, and customer management.
Tools (22)
| Tool | Purpose |
|---|---|
authorize_transaction | Authorize a transaction (reserve funds without capturing) via Braintree GraphQL authorizePaymentMethod. |
charge_transaction | Authorize and capture a transaction atomically via Braintree GraphQL chargePaymentMethod. |
capture_transaction | Capture a previously authorized transaction via captureTransaction. |
refund_transaction | Refund a settled transaction via refundTransaction. |
void_transaction | Void an unsettled transaction (reverse the authorization) via reverseTransaction. |
vault_payment_method | Permanently store a tokenized payment method in the Braintree vault via vaultPaymentMethod. |
delete_payment_method | Delete a vaulted payment method via deletePaymentMethodFromVault. |
create_customer | Create a Braintree customer via createCustomer. |
update_customer | Update an existing Braintree customer via updateCustomer. |
get_transaction | Fetch a transaction by id via the GraphQL search.transactions query. |
get_customer | Fetch a customer by id via the GraphQL node(id:) query. |
submit_for_settlement | Submit a previously authorized transaction for settlement via submitTransactionForSettlement. |
update_payment_method | Update metadata on a vaulted payment method via updatePaymentMethod. |
verify_payment_method | Run a credit-card verification (zero-auth or $1 auth) on a tokenized payment method via verifyPaymentMethod. |
delete_customer | Delete a Braintree customer via deleteCustomer. |
find_customer | Search for customers via the GraphQL search.customers query. |
search_transactions | Search transactions via the GraphQL search.transactions query. |
find_dispute | Fetch a dispute by id via the GraphQL node(id:) query. |
accept_dispute | Accept liability for a dispute via acceptDispute — the merchant concedes and the disputed amount is refunde... |
finalize_dispute | Finalize a dispute via finalizeDispute — submits previously added evidence to the card network for review. |
find_merchant_account | Fetch a merchant account by id via the GraphQL node(id:) query. |
create_client_token | Mint a Braintree client token via createClientToken for client-side tokenization (Drop-in, Hosted Fields, m... |
Install
npm install @codespar/mcp-braintree
Environment
BRAINTREE_MERCHANT_ID="..." # merchant id
BRAINTREE_PUBLIC_KEY="..." # public API key (Basic auth user)
BRAINTREE_PRIVATE_KEY="..." # private API key (Basic auth password, secret)
BRAINTREE_ENV="sandbox" # 'sandbox' (default) or 'production'
BRAINTREE_API_VERSION="2019-01-01" # optional, Braintree-Version header
Endpoints:
sandbox→https://payments.sandbox.braintree-api.com/graphqlproduction→https://payments.braintree-api.com/graphql
Authentication
Braintree's GraphQL endpoint accepts HTTP Basic auth with PUBLIC_KEY:PRIVATE_KEY base64-encoded. Every request also requires a Braintree-Version: YYYY-MM-DD header — the server defaults to 2019-01-01 and can be overridden with BRAINTREE_API_VERSION.
Payment method ids
Most mutations take a paymentMethodId. These come from client-side tokenization (Braintree Drop-in / Hosted Fields / SDKs) — the server does not accept raw PANs. Use create_client_token to mint a token for the browser or mobile SDK.
Run
# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-braintree
# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-braintree
Notes
- Amount is a string in Braintree GraphQL (e.g.
"10.50"), not a number. The server forwards whatever shape the agent passes; strings are the safe default. - Braintree's GraphQL schema evolves; some input fields not exposed in the MCP
inputSchemacan still be passed inadditional/ nested objects and will be forwarded.
Enterprise
Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.