An unofficial Model Context Protocol (MCP) server for interacting with PayPal Braintree payment processing services. This project is available under the MIT License with an Academic Citation Requirement. This means you can freely use, modify, and distribute the code, but any academic or scientific publication that uses this software must provide appropriate attribution. If you use this software in
Add this skill
npx mdskills install QuentinCody/braintree-mcp-serverWell-documented MCP server with clear Braintree API integration and multiple transport options.
1# Braintree MCP Server23An unofficial Model Context Protocol (MCP) server for interacting with PayPal Braintree payment processing services.45## License and Citation67This project is available under the MIT License with an Academic Citation Requirement. This means you can freely use, modify, and distribute the code, but any academic or scientific publication that uses this software must provide appropriate attribution.89### For academic/research use:10If you use this software in a research project that leads to a publication, presentation, or report, you **must** cite this work according to the format provided in [CITATION.md](CITATION.md).1112### For commercial/non-academic use:13Commercial and non-academic use follows the standard MIT License terms without the citation requirement.1415By using this software, you agree to these terms. See [LICENSE.md](LICENSE.md) for the complete license text.1617## Server Versions1819There are two versions of the Braintree MCP server available:2021### 1. STDIO Transport Server (`braintree_server.py`)2223- Uses standard input/output (STDIO) for communication24- Designed for integrations with Claude Desktop and other MCP clients that support STDIO25- Each client session spawns a new server process26- The server terminates when the client disconnects2728**Usage with Claude Desktop:**291. Configure `claude_desktop_config.json` to point to this server302. Open Claude Desktop and select the Braintree tool3132### 2. SSE Transport Server (`braintree_sse_server.py`)3334- Uses Server-Sent Events (SSE) for communication35- Designed as a standalone web server that can handle multiple client connections36- Server runs persistently until manually stopped37- Binds to `127.0.0.1:8001` by default (configurable)3839**Manual Usage:**40```bash41python braintree_sse_server.py42```4344**Connecting to the SSE server:**45Use an MCP client that supports SSE transport and connect to `http://127.0.0.1:8001/sse`4647## Overview4849This server implements the Model Context Protocol (MCP) specification to provide AI assistant models with direct, structured access to Braintree's payment processing capabilities via GraphQL API. It enables AI systems to perform payment operations like fetching transactions, creating payments, and managing customer data through MCP tools.5051## Installation52531. Clone this repository54```bash55git clone https://github.com/yourusername/braintree-mcp-server.git56cd braintree-mcp-server57```58592. Set up a Python 3.13+ environment60```bash61# If using pyenv62pyenv install 3.13.063pyenv local 3.13.06465# Or using another method to ensure Python 3.13+66```67683. Install dependencies69```bash70pip install -e .71```7273## Configuration7475Create a `.env` file in the project root with your Braintree credentials:7677```78BRAINTREE_MERCHANT_ID=your_merchant_id79BRAINTREE_PUBLIC_KEY=your_public_key80BRAINTREE_PRIVATE_KEY=your_private_key81BRAINTREE_ENVIRONMENT=sandbox # or production82```8384You can obtain these credentials from your Braintree Control Panel.8586## Usage8788### Running the server8990#### Default STDIO Transport91```bash92python braintree_server.py93```9495The server runs using stdio transport by default, which is suitable for integration with AI assistant systems that support MCP.9697#### Server-Sent Events (SSE) Transport98```bash99python braintree_sse_server.py100```101102The SSE server provides a web-based transport layer that allows multiple persistent client connections. This is useful for standalone deployments where multiple clients need to access the Braintree functionality.103104Default configuration:105- Host: 127.0.0.1 (localhost)106- Port: 8001107- Environment: Defined in your .env file108109See `requirements.txt` for the required dependencies.110111### Available MCP Tools112113#### braintree_ping114115Simple connectivity test to check if your Braintree credentials are working.116117```python118response = await braintree_ping()119# Returns "pong" if successful120```121122#### braintree_execute_graphql123124Execute arbitrary GraphQL queries against the Braintree API.125126```python127query = """128query GetTransactionDetails($id: ID!) {129 node(id: $id) {130 ... on Transaction {131 id132 status133 amount {134 value135 currencyCode136 }137 createdAt138 }139 }140}141"""142143variables = {"id": "transaction_id_here"}144145response = await braintree_execute_graphql(query, variables)146# Returns JSON response from Braintree147```148149## Common GraphQL Operations150151### Fetch Customer152153```graphql154query GetCustomer($id: ID!) {155 node(id: $id) {156 ... on Customer {157 id158 firstName159 lastName160 email161 paymentMethods {162 edges {163 node {164 id165 details {166 ... on CreditCardDetails {167 last4168 expirationMonth169 expirationYear170 cardType171 }172 }173 }174 }175 }176 }177 }178}179```180181### Create Transaction182183```graphql184mutation CreateTransaction($input: ChargePaymentMethodInput!) {185 chargePaymentMethod(input: $input) {186 transaction {187 id188 status189 amount {190 value191 currencyCode192 }193 }194 }195}196```197198With variables:199```json200{201 "input": {202 "paymentMethodId": "payment_method_id_here",203 "transaction": {204 "amount": "10.00",205 "orderId": "order123",206 "options": {207 "submitForSettlement": true208 }209 }210 }211}212```213214## Troubleshooting215216- Ensure your Braintree credentials are correct in the `.env` file217- Verify your network connection can reach Braintree's API endpoints218- Check for any rate limiting or permission issues with your Braintree account
Full transparency — inspect the skill content before installing.