{
  "markdown": "# Zebpay MCP Server\n\n![AI Trading Made Simple](docs/zebpay-ai-trading-beginner.png)\n\nProduction-ready TypeScript **MCP (Model Context Protocol)** server for Zebpay spot and futures APIs, using **stdio transport only**.\nModel Context Protocol (MCP) is a standard way for AI assistants to securely call tools and data sources.\nIt is designed for MCP clients like Cursor, Claude Desktop, and MCP Inspector that connect through local process execution.\nThe server provides both market-data and trading workflows with strict validation, safe error handling, and developer-friendly observability.\n\n## What This Server Provides\n\n- Public market data tools (spot + futures)\n- Private trading/account tools (requires API credentials)\n- MCP resources and prompts for agent workflows\n- Request validation via Zod\n- Structured error handling and optional file logging\n\n## Features\n\n- Stdio-only MCP server for secure local integration with MCP clients\n- Spot and futures API coverage for both public and authenticated operations\n- HMAC-based authenticated request flow for private endpoints\n- Input validation and normalized MCP error responses\n- Outbound request retries and timeout controls\n- Optional structured file logging for debugging and auditability\n\n## Supported Tools\n\n### Spot (Public + Private)\n\n- Market data: tickers, order book, trades, klines, exchange info, currencies\n- Trading: place market/limit orders, cancel orders, cancel by symbol, cancel all\n- Account: balances, open orders, order history, trade history, exchange fee\n- Example tool names:\n  - `zebpay_public_getTicker`\n  - `zebpay_public_getOrderBook`\n  - `zebpay_spot_placeMarketOrder`\n  - `zebpay_spot_placeLimitOrder`\n  - `zebpay_spot_getBalance`\n\n### Futures (Public + Private)\n\n- Market data: health status, markets, market info, order book, 24h ticker, aggregate trades\n- Trading/account: wallet balance, place order, add/reduce margin, open orders, positions\n- History: order history, linked orders, trade history, transaction history\n- Example tool names:\n  - `zebpay_futures_public_getMarkets`\n  - `zebpay_futures_public_getOrderBook`\n  - `zebpay_futures_placeOrder`\n  - `zebpay_futures_getWalletBalance`\n  - `zebpay_futures_getPositions`\n\n## Tech Stack\n\n- Node.js (ESM)\n- TypeScript\n- `@modelcontextprotocol/sdk`\n- `undici`\n- `zod`\n\n## Project Structure\n\n```text\nsrc/\n├── index.ts                  # Stdio MCP server entrypoint\n├── mcp/                      # Tools, resources, prompts, MCP errors/logging\n├── private/                  # Authenticated Zebpay clients\n├── public/                   # Public market-data clients\n├── security/                 # Credentials + signing helpers\n├── http/                     # Shared outbound HTTP client to Zebpay APIs\n├── validation/               # Schemas and validation helpers\n├── utils/                    # Caching, metrics, formatting, file logging\n└── types/                    # Shared response types\n```\n\n## Prerequisites\n\n- Node.js 20+\n- npm 9+\n- Zebpay API credentials (for private tools)\n- Create your API key/secret from the official ZebPay API portal: `https://api.zebpay.com/`\n\n## Creating a ZebPay API Key\n\nUse the steps below to generate API credentials for this MCP server:\n\n1. Open the ZebPay API portal: `https://api.zebpay.com/`\n2. Sign in to your ZebPay account.\n3. Go to **API Trading** and click **Create New API Key**.\n4. Enter key details:\n   - key name (for example: `zebpay-mcp-local`)\n   - required permissions (read-only for market/account checks, trading permissions only if needed)\n   - optional IP whitelist (recommended for better security)\n5. Complete OTP verification.\n6. Copy and save:\n   - API Key\n   - Secret Key (shown once)\n\nThen add them to your local `.env` file:\n\n```env\nZEBPAY_API_KEY=your_api_key\nZEBPAY_API_SECRET=your_api_secret\n```\n\nSecurity notes:\n\n- Never commit API keys/secrets to git.\n- Prefer least-privilege API permissions.\n- Rotate keys immediately if exposed.\n\n## Setup\n\n```bash\ngit clone <your-repo-url>\ncd zebpay-mcp-server\nnpm install\ncp env.example .env\n```\n\nUpdate `.env` (all values are read from environment; there are no fallback defaults in code):\n\n```env\nZEBPAY_API_KEY=your_api_key    # Use the API key from the step above\nZEBPAY_API_SECRET=your_api_secret    # Use the Secret key from the step above\nZEBPAY_SPOT_BASE_URL=https://sapi.zebpay.com/api/v2\nZEBPAY_FUTURES_BASE_URL=https://futuresbe.zebpay.com/api/v1\nZEBPAY_MARKET_BASE_URL=https://www.zebapi.com/api/v1/market\nMCP_TRANSPORTS=stdio\nLOG_LEVEL=info\nHTTP_TIMEOUT_MS=15000\nHTTP_RETRY_COUNT=2\n```\n\n## Build and Run\n\n```bash\nnpm run build\nnpm start\n```\n\nOptional logging to file:\n\n```bash\nnpm run start:log\n```\n\n## MCP Client Configuration (Stdio)\n\nExample MCP client config:\n\n```json\n{\n  \"mcpServers\": {\n    \"zebpay\": {\n      \"command\": \"node\",\n      \"args\": [\n          \"/absolute/path/to/zebpay-mcp-server/dist/index.js\"\n        ],\n      \"env\": {\n        \"ZEBPAY_API_KEY\": \"YOUR_API_KEY_HERE\",\n        \"ZEBPAY_API_SECRET\": \"YOUR_API_SECRET_HERE\",\n        \"LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n[<img src=\"https://cursor.com/deeplink/mcp-install-dark.svg\" alt=\"Install in Cursor\">](https://cursor.com/en/install-mcp?name=zebpay&config=eyJjb21tYW5kIjoibm9kZSIsImFyZ3MiOlsiL2Fic29sdXRlL3BhdGgvdG8vemVicGF5LW1jcC1zZXJ2ZXIvZGlzdC9pbmRleC5qcyJdLCJlbnYiOnsiWkVCUEFZX0FQSV9LRVkiOiJZT1VSX0FQSV9LRVlfSEVSRSIsIlpFQlBBWV9BUElfU0VDUkVUIjoiWU9VUl9BUElfU0VDUkVUX0hFUkUiLCJMT0dfTEVWRUwiOiJpbmZvIn19)\n\nAlso see: `mcp-config.json.example`.\n\n## Environment Variables\n\n| Variable                  | Required | Description                                    | Example value                           |\n| ------------------------- | -------- | ---------------------------------------------- | --------------------------------------- |\n| `ZEBPAY_API_KEY`          | Yes      | Zebpay API key (required for private tools)    | `YOUR_API_KEY_HERE`                     |\n| `ZEBPAY_API_SECRET`       | Yes      | Zebpay API secret (required for private tools) | `YOUR_API_SECRET_HERE`                  |\n| `MCP_TRANSPORTS`          | Yes      | Must be `stdio`                                | `stdio`                                 |\n| `ZEBPAY_SPOT_BASE_URL`    | Yes      | Spot API base URL                              | `https://www.zebapi.com/api/v2`         |\n| `ZEBPAY_FUTURES_BASE_URL` | Yes      | Futures API base URL                           | `https://futures-api.zebpay.com/api/v1` |\n| `ZEBPAY_MARKET_BASE_URL`  | Yes      | Market API base URL                            | `https://www.zebapi.com/api/v1/market`  |\n| `LOG_LEVEL`               | Yes      | `debug`, `info`, `warn`, `error`               | `info`                                  |\n| `LOG_FILE`                | No       | File path for logs                             | `logs/mcp-server.log`                   |\n| `HTTP_TIMEOUT_MS`         | Yes      | Outbound request timeout (ms)                  | `15000`                                 |\n| `HTTP_RETRY_COUNT`        | Yes      | Retry count for outbound requests              | `2`                                     |\n\n## Developer Commands\n\n```bash\nnpm run build\nnpm test\nnpm run test:watch\nnpm run logs\nnpm run logs:watch\nnpm run logs:errors\nnpm run logs:stats\nnpm run logs:clear\n```\n\n## Logging\n\n- Log tools and examples: `scripts/README.md`\n- Full logging docs: `docs/LOGGING.md`\n- Keep logs out of git (`logs/` is ignored)\n\n## Issues\n\nFound a bug or want to request a feature?\n\n- Create an issue from the GitHub **Issues** tab for this repository.\n- You can also use direct links after replacing `<your-org>` and `<your-repo>`:\n  - Bug report: `https://github.com/<your-org>/<your-repo>/issues/new?template=bug_report.md`\n  - Feature request: `https://github.com/<your-org>/<your-repo>/issues/new?template=feature_request.md`\n- Include these details for faster triage:\n  - MCP client used (Cursor/Claude Desktop/other)\n  - Node.js version and OS\n  - Minimal reproduction steps\n  - Relevant logs (redact secrets)\n\n## License\n\nMIT\n",
  "bytes": 8006,
  "sha": "f50dfbabb0b53a12a6666bdd0fdfe15e968a3c0cb203a195e3bcc1161cef9b80",
  "repo_slug": "zebpay/zebpay-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_zebpayrajesh_zebpay_mcp_server_b2ec786b/readme"
}