Local MCP server
To run the MCP server locally, you need Node.js v18 or later. Download and install it from the Node.js website if you don’t have it yet.
-
To update the configuration settings for your MCP client, locate the external tools or connectors section in the client’s configuration, and add the PayPal connector configuration. In Claude, for example, you add the following configuration to ~/Claude/claude_desktop_config.json.
-
In the new entry, replace YOUR_PAYPAL_ACCESS_TOKEN with your actual PayPal access token, and set the PAYPAL_ENVIRONMENT to SANDBOX for testing or PRODUCTION for your production environment. 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.
-
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.
Remote MCP server
If you don’t want to install MCP server locally, the other option is to use the remotely hosted MCP server.
Tip: You can use your preferred MCP client for this procedure.
Environment variables
When you develop and test, use the sandbox environment variable. For a live site, use production.
| Environment | Endpoint |
|---|
| Sandbox | https://mcp.sandbox.paypal.com |
| Production | https://mcp.paypal.com |
Note: You must point to the sandbox endpoint (https://mcp.sandbox.paypal.com) when you work in the PayPal sandbox environment.
PayPal supports using your PayPal client credentials to connect to the remote MCP server. With this type of authorization, you use your PayPal account’s client ID and secret from PayPal Developer Dashboard.
Configure your transport method
The remote MCP server supports two types of transport.
Server-sent events (SSE)
To use SSE for testing in the sandbox, open the configuration file for your MCP client in a text editor, and replace the configuration with the following one.
In a production environment for a live site, replace the sandbox URL with this URL: https://mcp.paypal.com/sse.
Streamable HTTP
With streamable HTTP, servers send data to clients in chunks instead of waiting to compile a complete response. Customers can receive a response immediately when they use streamable HTTP transport. Modern applications can display results as they become available, avoiding spinners and long delays.To use streamable HTTP for testing in the sandbox, open the configuration file for your MCP client in a text editor, and replace the configuration with the following one.
In a production environment for a live site, replace the sandbox URL with this URL: https://mcp.paypal.com/http.
Connect to MCP server
-
Save the file, and restart your MCP client. The MCP client sends you to the PayPal login page.
-
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.
-
Quit and reopen your MCP client.
-
To test your integration, ask the MCP client to perform 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.
Tip: If you have trouble connecting after completing this procedure, try clearing the files that the integration adds to ~/.mcp-auth by running:rm -rf ~/.mcp-authAlso be aware that emerging technology, like MCP and MCP clients, can come with performance issues or other challenges initially. For example, Windows users with Cursor might encounter a known issue when connecting to the MCP server remotely.