Skip to main content
Glama

Polymarket MCP Server

.env.exampleโ€ข3.96 kB
# Polymarket MCP Server Configuration # Copy this file to .env and fill in your values # ============================================================================ # DEMO MODE - Run without real wallet credentials (read-only) # ============================================================================ # Set to true for read-only access without needing a wallet # Perfect for testing market discovery, analysis, and monitoring features # Trading functions will be disabled in DEMO mode # # When DEMO_MODE=true, you don't need to provide: # - POLYGON_PRIVATE_KEY # - POLYGON_ADDRESS # # The system will use safe demo values automatically. DEMO_MODE=false # ============================================================================ # Polygon Wallet Configuration (REQUIRED unless DEMO_MODE=true) # ============================================================================ # Your Polygon wallet private key (without 0x prefix) # Get from: MetaMask > Settings > Security > Export Private Key # IMPORTANT: Keep this secret! Never commit to git or share publicly POLYGON_PRIVATE_KEY=your_private_key_here # Your Polygon wallet address (with 0x prefix) # Get from: Your wallet's public address POLYGON_ADDRESS=0xYourAddressHere # Polygon chain ID (137 for mainnet, 80002 for Amoy testnet) POLYMARKET_CHAIN_ID=137 # ============================================================================ # Polymarket API Credentials (OPTIONAL - auto-created if not provided) # ============================================================================ # L2 API key for authenticated requests # Leave empty to auto-generate on first run # Or get from: https://polymarket.com/settings/api POLYMARKET_API_KEY= POLYMARKET_PASSPHRASE= POLYMARKET_API_KEY_NAME= # ============================================================================ # Safety Limits - Risk Management # ============================================================================ # Maximum size for a single order in USD MAX_ORDER_SIZE_USD=1000 # Maximum total exposure across all positions in USD MAX_TOTAL_EXPOSURE_USD=5000 # Maximum position size per market in USD MAX_POSITION_SIZE_PER_MARKET=2000 # Minimum liquidity required in market before trading (USD) MIN_LIQUIDITY_REQUIRED=10000 # Maximum spread tolerance (0.05 = 5%) MAX_SPREAD_TOLERANCE=0.05 # ============================================================================ # Trading Controls # ============================================================================ # Enable autonomous trading without confirmation # WARNING: Use with caution! Set to false for manual approval ENABLE_AUTONOMOUS_TRADING=true # Require user confirmation for orders above this USD amount REQUIRE_CONFIRMATION_ABOVE_USD=500 # Automatically cancel orders if spread exceeds MAX_SPREAD_TOLERANCE AUTO_CANCEL_ON_LARGE_SPREAD=true # ============================================================================ # API Endpoints (OPTIONAL - uses defaults if not set) # ============================================================================ # Polymarket CLOB API endpoint CLOB_API_URL=https://clob.polymarket.com # Gamma API endpoint for market data GAMMA_API_URL=https://gamma-api.polymarket.com # ============================================================================ # Logging # ============================================================================ # Log level: DEBUG, INFO, WARNING, ERROR LOG_LEVEL=INFO # ============================================================================ # Advanced Configuration (typically no changes needed) # ============================================================================ # USDC token address on Polygon USDC_ADDRESS=0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 # CTF Exchange contract address CTF_EXCHANGE_ADDRESS=0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E # Conditional Token contract address CONDITIONAL_TOKEN_ADDRESS=0x4D97DCd97eC945f40cF65F87097ACe5EA0476045

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/caiovicentino/polymarket-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server