Skip to content
paypal-mcp logo

paypal-mcp Skill

paypal-mcp

PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.

SKILL.md

Full skill instructions

paypal-mcp Skill

PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/​mcp.

GF(3) Assignment

Trit: 0 (ERGODIC)
Role: Coordinator - orchestrates payment flows between crypto and fiat
Color: #26D826 (green)

MCP Server Setup

Amp Configuration (~/​.amp/​servers.json)

{
  "paypal": {
    "command": "npx",
    "args": ["-y", "@paypal/​mcp", "--tools=all"],
    "env": {
      "PAYPAL_ACCESS_TOKEN": "${PAYPAL_ACCESS_TOKEN}",
      "PAYPAL_ENVIRONMENT": "SANDBOX"
    }
  }
}

Claude Configuration (~/​.claude.json)

{
  "mcpServers": {
    "paypal": {
      "command": "npx",
      "args": ["-y", "@paypal/​mcp", "--tools=all"],
      "env": {
        "PAYPAL_ACCESS_TOKEN": "${PAYPAL_ACCESS_TOKEN}",
        "PAYPAL_ENVIRONMENT": "PRODUCTION"
      }
    }
  }
}

Token Generation

PayPal requires OAuth2 access tokens. Token validity:

  • Sandbox: 3-8 hours
  • Production: 8 hours

Generate Access Token

# Sandbox
curl -X POST https://api-m.sandbox.paypal.com/​v1/​oauth2/​token \
  -H "Accept: application/​json" \
  -H "Accept-Language: en_US" \
  -u "${PAYPAL_CLIENT_ID}:${PAYPAL_CLIENT_SECRET}" \
  -d "grant_type=client_credentials"

# Production
curl -X POST https://api-m.paypal.com/​v1/​oauth2/​token \
  -H "Accept: application/​json" \
  -H "Accept-Language: en_US" \
  -u "${PAYPAL_CLIENT_ID}:${PAYPAL_CLIENT_SECRET}" \
  -d "grant_type=client_credentials"

Token Refresh Script

#!/​bin/​bash
# paypal-token-refresh.sh
export PAYPAL_ACCESS_TOKEN=$(curl -s -X POST \
  "https://api-m.${PAYPAL_ENVIRONMENT:-sandbox}.paypal.com/​v1/​oauth2/​token" \
  -H "Accept: application/​json" \
  -u "${PAYPAL_CLIENT_ID}:${PAYPAL_CLIENT_SECRET}" \
  -d "grant_type=client_credentials" | jq -r '.access_token')
echo "Token refreshed: ${PAYPAL_ACCESS_TOKEN:0:20}..."

Available Tools

Invoices

ToolDescription
create_invoiceCreate a new invoice
list_invoicesList all invoices
get_invoiceGet invoice details by ID
send_invoiceSend invoice to recipient
send_invoice_reminderSend payment reminder
cancel_sent_invoiceCancel a sent invoice
generate_invoice_qr_codeGenerate QR code for invoice payment

Payments

ToolDescription
create_orderCreate a payment order
get_orderGet order details
pay_orderCapture/​execute payment
create_refundIssue a refund
get_refundGet refund status

Dispute Management

ToolDescription
list_disputesList all disputes
get_disputeGet dispute details
accept_dispute_claimAccept a dispute claim

Shipment Tracking

ToolDescription
create_shipment_trackingAdd tracking info to transaction
get_shipment_trackingGet tracking status

Catalog Management

ToolDescription
create_productCreate product in catalog
list_productsList all products
show_product_detailsGet product details
update_productUpdate product info

Subscription Management

ToolDescription
create_subscription_planCreate billing plan
update_planUpdate plan details
list_subscription_plansList all plans
show_subscription_plan_detailsGet plan details
create_subscriptionCreate subscription for customer
show_subscription_detailsGet subscription status
update_subscriptionModify subscription
cancel_subscriptionCancel active subscription

Reporting

ToolDescription
list_transactionsList transactions with filters

Key Use Cases

1. Create and Send Invoice

User: Create an invoice for $150 consulting fee to [email protected]

Agent Flow:
1. create_invoice(amount: 150, currency: "USD", recipient: "[email protected]", description: "Consulting services")
2. send_invoice(invoice_id: "<returned_id>")
3. generate_invoice_qr_code(invoice_id: "<returned_id>")

2. Process Order Payment

User: Create an order for $99.99 and capture payment

Agent Flow:
1. create_order(amount: 99.99, currency: "USD", intent: "CAPTURE")
2. get_order(order_id: "<returned_id>") -- verify status
3. pay_order(order_id: "<returned_id>") -- capture funds

3. List Recent Transactions

User: Show me transactions from the last 7 days

Agent Flow:
1. list_transactions(start_date: "2024-12-24", end_date: "2024-12-31")

4. Subscription Workflow

User: Create a monthly $29 subscription plan

Agent Flow:
1. create_product(name: "Premium Service", type: "SERVICE")
2. create_subscription_plan(product_id: "<id>", name: "Monthly Premium", billing_cycles: [{frequency: "MONTH", price: 29}])
3. create_subscription(plan_id: "<plan_id>", subscriber_email: "[email protected]")

APT → PYUSD → PayPal Integration Pattern

