Skip to main content
Glama
Polmexbot MCP Server

Polmexbot MCP Server

Official
by PolmexBot

Polmexbot MCP Server

CI License: MIT Node.js >= 20

Official Model Context Protocol (MCP) server, no-wallet in-memory sandbox, and reference AI agents for Polmexbot (also compatible with polmexbot.pro) — an automated Polymarket trading engine for 5-minute crypto up/down rounds (BTC, ETH, SOL, XRP, DOGE, BNB).

Polmexbot exposes structured tools for wallet readiness, configuration preview & validation, engine start/stop, positions, trades, and live logs. It controls Polmexbot's existing strategy engine (constellation, aistrat, aces, custom) and does not expose arbitrary buy/sell or market-making order placement.


Quickstart (No Wallet Required — Sandbox)

Run directly with npx (Node.js 20+ required) — zero setup, zero network calls, 100 simulated pUSD:

Claude Desktop / Cursor / Claude Code / Windsurf

Add this to your MCP client config (claude_desktop_config.json, .cursor/mcp.json, or .mcp.json):

{
  "mcpServers": {
    "polmexbot": {
      "command": "npx",
      "args": ["-y", "github:PolmexBot/polmexbot-mcp"],
      "env": {
        "POLMEXBOT_SANDBOX": "true"
      }
    }
  }
}

Or install globally from GitHub:

npm install -g github:PolmexBot/polmexbot-mcp
POLMEXBOT_SANDBOX=true polmexbot-mcp

Official site endpoints: Default API base URL is https://www.polmexbot.xyz. To target polmexbot.pro, set "POLMEXBOT_BASE_URL": "https://www.polmexbot.pro". Legacy POLMEXBOTXYZ_* and POLMEXBOTPRO_* environment prefixes are also supported automatically.

Region note for live API calls: Live Polmexbot API endpoints follow Polymarket regional restrictions (US IPs receive HTTP 451). Sandbox mode works anywhere with no network calls; for live trading, run your MCP client / agent server outside the US (e.g. EU or Asia).


Related MCP server: Polymarket MCP Server

Operating Modes

1. Live Read-Only Mode (Default)

A human connects their account via Polmexbot Settings (or polmexbot.pro/settings) and passes only the bearer token:

{
  "mcpServers": {
    "polmexbot": {
      "command": "npx",
      "args": ["-y", "github:PolmexBot/polmexbot-mcp"],
      "env": {
        "POLMEXBOT_BASE_URL": "https://www.polmexbot.xyz",
        "POLMEXBOT_TOKEN": "your-account-bearer-token"
      }
    }
  }
}

Connecting alone never starts trading. Only read-only and configuration-preview tools are registered.

2. Supervised Approval-Gated Controls

Require an explicit human approval token + immutable previewHash before applying configuration changes or starting the engine:

{
  "mcpServers": {
    "polmexbot": {
      "command": "npx",
      "args": ["-y", "github:PolmexBot/polmexbot-mcp"],
      "env": {
        "POLMEXBOT_BASE_URL": "https://www.polmexbot.xyz",
        "POLMEXBOT_TOKEN": "your-account-bearer-token",
        "POLMEXBOT_ENABLE_CONTROLS": "true",
        "POLMEXBOT_APPROVAL_TOKEN": "owner-created-approval-secret"
      }
    }
  }
}
  1. Call preview_config and show the owner the exact diff.

  2. Call apply_config with the unchanged previewHash and owner approvalToken.

  3. Call preview_config with {} and then start_bot with the fresh previewHash + approvalToken (requires a passing check_readiness).

  4. Call stop_bot at any time without an approval token (stops new activity; does not sell open positions).

3. Autonomous Mode (Dedicated Wallet Key)

For trusted autonomous agents managing a dedicated, limited-funds Polygon wallet:

