Skip to main content
Glama
traderalvin1

Polymarket MCP Server

by traderalvin1

πŸ“Š Polymarket MCP Server

License: MIT

πŸ“– Overview

The Polymarket MCP Server enables AI agents to interact with Polymarket, a prediction market platform on Polygon. This server provides read-only access to market data (Gamma API), real-time pricing and order books (CLOB public API), public user data (Data API), comments/profiles, and bridge quotes/status.

By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to discover prediction markets, analyze odds (probabilities), and monitor positions or activity from public data sources.

✨ Features

  • Market Discovery: Search and filter prediction markets by keywords, tags, status, and events.

  • Real-time Pricing: Access live price data, implied probabilities, and order books for any outcome token.

  • Public Portfolio Data: Monitor positions, trade history, and activity for specific wallet addresses (public Data API).

  • Comments & Profiles: Retrieve public profiles and market/event comments.

  • Realtime Subscriptions: Subscribe to price, orderbook, and resolution updates.

  • Bridge Utilities: Fetch supported assets and bridge quotes/status.

πŸ“¦ Installation

πŸ”§ Build from Source

git clone https://github.com/traderalvin1/polymarket-mcp.git cd polymarket-mcp pnpm install pnpm run build

⚑ Running with an MCP Client

Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json).

πŸ“‹ Minimal Configuration (Read-Only)

{ "mcpServers": { "polymarket": { "command": "node", "args": ["/path/to/polymarket-mcp/dist/index.js"] } } }

πŸ” Configuration (Environment Variables)

Variable

Required

Description

Default

CLOB_API_BASE

No

Polymarket CLOB API base URL

https://clob.polymarket.com

CHAIN_ID

No

Blockchain network chain ID

137 (Polygon)

GAMMA_API_URL

No

Polymarket Gamma API base URL

https://gamma-api.polymarket.com

DATA_API_URL

No

Polymarket Data API base URL

https://data-api.polymarket.com

BRIDGE_API_URL

No

Polymarket Bridge API base URL

https://bridge.polymarket.com

πŸ’‘ Usage Examples

πŸ” Market Discovery

  • "What are the most active prediction markets on Polymarket right now?"

  • "Search for markets related to 'Bitcoin' or 'BTC'."

  • "Find markets in the 'Crypto' category."

  • "What events are trending on Polymarket today?"

πŸ“Š Analytics & Pricing

  • "Show me the order book for the 2024 election market."

  • "What is the current probability implied by the price of the 'Yes' token?"

  • "Get detailed information about the 'will-trump-win-2024' market."

πŸ’Ό Portfolio & Trading (Requires Private Key)

  • "What's my current USDC balance and allowance?"

  • "Show me all my open orders across all markets."

  • "Place a buy order for 100 shares at 0.65 price."

  • "Cancel all my open orders on this market."

πŸ› οΈ MCP Tools

Full tool documentation is maintained in:

  • TOOLS_REFERENCE.md β€” complete tool list, parameters, dependencies, edge cases

  • USAGE_EXAMPLES.md β€” workflows and example calls

For agents, call get_tool_guide to get a concise, runtime usage guide.

πŸ™ Credits

This project is based on and modified from:

πŸ‘¨β€πŸ’» Development

πŸ—οΈ Build Project

pnpm run build

πŸ‘οΈ Development Mode (Watch)

pnpm run watch

βœ… Linting & Formatting

pnpm run lint pnpm run format

πŸ“ Project Structure

  • src/tools/: Individual tool definitions

  • src/services/: API client and business logic

  • src/index.ts: Server entry point

πŸ“š Resources

⚠️ Disclaimer

This project is an unofficial tool and is not directly affiliated with Polymarket. It interacts with financial and prediction market data. Users should exercise caution and verify all data independently. Trading in prediction markets involves risk.

πŸ“„ License

MIT

Latest Blog Posts

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/traderalvin1/polymarket-mcp'

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