{
  "markdown": "# Limitless MCP Server\n\n<div align=\"center\">\n  <h3>Prediction Market Trading on Base via Limitless Exchange</h3>\n  <p>Build AI-powered trading agents for Limitless prediction markets using the Model Context Protocol (MCP)</p>\n\n  [![License: PolyForm Noncommercial](https://img.shields.io/badge/License-PolyForm%20Noncommercial-blue.svg)](LICENSE)\n  [![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org/)\n  [![Base Chain](https://img.shields.io/badge/Base-L2-blue.svg)](https://base.org/)\n</div>\n\n---\n\n> **⚠️ Notice: Quantish is winding down.** The Quantish platform (quantish.live) is shutting down. This MCP server is self-hosted and will continue to work independently, but the Quantish team will no longer be maintaining or updating this project. If you're building in the prediction market space and need real-time data infrastructure, check out [polynode.dev](https://polynode.dev).\n\n---\n\n## Features\n\n- **Secure Wallet Management**\n  - Generate new Base wallets with encrypted private key storage\n  - **Bring Your Own Wallet (BYOW)** - Import existing wallets with client-side encryption\n  - Private keys are encrypted with AES-256-GCM before storage\n\n- **Full Limitless Market Access**\n  - Real-time market discovery via Limitless Exchange API\n  - Access to all prediction markets: Politics, Sports, Crypto, and more\n  - Live orderbook data and price history\n  - Semantic search for market discovery\n\n- **Trading Operations**\n  - Place limit orders with EIP-712 signed authentication\n  - Cancel orders (single, batch, or all)\n  - Check and set token approvals (USDC, CTF)\n  - Position tracking with P&L calculations\n\n- **AI Agent Integration**\n  - Full MCP (Model Context Protocol) support\n  - Works with Claude, Cursor IDE, and other MCP-compatible AI tools\n  - 34 pre-built trading tools organized by category\n\n- **Enterprise Security**\n  - AES-256-GCM encryption for all sensitive data\n  - API key authentication with SHA-256 hashing\n  - Platform partner system for B2B integrations\n  - Rate limiting and request logging\n\n---\n\n## Quick Start\n\n### 1. Configure MCP (Cursor IDE)\n\nAdd to `~/.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"limitless\": {\n      \"url\": \"https://limitless-mcp-server-production.up.railway.app/mcp\",\n      \"headers\": {\n        \"x-api-key\": \"YOUR_API_KEY\"\n      }\n    }\n  }\n}\n```\n\n### 2. Get Your API Key\n\nVia MCP tool:\n```json\n{\n  \"tool\": \"limitless_signup\",\n  \"args\": {\n    \"externalId\": \"your-unique-id\"\n  }\n}\n```\n\n### 3. Start Trading\n\n```\n\"Search for bitcoin prediction markets\"\n\"Buy 10 YES shares at $0.60 on the BTC market\"\n\"Show my current positions\"\n\"Cancel my open orders\"\n```\n\n---\n\n## Available MCP Tools (34 Total)\n\n> **Note:** All tool names are prefixed with `limitless_` to avoid collisions with other MCPs.\n\n### Authentication & Setup (6 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_signup` | Create a new account with a fresh Base wallet |\n| `limitless_request_api_key` | Get new API key (requires HMAC signature) |\n| `limitless_setup_wallet` | Generate a new Base wallet |\n| `limitless_import_wallet` | Import existing wallet (encrypted) |\n| `limitless_get_wallet_import_instructions` | Instructions for secure wallet export |\n| `limitless_import_private_key` | Direct private key import |\n\n### Wallet Information (4 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_get_wallet_info` | Get wallet address and type |\n| `limitless_get_wallet_status` | Full wallet status with balances |\n| `limitless_get_balances` | Check ETH and USDC balances |\n| `limitless_get_deposit_address` | Get address for funding |\n\n### Market Discovery (6 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_get_markets` | List active markets with pagination |\n| `limitless_search_markets` | Semantic search for markets |\n| `limitless_get_market` | Get market details including venue |\n| `limitless_get_orderbook` | Get order book with bids/asks |\n| `limitless_get_price_history` | Historical price data |\n| `limitless_get_categories` | List market categories |\n\n### Trading (8 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_place_order` | Place a limit order |\n| `limitless_cancel_order` | Cancel a single order |\n| `limitless_cancel_all_orders` | Cancel all orders in a market |\n| `limitless_get_orders` | List your orders |\n| `limitless_check_approvals` | Check token approvals |\n| `limitless_set_approvals` | Set token approvals |\n| `limitless_get_locked_balance` | Get USDC locked in orders |\n| `limitless_get_quote` | Estimate fill price |\n\n### Positions (4 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_get_positions` | Get active positions with P&L |\n| `limitless_get_trades` | Get trade history |\n| `limitless_get_portfolio_history` | Full portfolio history |\n| `limitless_sync_positions` | Sync positions from API |\n\n### Transfers (3 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_send_eth` | Send ETH to another address |\n| `limitless_send_usdc` | Send USDC to another address |\n| `limitless_export_private_key` | Export wallet private key |\n\n### API Key Management (3 tools)\n\n| Tool | Description |\n|------|-------------|\n| `limitless_list_api_keys` | List your API keys |\n| `limitless_create_api_key` | Create a new API key |\n| `limitless_revoke_api_key` | Revoke an API key |\n\n---\n\n## Self-Hosting\n\n### Prerequisites\n\n- Node.js 20+\n- PostgreSQL 15+\n- Base RPC access (mainnet.base.org)\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/joinQuantish/limitless-mcp.git\ncd limitless-mcp\n\n# Install dependencies\nnpm install\n\n# Copy environment template\ncp .env.example .env\n\n# Edit .env with your values (see Environment Variables below)\n\n# Generate Prisma client\nnpx prisma generate\n\n# Push database schema\nnpx prisma db push\n\n# Build and start\nnpm run build\nnpm start\n```\n\n### Environment Variables\n\nCreate a `.env` file with:\n\n```bash\n# Database (PostgreSQL)\nDATABASE_URL=\"postgresql://user:password@host:5432/limitless_mcp?schema=public\"\n\n# Encryption (generate with: openssl rand -hex 32)\nENCRYPTION_KEY=\"your-64-character-hex-encryption-key-here\"\n\n# Blockchain - Base L2\nBASE_RPC_URL=\"https://mainnet.base.org\"\n\n# Limitless Exchange API\nLIMITLESS_API_URL=\"https://api.limitless.exchange\"\n\n# Server\nPORT=3003\nNODE_ENV=production\n\n# Admin API Key (generate with: openssl rand -hex 32)\nADMIN_API_KEY=\"your-admin-api-key-here\"\n\n# Optional: Bot signing secret for returning user verification\nBOT_SIGNING_SECRET=\"\"\n```\n\n### Docker Deployment\n\n```bash\n# Build the image\ndocker build -t limitless-mcp .\n\n# Run the container\ndocker run -d \\\n  -p 3003:3003 \\\n  -e DATABASE_URL=\"postgresql://...\" \\\n  -e ENCRYPTION_KEY=\"...\" \\\n  -e ADMIN_API_KEY=\"...\" \\\n  -e BASE_RPC_URL=\"https://mainnet.base.org\" \\\n  -e LIMITLESS_API_URL=\"https://api.limitless.exchange\" \\\n  -e NODE_ENV=production \\\n  limitless-mcp\n```\n\n### Railway Deployment\n\n```bash\n# Install Railway CLI\nnpm install -g @railway/cli\n\n# Login and initialize\nrailway login\nrailway init\n\n# Add PostgreSQL via Railway dashboard\n\n# Set environment variables\nrailway variables set DATABASE_URL=\"postgresql://...\"\nrailway variables set ENCRYPTION_KEY=\"$(openssl rand -hex 32)\"\nrailway variables set ADMIN_API_KEY=\"$(openssl rand -hex 32)\"\nrailway variables set BASE_RPC_URL=\"https://mainnet.base.org\"\nrailway variables set LIMITLESS_API_URL=\"https://api.limitless.exchange\"\nrailway variables set NODE_ENV=\"production\"\n\n# Deploy\nrailway up\n```\n\n---\n\n## API Reference\n\n### Health Check\n\n```bash\ncurl https://your-server/health\n```\n\nResponse:\n```json\n{\n  \"status\": \"healthy\",\n  \"timestamp\": \"2026-01-17T12:00:00.000Z\",\n  \"version\": \"1.0.0\",\n  \"service\": \"limitless-mcp\",\n  \"database\": \"connected\",\n  \"environment\": \"production\"\n}\n```\n\n### MCP Endpoint\n\n```bash\n# List available tools\ncurl -X POST https://your-server/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{}}'\n\n# Call a tool (authenticated)\ncurl -X POST https://your-server/mcp \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-api-key: pk_limitless_...\" \\\n  -d '{\n    \"jsonrpc\":\"2.0\",\n    \"id\":1,\n    \"method\":\"tools/call\",\n    \"params\":{\n      \"name\":\"limitless_get_balances\",\n      \"arguments\":{}\n    }\n  }'\n```\n\n### Market Data API\n\n```bash\n# Get active markets\ncurl \"https://your-server/api/markets?limit=10&page=1\"\n\n# Search markets\ncurl \"https://your-server/api/markets/search?query=bitcoin&limit=5\"\n\n# Get market details\ncurl \"https://your-server/api/markets/your-market-slug\"\n\n# Get orderbook\ncurl \"https://your-server/api/markets/your-market-slug/orderbook\"\n```\n\n---\n\n## Security Architecture\n\n<details>\n<summary>Click to expand security details</summary>\n\n### Encryption at Rest\n\nAll sensitive data is encrypted using AES-256-GCM:\n- Private keys encrypted before database storage\n- Session tokens encrypted with unique IVs\n- API secrets encrypted (only SHA-256 hash stored for lookup)\n\n### API Key Security\n\n```\nAPI Key Format: pk_limitless_<32 base64url chars>\nAPI Secret Format: sk_limitless_<43 base64url chars>\n```\n\n- Keys are hashed with SHA-256 before storage (never stored in plaintext)\n- Secrets are encrypted with AES-256-GCM\n- Timing-safe comparison using `crypto.timingSafeEqual`\n\n### Platform Isolation (B2B)\n\nFor platform partners:\n- Platform admin keys: `plt_limitless_*` / `psk_limitless_*`\n- All queries scoped by platformId at database level\n- Activity logging for audit trail\n- User limits enforced per platform\n\n### Rate Limiting\n\n- 60 requests/minute per API key (general)\n- 30 requests/minute for user listing (platform admin)\n- 5 requests/hour for platform registration\n\n</details>\n\n---\n\n## Secure Wallet Import (BYOW)\n\nImport your existing MetaMask/hardware wallet securely:\n\n### Step 1: Export Your Private Key\n\nIn MetaMask: Settings > Security > Export Private Key\n\n### Step 2: Encrypt Locally\n\n```javascript\nconst crypto = require('crypto');\n\nconst privateKey = 'YOUR_PRIVATE_KEY_WITHOUT_0x_PREFIX';\nconst password = 'YourSecurePassword123!'; // min 12 chars\n\nconst salt = crypto.randomBytes(32);\nconst iv = crypto.randomBytes(16);\nconst derivedKey = crypto.scryptSync(password, salt, 32, { N: 16384, r: 8, p: 1 });\n\nconst cipher = crypto.createCipheriv('aes-256-gcm', derivedKey, iv);\nlet encrypted = cipher.update(privateKey, 'utf8', 'hex');\nencrypted += cipher.final('hex');\nconst authTag = cipher.getAuthTag().toString('hex');\n\nconsole.log({\n  encryptedKey: `${encrypted}:${authTag}`,\n  salt: salt.toString('hex'),\n  iv: iv.toString('hex'),\n  publicKey: 'YOUR_WALLET_ADDRESS'\n});\n```\n\n### Step 3: Import to SDK\n\n```json\n{\n  \"tool\": \"limitless_import_wallet\",\n  \"args\": {\n    \"encryptedKey\": \"...\",\n    \"salt\": \"...\",\n    \"iv\": \"...\",\n    \"publicKey\": \"0x...\",\n    \"password\": \"YourSecurePassword123!\"\n  }\n}\n```\n\n> **Security Note**: Your raw private key NEVER leaves your machine. Only the encrypted bundle is sent to our servers, and we cannot decrypt it without your password.\n\n---\n\n## Related Resources\n\n| Resource | URL |\n|----------|-----|\n| Limitless Exchange | https://limitless.exchange |\n| Limitless API Docs | https://api.limitless.exchange/api-v1 |\n| Base Chain Explorer | https://basescan.org |\n| Base USDC Contract | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |\n\n---\n\n## License\n\n[PolyForm Noncommercial 1.0.0](LICENSE) © [Quantish](https://quantish.live)\n\n---\n\n## Support\n\n- Issues: [GitHub Issues](https://github.com/joinQuantish/limitless-mcp/issues)\n- Email: hello@quantish.live\n\n---\n\n<div align=\"center\">\n  <sub>Built with precision by <a href=\"https://quantish.live\">Quantish</a></sub>\n</div>\n",
  "bytes": 11634,
  "sha": "16949540256c01963aac2e6a03b752aa937541d64cb2e7a940f5c09259a0471e",
  "repo_slug": "joinquantish/limitless-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_joinquantish_limitless_3bf221ce/readme"
}