Bridge crypto (Aptos) to fiat (PayPal) via PYUSD stablecoin:

┌─────────────────────────────────────────────────────────────────┐
│                    APT → PYUSD → PAYPAL FLOW                     │
└─────────────────────────────────────────────────────────────────┘

┌──────────┐     ┌──────────┐     ┌──────────┐     ┌──────────┐
│   APT    │────▶│  DEX     │────▶│  PYUSD   │────▶│  PayPal  │
│  Wallet  │     │  Swap    │     │  Bridge  │     │  Payout  │
└──────────┘     └──────────┘     └──────────┘     └──────────┘
     │                │                │                │
     │ aptos_swap     │ liquidswap     │ pyusd_redeem   │ create_order
     │                │                │                │ pay_order

Triadic Flow (GF(3) Balanced)

;; +1 GENERATOR: Aptos swap APT→PYUSD
(aptos_swap {:from "APT" :to "PYUSD" :amount 100})

;; 0 COORDINATOR: Bridge PYUSD to PayPal (this skill)
(create_order {:amount 100 :currency "USD" :funding "PYUSD"})

;; -1 VALIDATOR: Verify settlement
(get_order {:order_id order-id})  ;; Confirm COMPLETED status

DuckDB Tracking

CREATE TABLE paypal_bridge_txns (
  txn_id VARCHAR PRIMARY KEY,
  aptos_txn_hash VARCHAR,
  pyusd_amount DECIMAL(18,6),
  usd_amount DECIMAL(10,2),
  paypal_order_id VARCHAR,
  status VARCHAR,  -- PENDING, BRIDGED, SETTLED, FAILED
  created_at TIMESTAMP,
  settled_at TIMESTAMP,
  gf3_trit INT CHECK (gf3_trit IN (-1, 0, 1))
);

Environment Variables

VariableRequiredDescription
PAYPAL_ACCESS_TOKENYesOAuth2 access token
PAYPAL_ENVIRONMENTYesSANDBOX or PRODUCTION
PAYPAL_CLIENT_IDFor refreshApp client ID
PAYPAL_CLIENT_SECRETFor refreshApp client secret

Error Handling

Common PayPal API errors:

  • AUTHENTICATION_FAILURE - Token expired, refresh required
  • INVALID_RESOURCE_ID - Invoice/​order not found
  • PERMISSION_DENIED - Scope not authorized
  • RATE_LIMIT_REACHED - Too many requests, backoff

Triadic Skill Composition

PayPal-MCP as ERGODIC (0) coordinator in payment triads:

┌─────────────────────────────────────────────────────────────────┐
│  PAYMENT TRIAD                                                   │
├─────────────────────────────────────────────────────────────────┤
│  +1 GENERATOR   │  aptos-agent      │  Create crypto txn        │
│   0 COORDINATOR │  paypal-mcp       │  Bridge to fiat           │
│  -1 VALIDATOR   │  duckdb-ies       │  Verify settlement        │
├─────────────────────────────────────────────────────────────────┤
│  Σ trits = (+1) + (0) + (-1) = 0 ≡ 0 (mod 3) ✓                 │
└─────────────────────────────────────────────────────────────────┘

See Also

  • aptos-agent - Aptos blockchain interactions
  • aptos-trading - DEX swaps for APT→PYUSD
  • duckdb-ies - Transaction tracking and analytics
  • google-workspace - Invoice delivery via Gmail

References

More Finance & Trading skills

ponytail-debt logo
Finance & Trading

ponytail-debt

Harvest every `ponytail:` comment in the codebase into a debt ledger, so the deliberate shortcuts and deferrals ponytail leaves behind get tracked instead of rotting into "later means never". One-shot report, changes nothing.

155.5K 27.9K
View
stripe-integration logo
Finance & Trading

stripe-integration

Stripe payment processing with checkout sessions, subscriptions, webhooks, and customer management.

40.2K 12.9K
View

Build comprehensive 3-5 year financial models with revenue projections, cost structures, cash flow analysis, and scenario planning for early-stage startups. Use this skill when creating financial projections, calculating burn rate or runway, modeling fundraising scenarios, or preparing investor-r...

40.2K 12K
View
stock-analysis logo
Finance & Trading

stock-analysis

Stock and cryptocurrency analysis with portfolio management and multi-dimensional scoring.

46 11.9K
View
coinglass logo
Finance & Trading

coinglass

Real-time crypto derivatives positioning, whale tracking, liquidations, and institutional ETF flows across 37 specialized tools.

27 11.5K
View

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

40.2K 10.5K
View

Finance AI tools

C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Finalle.ai logo
Finance

Finalle.ai

Stay Ahead with Finalle.ai: The Ultimate Financial News and Tools Platform

Free
View

AI-powered Pine Script code generator for TradingView

Paid
View
TradeUI logo
Finance

TradeUI

Empower your investment strategies with AI signals, option flow data, and advanced chart patterns.

Paid
View
D
Finance

Danelfin

Danelfin review covering its AI stock and ETF scores, rankings, portfolio tools, current pricing, strengths, risks, and alternatives for investors.

Freemium
View
E
Finance

Ellisense

A software for comprehensive market sentiment analysis.

Paid
View

'Stock Correlations' App by Freshly.ai: Reveal Stock Patterns and Trends

Free
View