PayPal MCP

PayPal MCP

这是一个用于管理 PayPal 的 MCP 服务器。

客户支持
金融
访问服务器

Tools

create_payment_token

Create a payment token

create_payment

Create a payment

create_payout

Create a batch payout

create_referenced_payout

Create a referenced payout

create_order

Create a new order in PayPal

create_partner_referral

Create a partner referral

create_web_profile

Create a web experience profile

create_product

Create a new product in PayPal

list_products

List all products

get_dispute

Get details of a dispute

get_userinfo

Get user info from identity token

create_invoice

Create a new invoice

README

PayPal MCP 服务器

CI License: MIT TypeScript smithery badge

DynamicEndpoints 维护 - 联系方式:kameron@dynamicendpoints.com

一个模型上下文协议 (MCP) 服务器,提供与 PayPal API 的集成。该服务器通过标准化的接口,实现与 PayPal 的支付处理、发票和业务管理功能的无缝交互。

<a href="https://glama.ai/mcp/servers/6op9uaqyev"> <img width="380" height="200" src="https://glama.ai/mcp/servers/6op9uaqyev/badge" alt="PayPal MCP server" /> </a>

架构

graph TB
    subgraph "MCP 环境"
        Client[MCP 客户端]
        Server[PayPal MCP 服务器]
        Validation[输入验证]
        Auth[OAuth 认证]
    end

    subgraph "PayPal APIs"
        Orders[订单 API]
        Payments[支付 API]
        Payouts[付款 API]
        Invoicing[发票 API]
        Products[产品 API]
        Disputes[争议 API]
        Identity[身份 API]
    end

    Client --> |请求| Server
    Server --> |响应| Client
    Server --> Validation
    Server --> Auth
    Auth --> |访问令牌| PayPal
    
    Server --> Orders
    Server --> Payments
    Server --> Payouts
    Server --> Invoicing
    Server --> Products
    Server --> Disputes
    Server --> Identity

    style Client fill:#f9f,stroke:#333,stroke-width:2px
    style Server fill:#bbf,stroke:#333,stroke-width:2px
    style Auth fill:#bfb,stroke:#333,stroke-width:2px
    style Validation fill:#bfb,stroke:#333,stroke-width:2px

功能

  • 支付处理

    • 创建和管理订单
    • 处理支付
    • 处理支付令牌
    • 管理争议
  • 业务运营

    • 创建和管理产品
    • 生成发票
    • 处理付款
    • 处理合作伙伴推荐
  • 用户管理

    • 身份验证
    • 用户信息检索
    • Web 配置文件管理

安装

通过 Smithery 安装

要通过 Smithery 为 Claude Desktop 自动安装 PayPal MCP 服务器:

npx -y @smithery/cli install @DynamicEndpoints/Paypal-MCP --client claude

