# Donorbox Agentic Donations MCP Server ## Overview Enables AI assistants to discover Donorbox campaigns and generate donation links via the Model Context Protocol (MCP). This server does not process payments. It returns campaign data and pre-filled donation URLs. Payment is completed either in the user's browser or by the agent via Machine Payments Protocol (MPP), using Stripe Link MCP tools. ## Primary Endpoint https://agentic-donations.donorbox.org/mcp ## Protocol Model Context Protocol (MCP), Streamable HTTP transport, stateless mode. Payment-host OpenAPI discovery (x-payment-info on /api/agent/donate) is at https://donorbox.org/openapi.json — served by the payment host, not this MCP server. MCP tool descriptions mirror payment metadata; they do not replace host discovery. ## Authentication None required. ## Tools ### search_campaigns Search donation campaigns from organizations with agentic donations enabled. Fuzzy matching on campaign name, description, and org category/keywords. Returns 5 campaigns per page with id, name, org_name, description, currency, min_amt, max_amt, max_amt_enabled, and suggested_amounts. Call this first before creating a donation. ### create_donation Build a pre-filled donation URL for a campaign. Requires campaign_id (from search_campaigns) and amount in major currency units (e.g. 10.0 for $10), within campaign min/max. Optional donor fields pre-fill the form. Returns donationLink — not a completed donation. The URL keeps amount in major units (amount=10.0). The payment host converts that to a minor-unit digit string in the 402 challenge (e.g. request.amount "1000"). Two completion paths: - Browser: present donationLink to the user as a clickable link. - Agent (MPP): agent completes payment via Machine Payments Protocol (requires Link MCP tools below). Card-only: methodDetails.paymentMethodTypes is ["card"]. ## Agent Donation Workflow (MPP) Follow this sequence for agent-processed donations: 1. search_campaigns — pick a campaign; confirm amount is within min_amt / max_amt. 2. user-info_retrieve (Link MCP) — get donor first_name, last_name, email. 3. create_donation — pass campaign_id, amount (major units), and donor fields from step 2. 4. Probe donationLink — POST with no Authorization header to receive 402 Payment Required. Extract networkId from the WWW-Authenticate: Payment header (or use mpp_decode). networkId is per campaign org — never hardcode a Donorbox-wide profile. Decode request.amount as a minor-unit digit string (e.g. "1000" for $10). Challenge includes methodDetails.paymentMethodTypes: ["card"]. 5. spend-request_create (Link MCP) — credentialType "shared_payment_token", networkId from step 4, amount = challenge request.amount (not the URL query amount). Set test true when networkId starts with "profile_test_". Include lineItem/total and a context string (min 100 chars). 6. Present approval_url — show the user the approval_url from spend-request_create as a clickable link. Tell them to approve in the Link app, then poll spend-request_retrieve (interval 2). 7. mpp_pay (Link MCP) — once status is "approved", POST donationLink with spendRequestId. mpp_pay handles the 402 handshake. Donor attribution: donor fields are embedded in donationLink query params. Skipping user-info_retrieve yields a generic "Agent Donor" record. ## Link MCP Agent-processed donations require Stripe Link MCP alongside this server. Link MCP provides the tools for donor identity, spend approval, and MPP payment. Connect Link MCP: ```json { "mcpServers": { "donorbox": { "url": "https://agentic-donations.donorbox.org/mcp" }, "link": { "command": "npx", "args": ["@stripe/link-cli", "--mcp"] } } } ``` Install: npm i -g @stripe/link-cli Link MCP tools used in the donation workflow: - user-info_retrieve — Get donor first_name, last_name, email for create_donation - mpp_decode — Parse networkId and request.amount from a 402 WWW-Authenticate: Payment challenge - spend-request_create — Create a card SPT spend request using challenge networkId and minor-unit request.amount; returns approval_url - spend-request_retrieve — Poll spend request status until approved - mpp_pay — Complete the MPP handshake and pay donationLink Alternative to Link MCP: use an mppx-aware HTTP client or perform the manual 402 → SPT → retry handshake directly. This server holds no Stripe credentials — payment credentials live in the agent or Link app. ## Recommended Usage 1. Call search_campaigns to find a campaign. 2. Confirm amount with the user (respect min_amt / max_amt; major units). 3. Call create_donation to get donationLink. 4. For agent-processed donations, require explicit user approval before payment. 5. For SPT minting, use challenge request.amount and networkId — not the donationLink query amount or a hardcoded profile. Prefer live tool results over assumptions about campaign data. ## Safety - create_donation only builds a link; it does not charge cards. - Financial transactions require explicit user intent and user approval in the Link app. - Never expose payment credentials, OAuth tokens, or internal identifiers. - Each MPP challenge is one-time use (~5 min expiry). To donate again, call create_donation for a fresh link. - Card-only SPT creation (paymentMethodTypes: ["card"]). ## Data Freshness Campaign data is fetched from Donorbox at request time. ## Health Check GET https://agentic-donations.donorbox.org/up ## Website https://donorbox.org