一个提供与PayPal API集成的模型上下文协议(MCP)服务器。此服务器借助标准化接口,实现与PayPal在支付处理、发票开具、订阅管理和业务操作等方面的无缝交互,为业务流程提供便利。
本服务器可帮助您轻松实现与PayPal API的集成。以下是启动项目的基本步骤。
# 克隆仓库
git clone https://github.com/arbuthnot-eth/PayPal-MCP-Backdated.git
cd PayPal-MCP-Backdated
# 安装依赖
npm install
# 构建项目
npm run build
在根目录下创建一个.env
文件,添加您的PayPal API凭证:
PAYPAL_CLIENT_ID=your_client_id_here
PAYPAL_CLIENT_SECRET=your_client_secret_here
PAYPAL_ENVIRONMENT=sandbox # 或 'live' 表示生产环境
# 启动服务器
npm start
# 开发环境下自动重载
npm run dev
将服务器添加到您的MCP配置文件中:
{
"mcpServers": {
"paypal": {
"command": "node",
"args": ["path/to/paypal-mcp/build/index.js"],
"env": {
"PAYPAL_CLIENT_ID": "your_client_id",
"PAYPAL_CLIENT_SECRET": "your_client_secret",
"PAYPAL_ENVIRONMENT": "sandbox"
},
"disabled": false,
"autoApprove": []
}
}
}
本服务器提供了丰富的工具来满足不同的业务需求,以下是一些常用工具的使用示例。
create_payment_token
:创建供未来使用的支付令牌create_order
:创建新的PayPal订单capture_order
:捕获授权订单的付款create_payment
:创建直接付款create_subscription
:为重复计费创建订阅create_product
:创建目录中的新商品create_invoice
:生成新的发票create_payout
:处理批量汇款get_userinfo
:检索用户信息create_web_profile
:创建网络体验配置 профілget_web_profiles
:获取网络体验配置 profail列表# 运行代码检查
npm run lint
# 执行测试
npm test
# 格式化代码
npm run format
该项目采用MIT许可证,详细信息请参阅LICENSE文件。