Authentication
CyberPay MCP Server 使用 API Key 认证。
获取 API Key
- 访问 CyberDash
- 使用钱包连接登录
- 进入 Settings → API Keys
- 创建新的 API Key
配置方式
环境变量
export CYBERPAY_API_KEY=cp_your_api_keyMCP 配置
在 MCP 配置文件中通过 env 字段传入:
{
"mcpServers": {
"cyberpay": {
"command": "npx",
"args": ["@cyberpay/mcp"],
"env": {
"CYBERPAY_API_KEY": "cp_your_api_key"
}
}
}
}REST API
直接调用 REST API 时,在 Header 中传入:
curl -X POST https://api.cyberpay.org/v1/service/call \
-H "Authorization: Bearer cp_your_api_key" \
-H "Content-Type: application/json" \
-d '{"service_id": "card-list", "params": {"wallet": "0x..."}}'API Key 类型
| 类型 | 前缀 | 权限 |
|---|---|---|
| Production | cp_ | 全部服务,真实交易 |
| Testnet | cp_test_ | 全部服务,测试环境 |
| Read-only | cp_ro_ | 仅查询类服务 |
速率限制
| 计划 | 限制 | 突发 |
|---|---|---|
| Free | 100 次/分钟 | 200 次/分钟 |
| Pro | 1000 次/分钟 | 2000 次/分钟 |
| Enterprise | 自定义 | 自定义 |
超出限制返回 429 Too Many Requests。
安全建议
- 不要在客户端代码中暴露 API Key
- 使用环境变量存储
- 定期轮换 Key
- 为不同环境使用不同的 Key
- 监控 API Key 使用情况
