Skip to main content
BR

Braintree

v0.2.0API Key

PayPal-owned global payment processor. Target: LatAm SaaS selling to US/EU with existing Braintree accounts. GraphQL API (v2019-01-01) โ€” transactions, vault, customers, client tokens.

22 tools5 env vars๐ŸŒ GLOBALstable on npm

Install

terminal
$ npm install @codespar/mcp-braintree

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "braintree": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-braintree"
      ],
      "env": {
        "BRAINTREE_MERCHANT_ID": "<your_braintree_merchant_id>",
        "BRAINTREE_PUBLIC_KEY": "<your_braintree_public_key>",
        "BRAINTREE_PRIVATE_KEY": "<your_braintree_private_key>"
      }
    }
  }
}

After restart, your agent can call any of the 22 tools below โ€” try authorize_transaction first.

Environment variables ยท 5

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

BRAINTREE_MERCHANT_ID
required

Braintree merchant id (from the Control Panel > API).

BRAINTREE_PUBLIC_KEY
required

Braintree public API key โ€” Basic auth username.

BRAINTREE_PRIVATE_KEY
requiredsecret

Braintree private API key โ€” Basic auth password (secret).

BRAINTREE_ENV
optional

Braintree environment. 'sandbox' (default, https://payments.sandbox.braintree-api.com/graphql) or 'production' (https://payments.braintree-api.com/graphql).

BRAINTREE_API_VERSION
optional

Braintree-Version header value (YYYY-MM-DD). Defaults to 2019-01-01.

Available tools ยท 22

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

WRITEauthorize_transaction
Authorize a transaction (reserve funds without capturing) via Braintree GraphQL authorizePaymentMethod. Pass a paymentMethodId obtained from client-side tokenization (Drop-in / Hosted Fields / SDK nonce). Capture later with capture_transaction.
WRITEcharge_transaction
Authorize and capture a transaction atomically via Braintree GraphQL chargePaymentMethod. Use for one-step sales. For auth-now-capture-later split, use authorize_transaction + capture_transaction.
WRITEcapture_transaction
Capture a previously authorized transaction via captureTransaction. Amount defaults to full authorized amount when omitted (partial captures allowed up to the authorized total).
DELETErefund_transaction
Refund a settled transaction via refundTransaction. Amount defaults to the full settled amount when omitted. For partial refunds, pass a smaller amount.
DELETEvoid_transaction
Void an unsettled transaction (reverse the authorization) via reverseTransaction. Use when funds are authorized but not yet captured โ€” for captured/settled transactions use refund_transaction instead.
WRITEvault_payment_method
Permanently store a tokenized payment method in the Braintree vault via vaultPaymentMethod. The input paymentMethodId must be a single-use nonce; the mutation returns a permanent vaulted payment method id that can be reused for future charges.
DELETEdelete_payment_method
Delete a vaulted payment method via deletePaymentMethodFromVault. Irreversible โ€” the token cannot be used for future charges after deletion.
WRITEcreate_customer
Create a Braintree customer via createCustomer. Customers group multiple vaulted payment methods and transactions under one identity.

Compatible frameworks

MCP is a protocol โ€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

All credentials are encrypted at rest in an isolated vault scoped per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets โ€” it receives scoped, short-lived session tokens.
Servers โ€” Every LatAm commerce API your agent needs | CodeSpar