SuperAPI AI Directory

agent-toolkit

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.

Open website

About this tool

The PayPal Agent Toolkit is an open-source repository whose goal is to expose PayPal's various APIs to popular AI agent frameworks through function calling. According to the repository description, the frameworks it supports include OpenAI's Agent SDK, LangChain, Vercel's AI SDK, and the Model Context Protocol (MCP). The toolkit uses TypeScript and is built on the PayPal API and PayPal SDK.

Main capabilities The toolkit provides a series of tool functions by business domain:

Invoice: create invoices, list invoices, get invoice details, send invoices, send reminders, cancel sent invoices, generate invoice QR codes, delete draft or scheduled invoices, generate the next available invoice number, search invoices or recurring invoice series, update invoices, cancel automatic reminders, record external or manual payments, record refunds, create conditional rules (such as early payment discounts or automatic cancellation dates), create and activate recurring invoice series, get or cancel or delete recurring invoice series, etc.

Order: create orders, get order details, process payments for authorized orders.

Refund: process refunds for captured payments, get refund details.

Dispute Management: list summaries of all open disputes, get detailed information for a specific dispute, accept dispute claims.

Shipment Tracking: create shipment tracking records, get shipment tracking information, update shipment tracking information.

Catalog Management: create products, list products, view product details.

Subscription Management: create subscription plans, list subscription plans, view subscription plan details, create subscriptions, view subscription details, update subscriptions, cancel subscriptions.

Reporting and Insights: list transactions, get merchant business intelligence metrics and analytics.

How to use The toolkit is used through an npm package. The repository description notes: unless you want to modify the package itself, you do not need the source code; just run the installation command to use it. Before use, you need to fill in the account's client id and secret in the configuration. This information can be obtained from the PayPal Developer Dashboard. The toolkit can be used with the Vercel AI SDK by passing it in as a tool list; for more details, refer to the examples in the repository. To use sandbox mode, add the corresponding context in the configuration.

Environment variables The following environment variables can be used: PAYPAL_ACCESS_TOKEN: PayPal access token; PAYPAL_ENVIRONMENT: set to SANDBOX for sandbox mode, PRODUCTION for production mode, with sandbox mode used by default.

Credentials and tokens Before use, you need a PayPal developer account (for sandbox) or a PayPal business account (for production). In Apps & Credentials in the PayPal Developer Dashboard, you can switch between Sandbox and Live modes, create or view an app, and obtain the Client ID (the app's public identifier) and Client Secret (the private key, displayed after clicking Show). When generating an access token, send a POST request to https://api-m.sandbox.paypal.com/v1/oauth2/token , choose Basic Auth as the authorization method and fill in the Client ID and Client Secret, choose x-www-form-urlencoded for the Body, add the key grant_type with the value client_credentials. For the production environment, use https://api-m.paypal.com Instead of the sandbox URL. Sandbox tokens are valid for 3 to 8 hours, and production tokens are valid for 8 hours. It is recommended to implement token refresh logic before expiration.

Integration with Claude Desktop After obtaining the access token, you can update the value of PAYPAL_ACCESS_TOKEN in the Claude Desktop connector configuration. The documentation also recommends securely storing the client id and client secret, implementing token refresh, using tokens according to the environment (sandbox for testing, production for real transactions), and avoiding hardcoding tokens in application code.

Limitations and Disclaimer The repository description notes: AI-generated content may be inaccurate or incomplete, and users are responsible for independently verifying any information before relying on it. PayPal does not guarantee the accuracy of the output and is not responsible for any decisions, actions, or consequences arising from the use of this tool. In addition, the repository page includes a Code of conduct.