Braintree MCP server

Finance and commerce

MCP server for Braintree (PayPal), global card processing via GraphQL: charge, refund, vault.

Your AI app calls the Braintree MCP server, which does the finance and commerce work and sends the result back to the chat.

About Braintree

Braintree is a community MCP server from codespar, filed in our directory under finance and commerce. MCP server for Braintree (PayPal), global card processing via GraphQL: charge, refund, vault.

Braintree runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-braintree@0.2.2 and talks to it over standard input and output. It needs BRAINTREE_MERCHANT_ID, BRAINTREE_PUBLIC_KEY and BRAINTREE_PRIVATE_KEY set before Braintree starts.

Braintree is listed in the official MCP registry as io.github.codespar/mcp-braintree, version 0.2.2.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-braintree
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-braintree

How to set up Braintree

  1. Install Node.js on the machine that runs your AI app, because Braintree starts with npx and downloads its package on first run.
  2. Create BRAINTREE_MERCHANT_ID, BRAINTREE_PUBLIC_KEY and BRAINTREE_PRIVATE_KEY for Braintree in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Braintree to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Braintree tools to confirm the connection.
  5. Run one read-only task with Braintree first, and keep your app asking before each tool call until the results look right.

Braintree compared with similar servers

  • Brasil API by codespar has fewer GitHub stars than Braintree (278 against 278); both are community servers, and both run locally.
  • Bradesco by codespar has fewer GitHub stars than Braintree (278 against 278); both are community servers, and both run locally.
  • Braspag by codespar has fewer GitHub stars than Braintree (278 against 278); both are community servers, and both run locally.

Before you connect Braintree

  • Give Braintree its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Braintree tool call until you trust what it does with them.
  • Treat text that Braintree fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Braintree on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Braintree

How marketing and sales teams put Braintree to work, by company size. Pick the size closest to yours and start Braintree on one use case.

Small business

  • A small business can ask Braintree which products and customers drive margin, then plan promotions around them.
  • Owners can use Braintree to check refunds, failed payments and churn reasons without opening three dashboards.
  • Braintree runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Braintree to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Braintree to check spend against budget each week and move money to what's working.
  • Start Braintree on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Braintree read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Braintree to answer revenue questions by channel and region with figures finance signs off on.
  • Braintree is a community server, so have security review the code and pin a version before Braintree touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Braintree README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@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/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

Questions about Braintree

What is the Braintree MCP server?

MCP server for Braintree (PayPal), global card processing via GraphQL: charge, refund, vault. Braintree is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Braintree MCP server?

Add Braintree to your AI app's MCP config with the command npx -y @codespar/mcp-braintree@0.2.2. In Claude Code, run claude mcp add --transport stdio codespar-braintree -- npx -y @codespar/mcp-braintree@0.2.2. To run Braintree this way you need Node.js installed.

Does Braintree need an API key?

Yes. Braintree expects BRAINTREE_MERCHANT_ID, BRAINTREE_PUBLIC_KEY and BRAINTREE_PRIVATE_KEY to be set. Create the key for Braintree in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Braintree an official MCP server?

No. Braintree is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Braintree access to company data.

What license is Braintree under?

Braintree is released under the MIT license, according to its GitHub repository. The license covers the code of Braintree; the service it connects to has its own terms.