{
  "mcpServers": {
    "polmexbot": {
      "command": "npx",
      "args": ["-y", "github:PolmexBot/polmexbot-mcp"],
      "env": {
        "POLMEXBOT_BASE_URL": "https://www.polmexbot.xyz",
        "POLMEXBOT_AUTONOMOUS": "true"
      }
    }
  }
}
  1. Call connect_wallet with privateKey (optional developerAddress is derived automatically for Polymarket deposit/proxy wallets). Neither key nor bearer token is returned in tool results.

  2. Call check_readiness and preview_config.

  3. Call apply_config with the unchanged previewHash, then an empty preview_config → start_bot.

  4. Confirm live execution via get_bot_state, get_positions, get_trades, and get_logs.

4. Direct EOA Mode (No Polymarket Website Required)

If a dedicated EOA already holds pUSD (and a little POL for approval gas) on Polygon:

  1. Call connect_wallet({ privateKey, walletMode: "eoa" }) (omit developerAddress).

  2. Call prepare_eoa_wallet({ approve: false }) to inspect pUSD, POL, Exchange V2 allowance, cap, and estimated gas without broadcasting.

  3. If allowance is required, call prepare_eoa_wallet({ approve: true }) to broadcast a capped pUSD approval.

  4. Proceed with check_readiness → preview_config → apply_config → empty preview_config → start_bot.


Available MCP Tools

Tool

Mode

Purpose

get_server_info

Read-only

Returns integration mode, active base URL, mirrors, and doc links (no auth).

get_public_prices

Read-only

Public BTC, ETH, SOL, XRP, and BNB price snapshot (no auth).

get_account

Read-only

Authenticated account, strategy config, wallet-link metadata, stats (keys redacted).

get_balance

Read-only

pUSD, USDC.e, POL, open-position value, live bankroll, warnings, restrictions.

get_bot_state

Read-only

Requested & live engine state, freshness, positions, recent trades, notices.

get_positions

Read-only

Current open positions plus engine freshness flags.

get_trades

Read-only

Up to 200 persisted resolved trades and aggregate statistics.

get_logs

Read-only

Engine activity, skips, errors, and trade-result logs.

check_readiness

Read-only

Verifies deployment, key/wallet pairing, collateral, and readiness (no tx).

preview_config

Read-only

Validates a partial config patch and returns diff, warnings, and previewHash.

connect_wallet

Autonomous

Connects a dedicated wallet key (Polymarket account or direct EOA) in memory.

prepare_eoa_wallet

Control

Inspects or sends a capped pUSD Exchange V2 approval in direct EOA mode.

apply_config

Control

Saves validated configuration after matching previewHash (+ approval if supervised).

start_bot

Control

Starts strategy execution after fresh empty preview + readiness pass.

stop_bot

Control

Stops new engine activity without approval token (does not liquidate positions).


Reference Agents & Local Development

git clone https://github.com/PolmexBot/polmexbot-mcp.git
cd polmexbot-mcp
npm install
npm test

# Sandbox reference agents (zero network calls)
node examples/read-only-monitor.mjs --sandbox
node examples/supervised-agent.mjs --sandbox
node examples/supervised-agent.mjs --sandbox --approve
node examples/autonomous-agent.mjs --sandbox
node examples/autonomous-agent.mjs --sandbox --eoa
node examples/alert-agent.mjs --sandbox

Security

  • Always use a dedicated, limited-funds wallet for automated trading.

  • Never place private keys or bearer tokens in prompts, command-line arguments, or source control.

  • Protect MCP client logs, as some clients record tool call arguments.

  • Never use Hardhat/Anvil/example test keys in live mode.

  • Stopping the bot disables new trades; it does not liquidate existing open positions.

License

MIT

Available Tools

14 tools
apply_configApply an approved strategy changeA
DestructiveIdempotent

Saves real strategy configuration. First call preview_config and show the owner the exact diff. Requires the owner-provided approvalToken and the unchanged previewHash.

Inputs: patch (required), previewHash (required), approvalToken (required).

check_readinessCheck trading readinessA
Read-onlyIdempotent

Verifies wallet deployment, key/developer-address pairing, collateral, and trading readiness without submitting a transaction or starting the bot.

Inputs: no named parameters.

get_accountGet account and configurationA
Read-onlyIdempotent

Gets the authenticated account, current strategy configuration, wallet-link metadata, recent trades, and statistics. Private keys are redacted by the API.

