SuperAPIAI Directory

polymarket-agent-mcp

github.com · AI agents

Polymarket trading tools: direct and copy trading, smart money detection, backtesting, arbitrage scanning, portfolio optimization and live price streaming.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Purpose

polymarket-agent-mcp is an MCP (Model Context Protocol) server for the Polymarket prediction market, with the goal of letting users complete trading, analysis, and automation operations through an AI assistant. It provides 48 tools, covering direct trading, market discovery, smart money tracking, copy trading, backtesting, risk management, and portfolio optimization. It can be used with Claude Code, Cursor, or any MCP-compatible client.

Main Capabilities

Tool capabilities include: direct trading, market discovery, smart money tracking, copy trading, backtesting, risk management, and portfolio optimization. It also supports real-time price streams (receiving public Polymarket price updates via WebSocket).

Users can issue instructions to the AI assistant in natural language, for example:

  • "What are the trending markets today?"
  • "Search for bitcoin prediction markets"
  • "Buy $5 on this market"
  • "Score this trader — should I copy them?"
  • "Backtest this trader with $10 per trade"
  • "Show smart money flow — what are the top traders buying?"
  • "Set stop-loss at 0.30 on my BTC position"
  • "Optimize my portfolio with a balanced strategy"
  • "Scan for arbitrage opportunities"
  • "Compare these two markets side by side"

Usage

Claude Code Configuration

Add the configuration to ~/.claude/settings.json (the specific JSON content is not provided in the materials).

stdio Mode

Recommended for most users: npx polymarket-agent-mcp, or use the above Claude Code configuration to get a fully isolated, local-only instance.

HTTP Mode

HTTP transport accepts an optional bearer token, controlled by an environment variable (the variable name is documented in PERMISSIONS.md). When set, clients must send Authorization: Bearer <token> when requesting /mcp; when not set, the endpoint is open (only suitable for local or private networks).

Docker Deployment

Each release publishes a prebuilt multi-architecture image to GHCR, and you can also build it yourself using the Dockerfile included in the repository. DB_PATH (default /app/data/copytrader.db) controls where SQLite data is persisted, and mounting a volume preserves data across restarts.

Deployment Model

This server is designed for single-tenant use. Each client runs its own instance, with its own SQLite database (copytrader.db), watchlist, daily budget, trade history, and monitoring loop.

Warning: Do not publicly expose the HTTP instance. The server has no per-user isolation: watchlists, positions, budgets, and background monitoring loops are shared among all connected clients. A public HTTP deployment is effectively a shared workspace, not multi-tenant SaaS. If live trading is enabled, a public endpoint could be used by any caller to drain the Polymarket wallet. Always configure the HTTP bearer-token environment variable (see PERMISSIONS.md), and place the endpoint behind a firewall, VPN, or authenticating proxy.

Security Features

  • Configurable order size limits
  • Total exposure caps
  • Per-market position limits
  • Minimum liquidity requirements
  • Maximum spread tolerance
  • Stop-loss/take-profit automation
  • Preview mode (default) — no real funds involved

Permissions and Scope

The package footprint is transparent and minimal. Full disclosure is in PERMISSIONS.md; the machine-readable version is at .well-known/mcp/server-card.json.

WebSocket scope: The WSS connection to Polymarket is only used to receive public price updates and is an inbound connection. It does not transmit wallets, credentials, or user identity, and the public data stream it carries is the same as what any browser client can obtain.

Secrets scope: Each secret environment variable is kept only in memory, never logged, neverPersistent, and sent only to a single host (see SECURITY.md). All secrets remain in memory for the process lifetime — they are not written to a database, logs, or disk, and are transmitted only over HTTPS to their designated Polymarket API endpoints.

Applicable Scenarios

Suitable for users who want to analyze, track, and trade Polymarket prediction markets through an AI assistant, including scenarios requiring copy trading, backtesting, arbitrage scanning, portfolio optimization, and risk management features.

Limitations

  • Designed as single-tenant, not suitable for multi-tenant SaaS deployment.
  • Publicly exposing an HTTP instance poses security risks and may drain wallet funds.
  • The default preview mode does not involve real funds.
  • The complete authoritative list of environment variables, along with each variable's sensitivity and scope, is documented in PERMISSIONS.md and SECURITY.md (specific contents not provided in the materials).

License

MIT — see LICENSE for details. There is also a code of conduct and a security policy.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools