Sponsored by Deepsite.site

A commerce-centric demo featuring Agent Development Kit with Paypal Agent Toolkit via MCPs

Created By
gkcng9 months ago
The commerce-centric demo shown live at Paypal Dev Days 2025 on 4/29. Featuring Paypal Agent Toolkit & MCP server with Google's Agent Development Kit (ADK)
Content

A commerce-centric demo featuring Agent Development Kit with Paypal Agent Toolkit via MCPs

This 4 minutes demo shows a quick conversational pre-sales engagement using PayPal's Agent Toolkit via MCP, and Google's Agent Development Kit.

Paypal Sandbox

When you register with developer.paypal.com, you can set up multiple Apps, each with will come with its own:

  • Client ID and Secret Key for applications calling the APIs.
  • A sandbox account with emails and passwords that can log into sandbox.paypal.com.
  • The sandbox account has test credit cards, addresses and bank details that can be used to test transactions.

Notes on using the Paypal APIs

Available APIs

The collection of APIs are primarily merchant centric. There are a total of 25 APIs spanning:

  • disputes
  • invoices
  • orders
  • subscriptions
  • tracking
  • transactions

In this demo

This demo only obtain the following APIs, they are tested and found functional. Only orders and shipment are part of the demo:

  • 'orders.create',
  • 'orders.get',
  • 'orders.capture',
  • 'shipment.create',
  • 'shipment.get',
  • 'subscriptions.create',
  • 'subscriptions.show',
  • 'subscriptions.cancel'
Image description

See arch/paypal_mcp_adk_a2a.svg for where remote agents are mentioned at the end of the demo. Such external agents can be defined and their code lives else where, but via A2A, your agents can make use of the intelligence of these external agents for your customers, without needing to know how they were made.

API Interdependencies

Here are a list of API interdependencies and operational matters:

  • Create order returns a payment URL for the human to log in and pay manually.
  • Calling order capture will only be successful once the consumer has completed the transaction.
  • A human must create a dispute first in the sandbox environment before a merchant can call accept dispute claim.
  • A subscription can only be created if there is a previously created product and a subscription plan.
  • There is a delay in list_transactions showing the latest.

Set up

Python Packages

Requires Google ADK 0.3.0+:

python3 -m venv ~/.ppmcp_adk
source ~/.ppmcp_adk/bin/activate
pip install "google-adk==0.3.0"
pip install "google-cloud-aiplatform==1.90.0"

or if poetry is preferred:

poetry install

For the MCP Client

Set up nodejs and npx from Node.js website

Making sure you have something similar, that node and npx are in your PATHs:

$ which node
/Users/USERNAME/.nvm/versions/node/v22.14.0/bin/node

$ which npx
/Users/USERNAME/.nvm/versions/node/v22.14.0/bin/npx

Configuration

COPY 'env.example' into '.env' and set up the '.env` file:

  • Fill in either: your Google API Key, or your Google Cloud Project ID and Location
  • Find and fill in Paypal Sandbox PAYPAL_CLIENT_ID and PAYPAL_SECRET

Insert orders info that actually exists in your Paypal sandbox:

  • In function load_user_profile() within paypal_mcp_agent/util.py.
  • Modify the user_profile and orders dictionaries. They are loaded during before_agent_callback.

Run ADK Developer UI

  1. Run adk web, in the working directory pp_mcp_adk, where the .env file is.
  2. It will display INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
  3. Point your browser to http://localhost:8000/dev-ui?app=paypal_mcp_agent

Sample Interaction

[User]: Where is the dog toy I ordered?

[Agent]: [calls get_shipment_tracking API]

[Agent]: Your Dido Dog Toy order (ID: 2RH052419P314283P) has been shipped via UPS with tracking number 1Z1234567890123456 on 2025-04-24.

[User]: how about show me the order information too?

[Agent]: [calls get_order API]

[Agent]: Here is the information for your order:

  • Order ID: 2RH052419P314283P
  • Status: COMPLETED
  • Item: Dido Dog Toy
  • Quantity: 3
  • Total Amount: 30.00 USD
  • Shipping Address: 1 Main St, San Jose, CA 95131, US

[User]: (Manually click on the paperclip icon to the left of the chatbox, load the green dress image into the chat box. The image is under ./paypal_mcp_agent/images, followed by...) recommend something more formal in the same style.

[Agent]: Okay, I understand. You're looking for something more formal, but in a similar style to the dress in the image you sent. ...The dress in the image has the following characteristics:

[Agent]: [calls product_search tool]

...

[Agent]: I found three dresses that might interest you:

...

[User]: I like the second dress!

[Agent]: Great... would you like to order it?

[User]: Yes, let's do it.

[Agent]: [calls create_order API]

[Agent]: Your order for the Floral Mermaid Summer Dress has been placed!

Here are the details:

Order ID: 7EK45304FF8688429
Item Name: Floral Mermaid Summer Dress
Cost: 220 USD
Payment Link: https://www.sandbox.paypal.com/checkoutnow?token=7EK45304FF8688429
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
CursorThe AI Code Editor
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™