Skip to main content
BR

Braintree

v0.2.1API Key

Processador de pagamentos global do PayPal. Alvo: SaaS da LatAm vendendo pra US/EU com contas Braintree existentes. API GraphQL (v2019-01-01) — transações, vault, clientes, client tokens.

22 ferramentas5 env vars🌐 GLOBALestável no npm

O que seu agente faz

O Braintree dá ao seu agente 22 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer cliente MCP.

  • authorize_transactionAuthorize 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.
  • charge_transactionAuthorize 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.
  • capture_transactionCapture a previously authorized transaction via captureTransaction. Amount defaults to full authorized amount when omitted (partial captures allowed up to the authorized total).
Exemplo de chamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("authorize_transaction", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-braintree

Quickstart

Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com MCP).

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>"
      }
    }
  }
}

Depois de reiniciar, seu agente pode chamar qualquer uma das 22 ferramentas abaixo — teste authorize_transaction primeiro.

Variáveis de ambiente · 5

Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.

BRAINTREE_MERCHANT_ID
obrigatório

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

BRAINTREE_PUBLIC_KEY
obrigatório

Braintree public API key — Basic auth username.

BRAINTREE_PRIVATE_KEY
obrigatóriosecret

Braintree private API key — Basic auth password (secret).

BRAINTREE_ENV
opcional

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

BRAINTREE_API_VERSION
opcional

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

Ferramentas disponíveis · 22

Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.

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.

Frameworks compatíveis

MCP é um protocolo — qualquer framework que o fale pode montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Qualquer cliente MCPProtocolo

Perguntas frequentes

Rode `npx -y @codespar/mcp-braintree` e adicione o bloco de config acima ao seu cliente MCP — Claude, Cursor, VS Code ou qualquer cliente compatível com MCP. Sem build, sem SDK. Prefere hospedado? O tier gerenciado da CodeSpar roda pra você, com a auth resolvida.
Braintree — MCP server · 22 tools | CodeSpar