Get the FREE Ultimate OpenClaw Setup Guide →

mcp-polymarket

MCP server for interacting with polymarket

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio iqaicom-mcp-polymarket npx -y @iqai/mcp-polymarket \
  --env POLYMARKET_RPC_URL="https://polygon-mainnet.g.alchemy.com/v2/<YOUR_KEY>" \
  --env POLYMARKET_PRIVATE_KEY="your_private_key_here"

How to use

The Polymarket MCP Server provides LLM-friendly access to Polymarket data and trading capabilities. It exposes a set of MCP tools that let you discover markets, view real-time pricing and order books, place trades (when a private key is provided), and track your portfolio and trading history. With MCP-compliant tooling, you can query market details by slug or tag, fetch pricing and depth data, and manage orders across markets. The server is designed to be driven from your MCP client configuration so AI agents can reason about markets and execute actions in a controlled manner. The included tools cover discovery, pricing analytics, trading operations, and portfolio insights, enabling a wide range of decision-support and automation flows.

Typical usage involves running the server via npx or from source, then configuring your MCP client to connect to the server with appropriate environment variables if you plan to enable trading. For read-only exploration you can operate without a private key, while enabling trading requires you to supply private keys and RPC endpoints in the client configuration. The server also exposes helper endpoints to fetch market details by slug, list active markets, and retrieve order books for outcomes.

Examples of capabilities include: discovering markets relevant to a topic (e.g., Bitcoin or Crypto), inspecting the current implied probabilities and order book depth for specific markets, retrieving positions and trade histories for a wallet, and submitting buy/sell orders when trading is enabled in the client configuration.

How to install

Prerequisites:

  • Node.js (with npm) installed on your machine
  • internet access to download packages from npm
  • Optional: pnpm if you prefer using the build steps provided by the repository

From npm (recommended for quick start):

  1. Ensure Node.js and npm are installed
  2. Install and run the MCP server directly with npx (no local install required)

From source (build from repo):

  1. Install Git if you haven’t already
  2. Clone the repository
  3. Install dependencies using pnpm (or npm/yarn):
git clone https://github.com/IQAIcom/mcp-polymarket.git
cd mcp-polymarket
pnpm install
  1. Build the project (if the repository provides a build step):
pnpm run build
  1. Run the server locally (if applicable in your environment):
pnpm start
  1. If you plan to use via npx without local install, you can skip the build step and run directly:
npx @iqai/mcp-polymarket

Note: When using trading features, you will need to supply a private key and a Polygon RPC URL in your MCP client configuration or as environment variables in the runtime context, as shown in the examples.

Additional notes

Environment variables: POLYMARKET_PRIVATE_KEY enables trading; POLYMARKET_RPC_URL specifies the Polygon RPC endpoint. If you do not provide a private key, trading features will be disabled. The default Polygon RPC endpoint is polygon-rpc.com, but you can replace it with your preferred provider (e.g., Alchemy, Infura). The CLOB API base defaults to https://clob.polymarket.com, and CHAIN_ID defaults to 137 for Polygon. Ensure your private key and RPC URL are kept secure and not exposed in shared environments. When using MCP, you can run in read-only mode and still perform market discovery, pricing queries, and data fetches without enabling private keys.

Related MCP Servers

Sponsor this space

Reach thousands of developers