PayPal MCP server

Integrates with PayPal's APIs to enable payment processing, order management, and financial operations for e-commerce and billing workflows.
Back to servers
Setup instructions
Provider
Dynamic Endpoints
Release date
Feb 22, 2025
Language
TypeScript

This PayPal Model Context Protocol (MCP) server provides integration with PayPal's APIs, enabling you to interact with PayPal's payment processing, invoicing, and business management features through a standardized interface.

Installation

Installing via Smithery

To install PayPal MCP Server for Claude Desktop automatically:

npx -y @smithery/cli install @DynamicEndpoints/Paypal-MCP --client claude

Manual Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Configure PayPal credentials in the MCP settings file:
    {
      "mcpServers": {
        "paypal": {
          "command": "node",
          "args": ["path/to/paypal-server/build/index.js"],
          "env": {
            "PAYPAL_CLIENT_ID": "your_client_id",
            "PAYPAL_CLIENT_SECRET": "your_client_secret"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }
    

Available Tools

Payment Operations

create_payment_token

Create a payment token for future use.

{
  customer: {
    id: string;
    email_address?: string;
  };
  payment_source: {
    card?: {
      name: string;
      number: string;
      expiry: string;
      security_code: string;
    };
    paypal?: {
      email_address: string;
    };
  };
}

create_order

Create a new order in PayPal.

{
  intent: 'CAPTURE' | 'AUTHORIZE';
  purchase_units: Array<{
    amount: {
      currency_code: string;
      value: string;
    };
    description?: string;
    reference_id?: string;
  }>;
}

create_payment

Create a direct payment.

{
  intent: string;
  payer: {
    payment_method: string;
    funding_instruments?: Array<{
      credit_card?: {
        number: string;
        type: string;
        expire_month: number;
        expire_year: number;
        cvv2: string;
        first_name: string;
        last_name: string;
      };
    }>;
  };
  transactions: Array<{
    amount: {
      total: string;
      currency: string;
    };
    description?: string;
  }>;
}

Business Operations

create_product

Create a new product in the catalog.

{
  name: string;
  description: string;
  type: 'PHYSICAL' | 'DIGITAL' | 'SERVICE';
  category: string;
  image_url?: string;
  home_url?: string;
}

create_invoice

Generate a new invoice.

{
  invoice_number: string;
  reference: string;
  currency_code: string;
  recipient_email: string;
  items: Array<{
    name: string;
    quantity: string;
    unit_amount: {
      currency_code: string;
      value: string;
    };
  }>;
}

create_payout

Process a batch payout.

{
  sender_batch_header: {
    sender_batch_id: string;
    email_subject?: string;
    recipient_type?: string;
  };
  items: Array<{
    recipient_type: string;
    amount: {
      value: string;
      currency: string;
    };
    receiver: string;
    note?: string;
  }>;
}

User & Profile Management

get_userinfo

Retrieve user information.

{
  access_token: string;
}

create_web_profile

Create a web experience profile.

{
  name: string;
  presentation?: {
    brand_name?: string;
    logo_image?: string;
    locale_code?: string;
  };
  input_fields?: {
    no_shipping?: number;
    address_override?: number;
  };
  flow_config?: {
    landing_page_type?: string;
    bank_txn_pending_url?: string;
  };
}

Usage Examples

Creating an Order

const result = await mcpClient.useTool('paypal', 'create_order', {
  intent: 'CAPTURE',
  purchase_units: [{
    amount: {
      currency_code: 'USD',
      value: '100.00'
    },
    description: 'Premium Subscription'
  }]
});

Generating an Invoice

const result = await mcpClient.useTool('paypal', 'create_invoice', {
  invoice_number: 'INV-2024-001',
  reference: 'REF-2024-001',
  currency_code: 'USD',
  recipient_email: '[email protected]',
  items: [{
    name: 'Consulting Services',
    quantity: '1',
    unit_amount: {
      currency_code: 'USD',
      value: '500.00'
    }
  }]
});

Processing a Payout

const result = await mcpClient.useTool('paypal', 'create_payout', {
  sender_batch_header: {
    sender_batch_id: 'Payroll_2024_001',
    email_subject: 'You have received a payment'
  },
  items: [{
    recipient_type: 'EMAIL',
    amount: {
      value: '1000.00',
      currency: 'USD'
    },
    receiver: '[email protected]',
    note: 'Monthly salary payment'
  }]
});

Error Handling

The server implements comprehensive error handling:

  • Input validation errors with detailed messages
  • PayPal API errors with response details
  • Network and authentication errors
  • Rate limiting and timeout handling

Security Considerations

  • All sensitive data is validated and sanitized
  • OAuth 2.0 authentication with PayPal
  • Secure credential management through environment variables
  • Input validation for all API parameters
  • Error messages don't expose sensitive information

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "paypal" '{"command":"node","args":["path/to/paypal-server/build/index.js"],"env":{"PAYPAL_CLIENT_ID":"your_client_id","PAYPAL_CLIENT_SECRET":"your_client_secret"},"disabled":false,"autoApprove":[]}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "paypal": {
            "command": "node",
            "args": [
                "path/to/paypal-server/build/index.js"
            ],
            "env": {
                "PAYPAL_CLIENT_ID": "your_client_id",
                "PAYPAL_CLIENT_SECRET": "your_client_secret"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "paypal": {
            "command": "node",
            "args": [
                "path/to/paypal-server/build/index.js"
            ],
            "env": {
                "PAYPAL_CLIENT_ID": "your_client_id",
                "PAYPAL_CLIENT_SECRET": "your_client_secret"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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