Bitpanda API服务

一个基于Model Context Protocol (MCP)的服务,提供与Bitpanda API交互的工具,支持程序化访问交易、钱包和交易记录等功能。

  • by matteoantoci
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 matteoantoci/mcp-bitpanda

使用说明

MCP Bitpanda服务器

模型上下文协议(MCP)服务器,公开用于与Bitpanda API交互的工具。该服务器允许通过MCP协议对Bitpanda的交易、钱包和交易等功能进行编程访问。

先决条件

  • Node.js(建议使用v18或更高版本)
  • npm(附带Node.js)
  • 一个Bitpanda API密钥(设置为 BITPANDA_API_KEY 环境变量)
  • (可选)MCP兼容客户端或运行器(例如,VSCode扩展、CLI)

设置

  1. 克隆存储库或确保您位于项目目录中。

  2. 安装依赖项:

    npm install
    
  3. 构建服务器:

    npm run build
    

    这将创建一个 build 包含已编译JavaScript代码的目录。

通过Smithery安装

通过以下方式自动安装用于克劳德桌面的MCP Bitpanda服务器 史密瑟里:

npx -y @smithery/cli install @matteoantoci/mcp-bitpanda --client claude

运行服务器

  • 直接:

    node build/index.js
    

    或者,如果你有一个开始脚本:

    npm run start
    
  • 通过MCP转轮: 配置MCP客户端以使用stdio传输运行服务器。 MCP设置输入示例:

    "mcp-bitpanda": {
      "transportType": "stdio",
      "command": "node",
      "args": [
        "/path/to/mcp-bitpanda/build/index.js"
      ]
      // Add environment variables, e.g., for the API key
      "environmentVariables": {
        "BITPANDA_API_KEY": "YOUR_BITPANDA_API_KEY" // Replace with your actual API key or use a secure method to provide it
      }
      // ... other optional settings ...
    }
    

可用工具

  • get_asset_info:按符号(例如BTC、XAU)检索特定资产的详细信息。

    • 参数: symbol (字符串,必填)
    • 注意:此工具不需要API密钥。
  • get_ohlc:检索特定资产、法定货币和时间范围的OHLC(开盘/高/低/收盘)数据。

    • 参数:
      • symbol (string,必填):交易符号。
      • fiatCurrency (字符串,必填):法定货币(如美元、欧元)。
      • timeframe (string,必填):“日”或“周”。
    • 注意:此工具不需要API密钥。
  • list_trades:列出Bitpanda API的所有用户交易。最新交易优先。响应是光标分页的。

    • 参数:
      • type (字符串,可选):其中之一 buy 或 sell.
      • cursor (string,可选):客户最后一次已知交易的Id。仅返回此id之后的交易。空或缺少游标参数将从头返回交易。
      • page_size (整数,可选):分页响应的页面大小。
  • list_asset_wallets:列出Bitpanda API中按资产类型分组的所有用户资产钱包。

    • 参数:无。
  • list_fiat_wallets:列出Bitpanda API中所有用户的法定货币钱包。

    • 参数:无。
  • list_fiat_transactions:列出来自Bitpanda API的所有用户法定交易。最新的法定货币交易优先。响应是光标分页的。

    • 参数:
      • type (字符串,可选):买入、卖出、存款、取款、转账、退款。
      • status (字符串,可选):待定、正在处理、已完成、已取消。
      • cursor (string,可选):客户最后一次已知法定货币交易的Id。仅返回此id之后的法定交易。空或缺少游标参数将从一开始就返回法定交易。
      • page_size (整数,可选):分页响应的页面大小。
  • list_crypto_wallets:列出Bitpanda API中所有用户的加密钱包。

    • 参数:无。
  • list_crypto_transactions:列出来自Bitpanda API的所有用户加密交易。最新的加密货币交易是第一位的。响应是光标分页的。

    • 参数:
      • type (字符串,可选):其中之一 buy, sell, deposit, withdrawal, transfer, refund 或 ico.
      • status (字符串,可选):其中之一 pending, processing, unconfirmed_transaction_out, open_invitation, finished 或 canceled.
      • cursor (string,可选):客户端最后一次已知加密交易的Id。仅返回此id之后的加密交易。空或缺少游标参数将从一开始就返回加密交易。
      • page_size (整数,可选):分页响应的页面大小。
  • list_commodity_transactions:列出所有来自Bitpanda API的用户商品交易。最新的商品交易是第一位的。响应是光标分页的。

    • 参数:
      • cursor (string,可选):客户端最后一次已知商品交易的Id。仅返回此id之后的商品交易。空或缺少游标参数将从头返回商品交易记录。
      • page_size (整数,可选):分页响应的页面大小。

延伸

要添加更多的Bitpanda API端点作为工具,请在中实现一个新的工具文件 src/tools/ 并在中注册 src/tools/index.ts.