mcpField
M
mcp-braintree

mcp-braintree

Local
github.com/codesparFinance275Updated 4w ago

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

  1. 01Authorize, capture, charge, refund, and void transactions
  2. 02Vault storage and deletion of payment methods
  3. 03Customer creation, update, search, and deletion
  4. 04Dispute lookup, acceptance, and evidence finalization
  5. 05Client token generation for front-end tokenization

Use cases

  1. 01Charging and refunding SaaS subscriptions through an agent
  2. 02Managing customers with vaulted payment methods
  3. 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.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-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>"
}
}
}
}
Run commandnpx -y @codespar/mcp-braintree
Environment variables to set
BRAINTREE_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.

Packages
npm@codespar/mcp-braintree0.2.2

Tools

22

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
amountstringYesAmount as a decimal string (e.g. '10.50'). Braintree amounts are strings.
orderIdstringNoMerchant-side order reference.
transactionobjectNoAdditional TransactionInput fields (customerDetails, billingAddress, shippingAddress, descriptor, customFields, riskData, lineItems, etc). Merged with amount/orderId/merchantAccountId.
paymentMethodIdstringYesTokenized payment method id or nonce (from client SDK).
merchantAccountIdstringNoOptional 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)

ToolPurpose
authorize_transactionAuthorize a transaction (reserve funds without capturing) via Braintree GraphQL authorizePaymentMethod.
charge_transactionAuthorize and capture a transaction atomically via Braintree GraphQL chargePaymentMethod.
capture_transactionCapture a previously authorized transaction via captureTransaction.
refund_transactionRefund a settled transaction via refundTransaction.
void_transactionVoid an unsettled transaction (reverse the authorization) via reverseTransaction.
vault_payment_methodPermanently store a tokenized payment method in the Braintree vault via vaultPaymentMethod.
delete_payment_methodDelete a vaulted payment method via deletePaymentMethodFromVault.
create_customerCreate a Braintree customer via createCustomer.
update_customerUpdate an existing Braintree customer via updateCustomer.
get_transactionFetch a transaction by id via the GraphQL search.transactions query.
get_customerFetch a customer by id via the GraphQL node(id:) query.
submit_for_settlementSubmit a previously authorized transaction for settlement via submitTransactionForSettlement.
update_payment_methodUpdate metadata on a vaulted payment method via updatePaymentMethod.
verify_payment_methodRun a credit-card verification (zero-auth or $1 auth) on a tokenized payment method via verifyPaymentMethod.
delete_customerDelete a Braintree customer via deleteCustomer.
find_customerSearch for customers via the GraphQL search.customers query.
search_transactionsSearch transactions via the GraphQL search.transactions query.
find_disputeFetch a dispute by id via the GraphQL node(id:) query.
accept_disputeAccept liability for a dispute via acceptDispute — the merchant concedes and the disputed amount is refunde...
finalize_disputeFinalize a dispute via finalizeDispute — submits previously added evidence to the card network for review.
find_merchant_accountFetch a merchant account by id via the GraphQL node(id:) query.
create_client_tokenMint 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/graphql
  • production → 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 inputSchema can still be passed in additional / 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

Markdown supported

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.