Inputs: no named parameters.

get_balanceGet wallet balanceB
Read-onlyIdempotent

Gets pUSD, USDC.e, POL, open-position value, live bankroll, deployment, wallet-link warnings, and restrictions.

Inputs: no named parameters.

get_bot_stateGet engine stateA
Read-onlyIdempotent

Gets requested and actual engine state, freshness, open positions, recent trades, notices, and statistics.

Inputs: no named parameters.

get_logsGet activity logsB
Read-onlyIdempotent

Gets engine activity, skips, errors, and durable trade-result logs.

Inputs: no named parameters.

get_positionsGet open positionsA
Read-onlyIdempotent

Gets open positions from the current engine state. An empty array does not prove the wallet is flat if the engine state is stale; inspect get_bot_state and Polymarket before reporting.

Inputs: no named parameters.

get_public_pricesGet public crypto pricesA
Read-onlyIdempotent

Gets the current public BTC, ETH, SOL, XRP, and BNB price snapshot. No account credentials required.

Inputs: no named parameters.

get_server_infoGet Polmexbot integration informationA
Read-onlyIdempotent

Returns integration mode, documentation links, and whether control tools are enabled. No credentials required.

Inputs: no named parameters.

get_tradesGet persisted tradesA
Read-onlyIdempotent

Gets up to 200 persisted resolved trades and all-time aggregate statistics.

Inputs: no named parameters.

prepare_eoa_walletCheck or approve direct EOA collateralA
DestructiveIdempotent

For an account connected with walletMode=eoa. Reads pUSD, POL, estimated approval gas, and the pUSD allowance to Polymarket Exchange V2. approve=false sends no transaction. approve=true explicitly broadcasts a capped pUSD approval from the user EOA; it never wraps, swaps, or starts the bot.

Inputs: approve, amountUsd, approvalToken.

preview_configPreview and validate a strategy changeA
Read-onlyIdempotent

Read-only. Merges a partial strategy patch with the current configuration, validates keys, ranges, affordability, and cross-field rules, and returns the exact diff plus a previewHash required for apply_config or start_bot. No settings are saved.

Inputs: patch (required).

start_botStart the real trading engineA
DestructiveIdempotent

Starts real Polymarket strategy execution after a fresh configuration preview, readiness check, and owner approval. There is no arbitrary buy/sell tool. Requires approvalToken and a previewHash from preview_config with an empty patch.

Inputs: previewHash (required), approvalToken (required).

stop_botStop new bot activityA
DestructiveIdempotent

Stops new strategy activity without requiring an approval token. This does not sell existing positions or guarantee immediate cancellation of already-submitted activity.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have clear distinct purposes, but the read-side cluster (get_account, get_balance, get_bot_state, get_trades, get_positions) overlaps heavily, since several return positions, trades, and statistics from different sources. The descriptions do explain the difference (persisted trades vs live engine state vs staleness caveat), so an agent can reason it out, but it takes careful reading.

    Naming Consistency5/5

    All 14 tools use snake_case verb-first names (get_*, check_*, start_*, stop_*, preview_*, prepare_*, apply_*), forming a predictable pattern. There are no mixed conventions or cryptic abbreviations beyond the standard 'eoa' qualifier.

    Tool Count5/5

    At 14 tools the surface is well within the ideal range and each tool maps to a real operation (read state, validate config, mutate config, lifecycle control, wallet prep). Nothing appears to be filler, and the read tools, while numerous, correspond to genuinely different data sources.

    Completeness3/5

    The control loop is covered (preview -> apply -> readiness -> start/stop), but there is no path to exit or manage existing positions, no order cancellation or inspection, and stop_bot explicitly does not sell. The absence of any sell/close tool is a deliberate safety design, yet it leaves a notable dead end for an agent asked to unwind exposure.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools including market discovery, real-time monitoring, portfolio management, and AI-powered trading recommendations with enterprise-grade safety features.
      25
      755
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools covering market discovery, analysis, trading execution, portfolio management, and real-time monitoring with enterprise-grade safety features.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 tools, real-time WebSocket monitoring, and enterprise-grade safety features.
      MIT