PayPal Agent Toolkit MCP server

AI agent integration with PayPal services.
Back to servers
Provider
PayPal
Release date
Apr 02, 2025
Language
TypeScript
Package
Stats
1.7K downloads
111 stars

The PayPal Model Context Protocol server allows you to integrate with PayPal APIs through function calling, supporting various tools to interact with different PayPal services. This server makes it easy to work with PayPal functionalities using MCP-compatible AI assistants.

Installation

Prerequisites

  • Node.js 18+ installed on your system
  • PayPal access token
  • An MCP host (Claude Desktop, Cline, Cursor, or GitHub Copilot)

Quick Start

Run the PayPal MCP server directly using npx:

npx -y @paypal/mcp --tools=all PAYPAL_ACCESS_TOKEN="YOUR_ACCESS_TOKEN" PAYPAL_ENVIRONMENT="SANDBOX"

Replace YOUR_ACCESS_TOKEN with your actual PayPal access token.

Integrating with Claude Desktop

  1. Install Node.js (version 18+) from the Node.js official website

  2. Configure PayPal Connector in Claude Desktop:

    • Open Claude Desktop
    • Navigate to Settings
    • Find the Developer or Advanced settings section
    • Update your ~/Claude/claude_desktop_config.json with:
{
   "mcpServers": {
     "paypal": {
       "command": "npx",
       "args": [
         "-y",
         "@paypal/mcp",
         "--tools=all"
       ],
       "env": {
         "PAYPAL_ACCESS_TOKEN": "YOUR_PAYPAL_ACCESS_TOKEN",
         "PAYPAL_ENVIRONMENT": "SANDBOX"
       }
     }
   }
}
  1. Test the Integration:
    • Restart Claude Desktop
    • Try asking Claude to perform a PayPal task (e.g., "List my PayPal invoices")

Generating a PayPal Access Token

Finding Your Client ID and Client Secret

  1. Go to the PayPal Developer Dashboard
  2. Sign in with your PayPal credentials
  3. Navigate to "Apps & Credentials"
  4. Switch between Sandbox and Live modes as needed
  5. Create a new app or select an existing one
  6. Find your Client ID and Client Secret on the app details page

Generate Token Using cURL

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.

The response will contain your access token:

{
  "scope": "...",
  "access_token": "Your Access Token",
  "token_type": "Bearer",
  "app_id": "APP-80W284485P519543T",
  "expires_in": 32400,
  "nonce": "..."
}

Available Tools

Invoices

  • create_invoice: Create a new invoice
  • list_invoices: List invoices with optional pagination
  • get_invoice: Retrieve details of a specific invoice
  • send_invoice: Send an invoice to recipients
  • send_invoice_reminder: Send a reminder for an invoice
  • cancel_sent_invoice: Cancel a sent invoice
  • generate_invoice_qr_code: Generate a QR code for an invoice

Payments

  • create_order: Create an order
  • get_order: Retrieve order details
  • pay_order: Process payment for an authorized order
  • create_refund: Process a refund
  • get_refund: Get refund details

Dispute Management

  • list_disputes: Retrieve a summary of open disputes
  • get_dispute: Get details for a specific dispute
  • accept_dispute_claim: Accept a dispute claim

Shipment Tracking

  • create_shipment_tracking: Create a tracking record
  • get_shipment_tracking: Retrieve tracking information

Catalog Management

  • create_product: Create a new product
  • list_products: List products
  • show_product_details: Get product details
  • update_product: Update an existing product

Subscription Management

  • create_subscription_plan: Create a subscription plan
  • update_plan: Update a plan
  • list_subscription_plans: List subscription plans
  • show_subscription_plan_details: Get plan details
  • create_subscription: Create a subscription
  • show_subscription_details: Get subscription details
  • update_subscription: Update a subscription
  • cancel_subscription: Cancel an active subscription

Reporting and Insights

  • list_transactions: List transactions with filtering options

Configuration

Environment Variables

You can configure the PayPal MCP server using these environment variables:

  • PAYPAL_ACCESS_TOKEN: Your PayPal Access Token
  • PAYPAL_ENVIRONMENT: Set to either SANDBOX (for testing) or PRODUCTION (default is SANDBOX)

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later