手动安装

  1. 克隆存储库
  2. 安装依赖项:
    npm install
    
  3. 构建项目:
    npm run build
    
  4. 在 MCP 配置文件中配置 PayPal 凭据:
    {
      "mcpServers": {
        "paypal": {
          "command": "node",
          "args": ["path/to/paypal-server/build/index.js"],
          "env": {
            "PAYPAL_CLIENT_ID": "your_client_id",
            "PAYPAL_CLIENT_SECRET": "your_client_secret"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }
    

可用工具

支付操作

create_payment_token

创建用于将来使用的支付令牌。

{
  customer: {
    id: string;
    email_address?: string;
  };
  payment_source: {
    card?: {
      name: string;
      number: string;
      expiry: string;
      security_code: string;
    };
    paypal?: {
      email_address: string;
    };
  };
}

create_order

在 PayPal 中创建一个新订单。

{
  intent: 'CAPTURE' | 'AUTHORIZE';
  purchase_units: Array<{
    amount: {
      currency_code: string;
      value: string;
    };
    description?: string;
    reference_id?: string;
  }>;
}

create_payment

创建直接支付。

{
  intent: string;
  payer: {
    payment_method: string;
    funding_instruments?: Array<{
      credit_card?: {
        number: string;
        type: string;
        expire_month: number;
        expire_year: number;
        cvv2: string;
        first_name: string;
        last_name: string;
      };
    }>;
  };
  transactions: Array<{
    amount: {
      total: string;
      currency: string;
    };
    description?: string;
  }>;
}

业务运营

create_product

在目录中创建一个新产品。

{
  name: string;
  description: string;
  type: 'PHYSICAL' | 'DIGITAL' | 'SERVICE';
  category: string;
  image_url?: string;
  home_url?: string;
}

create_invoice

生成新发票。

{
  invoice_number: string;
  reference: string;
  currency_code: string;
  recipient_email: string;
  items: Array<{
    name: string;
    quantity: string;
    unit_amount: {
      currency_code: string;
      value: string;
    };
  }>;
}

create_payout

处理批量付款。

{
  sender_batch_header: {
    sender_batch_id: string;
    email_subject?: string;
    recipient_type?: string;
  };
  items: Array<{
    recipient_type: string;
    amount: {
      value: string;
      currency: string;
    };
    receiver: string;
    note?: string;
  }>;
}

用户 & 配置文件管理

get_userinfo

检索用户信息。

{
  access_token: string;
}

create_web_profile

创建 Web 体验配置文件。

{
  name: string;
  presentation?: {
    brand_name?: string;
    logo_image?: string;
    locale_code?: string;
  };
  input_fields?: {
    no_shipping?: number;
    address_override?: number;
  };
  flow_config?: {
    landing_page_type?: string;
    bank_txn_pending_url?: string;
  };
}

使用示例

创建订单

const result = await mcpClient.useTool('paypal', 'create_order', {
  intent: 'CAPTURE',
  purchase_units: [{
    amount: {
      currency_code: 'USD',
      value: '100.00'
    },
    description: 'Premium Subscription'
  }]
});

生成发票

const result = await mcpClient.useTool('paypal', 'create_invoice', {
  invoice_number: 'INV-2024-001',
  reference: 'REF-2024-001',
  currency_code: 'USD',
  recipient_email: 'customer@example.com',
  items: [{
    name: 'Consulting Services',
    quantity: '1',
    unit_amount: {
      currency_code: 'USD',
      value: '500.00'
    }
  }]
});

处理付款

const result = await mcpClient.useTool('paypal', 'create_payout', {
  sender_batch_header: {
    sender_batch_id: 'Payroll_2024_001',
    email_subject: 'You have received a payment'
  },
  items: [{
    recipient_type: 'EMAIL',
    amount: {
      value: '1000.00',
      currency: 'USD'
    },
    receiver: 'employee@example.com',
    note: 'Monthly salary payment'
  }]
});

错误处理

服务器实现了全面的错误处理:

  • 带有详细消息的输入验证错误
  • 带有响应详细信息的 PayPal API 错误
  • 网络和身份验证错误
  • 速率限制和超时处理

安全注意事项

  • 所有敏感数据都经过验证和清理
  • 使用 PayPal 的 OAuth 2.0 身份验证
  • 通过环境变量进行安全凭据管理
  • 所有 API 参数的输入验证
  • 错误消息不会暴露敏感信息

开发

构建

npm run build

测试

npm test

调试

服务器输出详细的日志以帮助调试:

  • 身份验证问题
  • API 调用失败
  • 验证错误
  • 请求/响应详细信息

贡献

  1. Fork 存储库
  2. 创建一个功能分支
  3. 提交您的更改
  4. 推送到分支
  5. 创建一个 Pull Request

许可证

MIT 许可证

推荐服务器

Jira-Context-MCP

Jira-Context-MCP

MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

精选
TypeScript
Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

一个模型上下文协议 (MCP) 服务器,它使用 CoinCap API 提供全面的加密货币分析。该服务器通过一个易于使用的界面提供实时价格数据、市场分析和历史趋势。 (Alternative, slightly more formal and technical translation): 一个模型上下文协议 (MCP) 服务器,利用 CoinCap API 提供全面的加密货币分析服务。该服务器通过用户友好的界面,提供实时价格数据、市场分析以及历史趋势数据。

精选
TypeScript
chromia-mcp

chromia-mcp

使人工智能能够与 Chromia 钱包交互,以发送 $CHR 交易。

官方
本地
TypeScript
TripleWhale MCP Server

TripleWhale MCP Server

一个模型上下文协议 (MCP) 的实现,允许用户通过 Claude Desktop 使用自然语言查询与 TripleWhale 的电子商务分析平台进行交互。

官方
本地
TypeScript
Adamik MCP Server

Adamik MCP Server

通过 Claude Desktop 实现与 60 多个区块链网络的读写交互,为交易管理、账户洞察、质押和代币交互提供标准化的多链 API。

官方
本地
TypeScript
Open-Ledger-MCP-Server

Open-Ledger-MCP-Server

一个用于 OpenLedger API 的模型上下文协议 (MCP) 服务器实现。该服务器根据 MCP 规范为 AI 模型提供结构化的上下文。

官方
TypeScript
ntropy-mcp MCP Server

ntropy-mcp MCP Server

启用使用 Ntropy API 丰富银行数据的功能,并提供高效创建账户持有人和丰富交易信息的工具。

官方
Python
Iaptic MCP Server

Iaptic MCP Server

一个用于与 Iaptic API 交互的服务器,允许像 Claude 这样的人工智能模型查询客户、购买和交易数据,并检索统计见解。

官方
TypeScript
Bitrefill Search and Shop

Bitrefill Search and Shop

这个 MCP 封装了 Bitrefill 的公共 API,允许代理使用比特币、以太坊、Solana 等加密货币搜索产品和购物。

官方
TypeScript
MCP EVM Signer

MCP EVM Signer

一个服务器,可以在本地安全地管理以太坊私钥,并使 Claude for Desktop 能够通过 Infura 与 EVM 兼容的区块链进行交互。

本地
TypeScript