Back to MCP directory
publicPublicdnsLocal runtime

PayPal MCP

PayPal MCP服务器是一个提供与PayPal API集成的标准化接口服务,支持支付处理、业务操作和用户管理功能。

article

README

🚀 PayPal MCP 服务器

PayPal MCP 服务器由 DynamicEndpoints 维护,为用户提供与 PayPal 支付相关的功能服务,可实现订单创建、发票生成、汇款处理等操作。

🚀 快速开始

若你想使用本 PayPal MCP 服务器,可按以下步骤进行操作:

  1. 克隆仓库:
    git clone https://github.com/your-repository.git
    cd your-repository
    
  2. 安装依赖项:
    npm install
    
  3. 启动服务器:
    node index.js
    

✨ 主要特性

  • 功能丰富:支持创建订单、发票以及处理汇款等多种 PayPal 相关业务。
  • 错误处理全面:实现了对输入验证错误、PayPal API 错误、网络和身份验证错误、速率限制和超时等情况的处理。
  • 安全可靠:对敏感数据进行验证和清理,采用 PayPal 的 OAuth 2.0 身份验证,通过环境变量管理安全凭证,验证所有 API 参数,且错误消息不会泄露敏感信息。
  • 便于开发:提供构建、测试和调试命令,服务器输出详细日志辅助开发。

💻 使用示例

基础用法

创建订单

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

创建发票

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: '咨询服务',
    quantity: '1',
    unit_amount: {
      currency_code: 'USD',
      value: '500.00'
    }
  }]
});

处理汇款

const result = await mcpClient.useTool('paypal', 'create_payout', {
  sender_batch_header: {
    sender_batch_id: 'PAY-2024_001',
    email_subject: '您已收到款项'
  },
  items: [{
    recipient_type: 'EMAIL',
    amount: {
      value: '1000.00',
      currency: 'USD'
    },
    receiver: 'employee@example.com',
    note: '月度工资支付'
  }]
});

🔧 技术细节

该服务器实现了全面的错误处理,涵盖输入验证错误(带有详细消息)、PayPal API 错误(包含响应详情)、网络和身份验证错误以及速率限制和超时处理。同时,在安全方面,所有敏感数据经过验证和清理,使用 PayPal 的 OAuth 2.0 身份验证,通过环境变量管理安全凭证,验证所有 API 参数,且错误消息不泄露敏感信息。

📚 详细文档

开发

构建

npm run build

测试

npm test

调试

服务器输出详细日志以帮助调试,可处理身份验证问题、API 调用失败、验证错误以及查看请求/响应详情。

贡献指南

  1. 克隆仓库:
    git clone https://github.com/your-repository.git
    cd your-repository
    
  2. 创建功能分支:
    git checkout -b feature/your-feature
    
  3. 提交更改:
    git add .
    git commit -m '添加新功能'
    
  4. 推送到分支:
    git push origin feature/your-feature
    
  5. 创建拉取请求

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client