ZebPay MCP Server

السجل الرسمي المالية والمدفوعات

MCP server for ZebPay crypto exchange — fetch prices, balances, and manage orders

ماذا يمكنك أن تفعل مع ZebPay MCP Server؟

  • 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

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package @zebpay_rajesh/zebpay-mcp-server
Claude Code
claude mcp add zebpay-mcp-server -e 'ZEBPAY_API_KEY=<your zebpay_api_key>' -e 'ZEBPAY_API_SECRET=<your zebpay_api_secret>' -- npx -y @zebpay_rajesh/zebpay-mcp-server@1.0.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "zebpay-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@zebpay_rajesh/zebpay-mcp-server@1.0.1"
            ],
            "env": {
                "ZEBPAY_API_KEY": "<your zebpay_api_key>",
                "ZEBPAY_API_SECRET": "<your zebpay_api_secret>"
            }
        }
    }
}

متغيرات البيئة

  • ZEBPAY_API_KEY إلزامي سري Your ZebPay API key from the developer portal
  • ZEBPAY_API_SECRET إلزامي سري Your ZebPay API secret from the developer portal

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. Zebpay MCP Server
  2. What This Server Provides
  3. Features
  4. Supported Tools
  5. Tech Stack
  6. Project Structure
  7. Prerequisites
  8. Creating a ZebPay API Key
  9. Setup
  10. Build and Run
  11. MCP Client Configuration (Stdio)
  12. Environment Variables
  13. Developer Commands
  14. Logging
  15. Issues
  16. License

Zebpay MCP Server

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"
      }
    }
  }
}

Also see: mcp-config.json.example.

Environment Variables

VariableRequiredDescriptionExample value
ZEBPAY_API_KEYYesZebpay API key (required for private tools)YOUR_API_KEY_HERE
ZEBPAY_API_SECRETYesZebpay API secret (required for private tools)YOUR_API_SECRET_HERE
MCP_TRANSPORTSYesMust be stdiostdio
ZEBPAY_SPOT_BASE_URLYesSpot API base URLhttps://www.zebapi.com/api/v2
ZEBPAY_FUTURES_BASE_URLYesFutures API base URLhttps://futures-api.zebpay.com/api/v1
ZEBPAY_MARKET_BASE_URLYesMarket API base URLhttps://www.zebapi.com/api/v1/market
LOG_LEVELYesdebug, info, warn, errorinfo
LOG_FILENoFile path for logslogs/mcp-server.log
HTTP_TIMEOUT_MSYesOutbound request timeout (ms)15000
HTTP_RETRY_COUNTYesRetry count for outbound requests2

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

الأسئلة الشائعة

ما هو ZebPay MCP Server؟

MCP server for ZebPay crypto exchange — fetch prices, balances, and manage orders

كيف أثبّت ZebPay MCP Server؟

يعمل على جهازك. في Claude Code: claude mcp add zebpay-mcp-server -e 'ZEBPAY_API_KEY=<your zebpay_api_key>' -e 'ZEBPAY_API_SECRET=<your zebpay_api_secret>' -- npx -y @zebpay_rajesh/zebpay-mcp-server@1.0.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج ZebPay MCP Server إلى مفتاح API؟

نعم. يتطلب ZEBPAY_API_KEY, ZEBPAY_API_SECRET، وتضبطها في إعداداته.

هل ZebPay MCP Server مفتوح المصدر؟

شيفرته علنية على GitHub، لكن المستودع لا يعلن ترخيصًا قياسيًا.

من يصون ZebPay MCP Server؟

ينشره zebpay. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.