The PayPal Model Context Protocol server allows you to integrate with PayPal APIs through function calling. This protocol supports various tools to interact with different PayPal services.
Details
Author
paypal
Downloads
442
Transport
SSE
Categories
Remote MCP, Cloud Service, Other, API, Developer Tools, Finance, AI
Jump to
- Integrates PayPal APIs with multiple agent frameworks (OpenAI, LangChain, Vercel AI, MCP).
- TypeScript support with an npm package.
- Tools for creating and listing invoices (invoices.create, invoices.list).
- Tools for order management (createOrder, getOrder).
- Works with MCP hosts like Claude Desktop, Cursor, Cline.
- Sandbox and production environment support.
- **Create and send invoices**— Ask to draft an invoice with line items, then send it or schedule a reminder via`create_invoice`and`send_invoice`.
- **Manage payments and refunds**— Create an order, capture payment, or issue a refund for a captured payment using`create_order`and`create_refund`.
- **Handle disputes**— List open disputes, view details, or accept a claim directly through`list_disputes`and`accept_dispute_claim`.
- **Track shipments**— Create a tracking record for an order and retrieve its status with`create_shipment_tracking`and`get_shipment_tracking`.
- **Manage subscriptions**— Set up a subscription plan, create a subscription, or cancel an active one via`create_subscription_plan`and`cancel_subscription`.
- **Pull merchant insights**— Retrieve transaction history or business analytics with`list_transactions`and`get_merchant_insights`.
The PayPal Agent Toolkit enables popular agent frameworks including OpenAI's Agent SDK, LangChain, Vercel's AI SDK, and Model Context Protocol (MCP) to integrate with PayPal APIs through function calling. It includes support for TypeScript and is built on top of PayPal APIs and the PayPal SDKs.
The PayPal Agent toolkit provides the following tools:
-
`create_invoice`: Create a new invoice in the PayPal system, including recipient billing details, line items, an invoice note, a custom color theme, an optional shipping cost, and an option to enable PAY_BY_BANK as a payment method
`list_invoices`: List invoices with optional pagination and filtering
`get_invoice`: Retrieve details of a specific invoice
`send_invoice`: Send an invoice to recipients
`send_invoice_reminder`: Send a reminder for an existing invoice
`cancel_sent_invoice`: Cancel a sent invoice
`generate_invoice_qr_code`: Generate a QR code for an invoice
`delete_invoice`: Permanently delete a draft or scheduled invoice
`generate_invoice_number`: Generate the next invoice number available to the merchant
`search_invoicing`: Search for invoices or recurring invoice series
`update_invoicing`: Update an existing invoice or recurring invoice series (full-replacement)
`cancel_invoice_auto_reminder`: Cancel all scheduled automatic reminders for an invoice
`record_payment_for_invoice`: Record an external or manual payment against an invoice
`record_refund_for_invoice`: Record a refund against an invoice
`create_conditional_rules_for_invoice`: Create conditional rules for an invoice, such as an early payment discount or automatic cancellation date
`create_recurring_series`: Create a recurring invoice series that automatically generates and sends invoices on a schedule
`activate_recurring_series`: Activate a draft recurring invoice series
`get_recurring_series`: Retrieve details of a specific recurring invoice series
`cancel_recurring_series`: Cancel an active recurring invoice series
`delete_recurring_series`: Delete a draft recurring invoice series
- `create_order`: Create an order in PayPal system based on provided details
- `get_order`: Retrieve the details of an order
- `pay_order`: Process payment for an authorized order
- `create_refund`: Process a refund for a captured payment.
- `get_refund`: Get the details for a specific refund.
- `list_disputes`: Retrieve a summary of all open disputes
- `get_dispute`: Retrieve detailed information of a specific dispute
- `accept_dispute_claim`: Accept a dispute claim
- `create_shipment_tracking`: Create a shipment tracking record
- `get_shipment_tracking`: Retrieve shipment tracking information
- `update_shipment_tracking`: Update shipment tracking information
- `create_product`: Create a new product in the PayPal catalog
- `list_products`: List products with optional pagination and filtering
- `show_product_details`: Retrieve details of a specific product
- `create_subscription_plan`: Create a new subscription plan
- `list_subscription_plans`: List subscription plans
- `show_subscription_plan_details`: Retrieve details of a specific subscription plan
- `create_subscription`: Create a new subscription
- `show_subscription_details`: Retrieve details of a specific subscription
- `update_subscription`: update an existing subscription
- `cancel_subscription`: Cancel an active subscription
- `list_transactions`: List transactions with optional pagination and filtering
- `get_merchant_insights`: Retrieve business intelligence metrics and analytics for a merchant
You don't need this source code unless you want to modify the package. If you just want to use the package run:
The library needs to be configured with your account's client id and secret which is available in your[PayPal Developer Dashboard.
The toolkit works with Vercel's AI SDK and can be passed as a list of tools. For more details, refer our](https://developer.paypal.com/dashboard/)[examples
```
`import { PayPalAgentToolkit } from '@paypal/agent-toolkit/ai-sdk'; const paypalToolkit = new PayPalAgentToolkit({ clientId: process.env.PAYPAL_CLIENT_ID, clientSecret: process.env.PAYPAL_CLIENT_SECRET, configuration: { actions: { invoices: { create: true, createRecurringSeries: true, list: true, send: true, sendReminder: true, cancel: true, delete: true, generateQRC: true, generateInvoiceNumber: true, search: true, update: true, cancelReminders: true, recordPayment: true, recordRefund: true, createConditionalRules: true, }, products: { create: true, list: true, update: true }, subscriptionPlans: { create: true, list: true, show: true }, shipment: { create: true, show: true, cancel: true }, orders: { create: true, get: true }, disputes: { list: true, get: true }, }, }, });`
```
To use sandbox mode, add context within your configuration.
```
`configuration: { context: { sandbox: true, } }`
```
```
`import { PayPalWorkflows, ALL_TOOLS_ENABLED } from '@paypal/agent-toolkit/ai-sdk'; const paypalWorkflows = new PayPalWorkflows({ clientId: process.env.PAYPAL_CLIENT_ID, clientSecret: process.env.PAYPAL_CLIENT_SECRET, configuration: { actions: ALL_TOOLS_ENABLED, }, });`
```
```
`const llm: LanguageModelV1 = getModel(); // The model to be used with ai-sdk const { text: response } = await generateText({ model: llm, tools: paypalToolkit.getTools(), maxSteps: 10, prompt: `Create an order for $50 for custom handcrafted item and get the payment link.`, });`
```
The following environment variables can be used:
- `PAYPAL_ACCESS_TOKEN`: Your PayPal Access Token
- `PAYPAL_ENVIRONMENT`: Set to`SANDBOX`for sandbox mode,`PRODUCTION`for production (defaults to`SANDBOX`mode)
This guide explains how to generate an access token for PayPal API integration, including how to find your client ID and client secret.
- PayPal Developer account (for Sandbox)
- PayPal Business account (for production)
## Finding Your Client ID and Client Secret
- Go to](https://github.com/paypal/agent-toolkit/blob/HEAD/typescript/examples)[PayPal Developer Dashboard
- Sign up or log in with your PayPal credentials
- In the Developer Dashboard, click on**Apps & Credentials**in the menu
- Switch between**Sandbox**and**Live**modes depending on your needs
- To create a new app, click**Create App**
- Give your app a name and select a Business account to associate with it
- For existing apps, click on the app name to view details
- Once your app is created or selected, you'll see a screen with your:
- **Client ID**: A public identifier for your app
- **Client Secret**: A private key (shown after clicking "Show")
```
`curl -v https://api-m.sandbox.paypal.com/v1/oauth2/token \\ -H \"Accept: application/json\" \\ -H \"Accept-Language: en_US\" \\ -u \"CLIENT_ID:CLIENT_SECRET\" \\ -d \"grant_type=client_credentials\"`
```
Replace`CLIENT_ID`and`CLIENT_SECRET`with your actual credentials. For production, use`https://api-m.paypal.com`instead of the sandbox URL.
- Create a new request to`https://api-m.sandbox.paypal.com/v1/oauth2/token`
- Set method to**POST**
- Under**Authorization**, select**Basic Auth**and enter your Client ID and Client Secret
- Under**Body**, select**x-www-form-urlencoded**and add a key`grant_type`with value`client_credentials`
- Send the request
```
`{ "scope": "...", "access_token": "Your Access Token", "token_type": "Bearer", "app_id": "APP-80W284485P519543T", "expires_in": 32400, "nonce": "..." }`
```
Copy the`access_token`value for use in your Claude Desktop integration.
- **Sandbox Tokens**: Valid for 3-8 hours
- **Production Tokens**: Valid for 8 hours
- It's recommended to implement token refresh logic before expiration
Once you have your access token, update the`PAYPAL_ACCESS_TOKEN`value in your Claude Desktop connector configuration:
```
`{ "env": { "PAYPAL_ACCESS_TOKEN": "YOUR_NEW_ACCESS_TOKEN", "PAYPAL_ENVIRONMENT": "SANDBOX" } }`
```
- Store client ID and client secret securely
- Implement token refresh logic to handle token expiration
- Use environment-specific tokens (sandbox for testing, production for real transactions)
- Avoid hardcoding tokens in application code
*AI-generated content may be inaccurate or incomplete. Users are responsible for independently verifying any information before relying on it. PayPal makes no guarantees regarding output accuracy and is not liable for any decisions, actions, or consequences resulting from its use.*
PayPal runs an official remote MCP server — connect over a hosted URL instead of installing this one locally.
Interact with the Gumroad API to access and manage your products, sales, and creator data.
An MCP server for processing payments using stdio transport, configured via environment variables.
Interact with the Paddle Billing API to manage products, prices, customers, transactions, and subscriptions.
Integrate with Algeria's SATIM payment gateway to process CIB and Edhahabia card payments.
Access the Yuno payment platform API to manage payments, customers, and checkouts programmatically.
Transaction-complete hotel booking over MCP — 300K+ properties, real hotel confirmation numbers, loyalty points, secure checkout. Hotels are merchant of record. Builders set their own booking fee via Stripe Connect. Built on proven distribution infrastructure.
Mercado Pago's official MCP server, offering tools to interact with our API, simplifying tasks and product integration.
A Model Context Protocol (MCP) server for square
Static MCP discovery card for x402 spend-policy, paid MCP launch guidance, seller checkout repair, and agent-payment safety APIs.
Integrate AI tools and agents with Cashfree's Payment Gateway, Payouts, and SecureID APIs.](https://developer.paypal.com/dashboard/)
No reviews yet — be the first
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
Social sign-in isn’t configured yet. You can still create an account with email below, or ask an admin to add Google/GitHub/Discord OAuth credentials.
Sequential Thinking is an MCP server that provides a tool for dynamic and reflective problem-solving through a structured, step-by-step thinking process. It is…
Filesystem is a Node.js server that implements the Model Context Protocol (MCP) for filesystem operations. It enables AI assistants to read, write, and manage…
A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!