Zebpay MCP Server

Zebpay MCP Server

Enables AI assistants to securely access Zebpay's spot and futures APIs for market data, trading, and account management through the Model Context Protocol, supporting clients like Cursor and Claude Desktop.

Category
访问服务器

README

Zebpay MCP Server

AI Trading Made Simple

Production-ready TypeScript MCP (Model Context Protocol) server for Zebpay spot and futures APIs, using stdio transport only. Model Context Protocol (MCP) is a standard way for AI assistants to securely call tools and data sources. It is designed for MCP clients like Cursor, Claude Desktop, and MCP Inspector that connect through local process execution. The server provides both market-data and trading workflows with strict validation, safe error handling, and developer-friendly observability.

What This Server Provides

  • Public market data tools (spot + futures)
  • Private trading/account tools (requires API credentials)
  • MCP resources and prompts for agent workflows
  • Request validation via Zod
  • Structured error handling and optional file logging

Features

  • Stdio-only MCP server for secure local integration with MCP clients
  • Spot and futures API coverage for both public and authenticated operations
  • HMAC-based authenticated request flow for private endpoints
  • Input validation and normalized MCP error responses
  • Outbound request retries and timeout controls
  • Optional structured file logging for debugging and auditability

Supported Tools

Spot (Public + Private)

  • Market data: tickers, order book, trades, klines, exchange info, currencies
  • Trading: place market/limit orders, cancel orders, cancel by symbol, cancel all
  • Account: balances, open orders, order history, trade history, exchange fee
  • Example tool names:
    • zebpay_public_getTicker
    • zebpay_public_getOrderBook
    • zebpay_spot_placeMarketOrder
    • zebpay_spot_placeLimitOrder
    • zebpay_spot_getBalance

Futures (Public + Private)

  • Market data: health status, markets, market info, order book, 24h ticker, aggregate trades
  • Trading/account: wallet balance, place order, add/reduce margin, open orders, positions
  • History: order history, linked orders, trade history, transaction history
  • Example tool names:
    • zebpay_futures_public_getMarkets
    • zebpay_futures_public_getOrderBook
    • zebpay_futures_placeOrder
    • zebpay_futures_getWalletBalance
    • zebpay_futures_getPositions

Tech Stack

  • Node.js (ESM)
  • TypeScript
  • @modelcontextprotocol/sdk
  • undici
  • zod

Project Structure

src/
├── index.ts                  # Stdio MCP server entrypoint
├── mcp/                      # Tools, resources, prompts, MCP errors/logging
├── private/                  # Authenticated Zebpay clients
├── public/                   # Public market-data clients
├── security/                 # Credentials + signing helpers
├── http/                     # Shared outbound HTTP client to Zebpay APIs
├── validation/               # Schemas and validation helpers
├── utils/                    # Caching, metrics, formatting, file logging
└── types/                    # Shared response types

Prerequisites

  • Node.js 20+
  • npm 9+
  • Zebpay API credentials (for private tools)
  • Create your API key/secret from the official ZebPay API portal: https://api.zebpay.com/

Creating a ZebPay API Key

Use the steps below to generate API credentials for this MCP server:

  1. Open the ZebPay API portal: https://api.zebpay.com/
  2. Sign in to your ZebPay account.
  3. Go to API Trading and click Create New API Key.
  4. Enter key details:
    • key name (for example: zebpay-mcp-local)
    • required permissions (read-only for market/account checks, trading permissions only if needed)
    • optional IP whitelist (recommended for better security)
  5. Complete OTP verification.
  6. Copy and save:
    • API Key
    • Secret Key (shown once)

Then add them to your local .env file:

ZEBPAY_API_KEY=your_api_key
ZEBPAY_API_SECRET=your_api_secret

Security notes:

  • Never commit API keys/secrets to git.
  • Prefer least-privilege API permissions.
  • Rotate keys immediately if exposed.

Setup

git clone <your-repo-url>
cd zebpay-mcp-server
npm install
cp env.example .env

Update .env (all values are read from environment; there are no fallback defaults in code):

ZEBPAY_API_KEY=your_api_key    # Use the API key from the step above
ZEBPAY_API_SECRET=your_api_secret    # Use the Secret key from the step above
ZEBPAY_SPOT_BASE_URL=https://sapi.zebpay.com/api/v2
ZEBPAY_FUTURES_BASE_URL=https://futuresbe.zebpay.com/api/v1
ZEBPAY_MARKET_BASE_URL=https://www.zebapi.com/api/v1/market
MCP_TRANSPORTS=stdio
LOG_LEVEL=info
HTTP_TIMEOUT_MS=15000
HTTP_RETRY_COUNT=2

Build and Run

npm run build
npm start

Optional logging to file:

npm run start:log

MCP Client Configuration (Stdio)

Example MCP client config:

{
  "mcpServers": {
    "zebpay": {
      "command": "node",
      "args": [
          "/absolute/path/to/zebpay-mcp-server/dist/index.js"
        ],
      "env": {
        "ZEBPAY_API_KEY": "YOUR_API_KEY_HERE",
        "ZEBPAY_API_SECRET": "YOUR_API_SECRET_HERE",
        "LOG_LEVEL": "info"
      }
    }
  }
}

<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">

Also see: mcp-config.json.example.

Environment Variables

Variable Required Description Example value
ZEBPAY_API_KEY Yes Zebpay API key (required for private tools) YOUR_API_KEY_HERE
ZEBPAY_API_SECRET Yes Zebpay API secret (required for private tools) YOUR_API_SECRET_HERE
MCP_TRANSPORTS Yes Must be stdio stdio
ZEBPAY_SPOT_BASE_URL Yes Spot API base URL https://www.zebapi.com/api/v2
ZEBPAY_FUTURES_BASE_URL Yes Futures API base URL https://futures-api.zebpay.com/api/v1
ZEBPAY_MARKET_BASE_URL Yes Market API base URL https://www.zebapi.com/api/v1/market
LOG_LEVEL Yes debug, info, warn, error info
LOG_FILE No File path for logs logs/mcp-server.log
HTTP_TIMEOUT_MS Yes Outbound request timeout (ms) 15000
HTTP_RETRY_COUNT Yes Retry count for outbound requests 2

Developer Commands

npm run build
npm test
npm run test:watch
npm run logs
npm run logs:watch
npm run logs:errors
npm run logs:stats
npm run logs:clear

Logging

  • Log tools and examples: scripts/README.md
  • Full logging docs: docs/LOGGING.md
  • Keep logs out of git (logs/ is ignored)

Issues

Found a bug or want to request a feature?

  • Create an issue from the GitHub Issues tab for this repository.
  • You can also use direct links after replacing <your-org> and <your-repo>:
    • Bug report: https://github.com/<your-org>/<your-repo>/issues/new?template=bug_report.md
    • Feature request: https://github.com/<your-org>/<your-repo>/issues/new?template=feature_request.md
  • Include these details for faster triage:
    • MCP client used (Cursor/Claude Desktop/other)
    • Node.js version and OS
    • Minimal reproduction steps
    • Relevant logs (redact secrets)

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选