MCP server

Last updated: Apr 10th, 11:13am

Model Context Protocol (MCP) supports managing and passing relevant information to models with appropriate context, so they operate properly within a given scope. Using this technology, PayPal developed an MCP server to enable merchants to use natural language with their favorite MCP client to perform business tasks, such as creating or listing invoices. 

Set up MCP server

PayPal provides two ways for merchants to set up the MCP server: 

  • Running the MCP server locally. This option enables developers to download, install, and run the MCP server locally. 
  • Using the MCP server remotely. This option is for users who prefer not to install the MCP server locally. With remote MCP server support, users can continue their tasks across devices with a single login after authentication.

Run MCP server locally

A preferred way to use the MCP server in some environments is to run it locally. To do that, you have to install Node.js locally first.

To install the MCP server in a local configuration: 

  1. Visit the Node.js official website to download and install it. Be sure that you are running Node.js v18 or later. 
  2. Update the configuration file in your favorite MCP client:   
    1. Open the MCP client. 
    2. In the configuration settings for the client, locate the external tools or connectors configuration section, and add the PayPal connector configuration that follows this procedure. In Claude, for example, you add this to ~/Claude/claude_desktop_config.json
    3. In the new entry, replace YOUR_PAYPAL_ACCESS_TOKEN with your actual PayPal access token. Alternatively, you can set the PAYPAL_ACCESS_TOKEN as an environment variable. You also can pass it as an argument using --access-token in args.

      Set the PAYPAL_ENVIRONMENT to SANDBOX for testing or PRODUCTION for your production environment.
  3. Test your integration:
    1. Quit and restart the MCP client to apply your changes.
    2. Ask the MCP client to perform one of the supported tasks. For example, ask the MCP client to list your PayPal invoices for the last month.
    1{
    2 "mcpServers": {
    3 "paypal": {
    4 "command": "npx",
    5 "args": [
    6 "-y",
    7 "@paypal/mcp",
    8 "--tools=all"
    9 ],
    10 "env": {
    11 "PAYPAL_ACCESS_TOKEN": "YOUR_PAYPAL_ACCESS_TOKEN",
    12 "PAYPAL_ENVIRONMENT": "SANDBOX"
    13 }
    14 }
    15 }
    16}

    Connect to MCP server remotely

    Another way of connecting with the MCP server is to do so remotely. Use your preferred MCP client for this procedure. 

    1. Open the configuration file for your MCP client in a text editor, and replace the configuration with the new configuration that follows this procedure. 
    2. Save the file, and restart your MCP client. The MCP client will send you to the PayPal login page. 
    3. Provide your consent for the client to work with the MCP server: 
      1. Log into PayPal when the login page appears.
      2. Authorize the client to work with the MCP server. 
    4. Quit and reopen your MCP client.
    5. To test your integration, ask the MCP client to preform one of the supported tasks. For example, ask it to create an invoice for landscaping services for Green Lawns for $200 with a date of last Friday.
      1{
      2 "mcpServers": {
      3 "paypal-mcp-server": {
      4 "command": "npx",
      5 "args": [
      6 "mcp-remote",
      7 "https://mcp.paypal.com/sse"
      8 ]
      9 }
      10 }
      11}

      MCP server tools overview

      The MCP server currently include tools for performing 2 critical invoice jobs: 

      • Creating invoices
      • Listing invoices

      Plans for this feature include adding more tools over time. 

      Create invoice

      Using your favorite MCP client with the MCP server to create invoices offers several advantages over creating invoices in a more traditional way. For example, a merchant can use natural language with an MCP client to process multiple invoice requests by using a drive-system connector or a file-system connector. With this connection, users can ask the MCP client to perform a PayPal-related task, the MCP clients access their records for the data, and then the client uses that data to send PayPal invoices to multiple customers in bulk.

      For example, a user asks the MCP client to create an invoice with PayPal. 

      image

      The user supplies the necessary information, as the MCP client indicates. Then the MCP client accesses the necessary data, creates the invoice using the MCP server, and then it sends the invoice, as shown in the following illustration. 

      image

      The following example shows a sample of the invoice the customer receives. 

      image

      List invoices

      This tool lists the merchant or service provider's PayPal invoices. Additionally, the merchant or service provider can gain valuable data, such as identifying unpaid customer invoices or tracking invoice-related trends for a specific time period.

      image

      If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more