mcpField
M
mcp-paypal

mcp-paypal

Local
github.com/codesparFinance275Updated 4w ago

About mcp-paypal

mcp-paypal is an MCP server for PayPal that wraps the PayPal REST API for global payments and payouts, with 19 tools covering orders, subscriptions and disputes. It targets LatAm SaaS and marketplaces that already hold a PayPal merchant account and want agent-driven checkout and payouts. It supports both sandbox and live environments.

Key features

  1. 01Provides 19 PayPal-related tools
  2. 02Supports order creation, authorization, capture and refunds
  3. 03Supports batch payouts and payout item lookup
  4. 04Manages subscription creation, lookup and cancellation
  5. 05Covers dispute lookup and webhook signature verification

Use cases

  1. 01Creating and capturing PayPal orders through an agent
  2. 02Running batch payouts and checking payout status
  3. 03Managing subscriptions and handling dispute claims

MCP support

This project is an MCP server that exposes PayPal REST API operations as tools to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-paypal": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-paypal"
],
"env": {
"PAYPAL_CLIENT_ID": "<PAYPAL_CLIENT_ID>",
"PAYPAL_CLIENT_SECRET": "<PAYPAL_CLIENT_SECRET>",
"PAYPAL_ENV": "<PAYPAL_ENV>"
}
}
}
}
Run commandnpx -y @codespar/mcp-paypal
Environment variables to set
PAYPAL_CLIENT_IDPayPal REST app client id (from developer.paypal.com Apps & Credentials).
PAYPAL_CLIENT_SECRETSecretPayPal REST app client secret (OAuth2 client_credentials password).
PAYPAL_ENVPayPal environment. 'sandbox' (default, https://api-m.sandbox.paypal.com) or 'live' (https://api-m.paypal.com).

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-paypal0.1.2

Tools

19

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
bodyobjectNoAdditional Order create body fields merged into the request (application_context, etc).
intentenumYesCapture immediately on buyer approval, or authorize for later capture.CAPTURE | AUTHORIZE
payment_sourceobjectNoOptional payment_source object (e.g. { paypal: { experience_context: { return_url, cancel_url } } } or { card: { ... } }).
purchase_unitsarrayYesArray of purchase_unit objects. Each must include amount: { currency_code, value }. Optional: reference_id, description, items, shipping, payee.
paypalRequestIdstringNoOptional PayPal-Request-Id header for idempotency.

Details

From the project README

@codespar/mcp-paypal

MCP server for PayPal — global payments and payouts via the PayPal REST API.

Target customer: LatAm SaaS / marketplaces selling globally that already hold a PayPal merchant account and want agent-driven checkout, payouts, subscriptions, and dispute handling.

Tools (19)

ToolPurpose
create_orderCreate a PayPal Order via POST /v2/checkout/orders.
get_orderFetch a PayPal Order by id via GET /v2/checkout/orders/{id}.
capture_orderCapture payment for an approved order via POST /v2/checkout/orders/{id}/capture.
authorize_orderAuthorize payment for an approved order via POST /v2/checkout/orders/{id}/authorize.
capture_authorizationCapture a previously authorized payment via POST /v2/payments/authorizations/{id}/capture.
refund_captureRefund a captured payment via POST /v2/payments/captures/{id}/refund.
void_authorizationVoid (release) an unsettled authorization via POST /v2/payments/authorizations/{id}/void.
get_payment_detailsFetch a payment object by id via GET /v2/payments/{type}/{id}.
create_batch_payoutCreate a batch payout via POST /v1/payments/payouts.
get_payoutFetch a payout batch by id via GET /v1/payments/payouts/{batch_id}.
get_payout_itemFetch a single payout item by id via GET /v1/payments/payouts-item/{item_id}.
create_subscriptionCreate a billing subscription via POST /v1/billing/subscriptions.
get_subscriptionFetch a subscription by id via GET /v1/billing/subscriptions/{id}.
cancel_subscriptionCancel an active subscription via POST /v1/billing/subscriptions/{id}/cancel.
list_disputesList disputes via GET /v1/customer/disputes.
get_disputeFetch a dispute by id via GET /v1/customer/disputes/{id}.
accept_dispute_claimAccept liability for a dispute claim via POST /v1/customer/disputes/{id}/accept-claim.
list_webhooksList configured webhooks for the app via GET /v1/notifications/webhooks.
verify_webhook_signatureVerify a webhook event signature via POST /v1/notifications/verify-webhook-signature.

Install

npm install @codespar/mcp-paypal

Environment

PAYPAL_CLIENT_ID="..."       # REST app client id
PAYPAL_CLIENT_SECRET="..."   # REST app client secret (OAuth2)
PAYPAL_ENV="sandbox"         # 'sandbox' (default) or 'live'

Endpoints:

  • sandbox -> https://api-m.sandbox.paypal.com
  • live -> https://api-m.paypal.com

Authentication

PayPal REST APIs use OAuth2 client_credentials. The server posts CLIENT_ID:CLIENT_SECRET (Basic auth) to /v1/oauth2/token with grant_type=client_credentials and caches the bearer token until 60s before expiry, refreshing on demand.

Run

# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-paypal

# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-paypal

Notes

  • Amounts are objects in PayPal REST: { "currency_code": "USD", "value": "10.50" }. Values are decimal strings.
  • The server forwards arbitrary REST body fields verbatim under body for tools that accept them, so any field documented in the PayPal REST reference can be passed even if it's not in the MCP inputSchema.
  • For payment captures / refunds the PayPal-Request-Id header (idempotency) is forwarded when supplied.

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.