{
  "markdown": "# Polymarket MCP\n\nMCP server that exposes read-only Polymarket prediction market data to AI agents. Tools wrap Polymarket's public **Gamma** (market discovery) and **Data** (positions, portfolio, leaderboard) APIs. There is no CLOB integration — this server cannot place trades or read order books.\n\n<!-- mcp-name: io.github.0xChron/polymarket-mcp -->\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `search_markets` | Search markets by title or description |\n| `get_market_details` | Full details for a single market (by slug or Polymarket URL) |\n| `get_trending_markets` | Trending events ranked by volume, liquidity, or competitiveness |\n| `get_market_holders` | Top holders per outcome for a market (by condition ID, slug, or URL) |\n| `get_leaderboard` | Top traders ranked by P&L or volume |\n| `get_user_positions` | Open positions for a wallet address |\n| `get_user_performance` | Portfolio value, P&L, volume, and leaderboard rank for one wallet |\n\nAll tools return markdown formatted for agent consumption. No API keys or wallet signing are required.\n\n## Resources\n\nStatic reference context (no API calls). Attach in MCP clients or read via Inspector.\n\n| URI | Description |\n|-----|-------------|\n| `polymarket://glossary` | Event, market, slug, conditionId, and wallet terminology |\n| `polymarket://categories` | Leaderboard categories, time periods, and tag slugs |\n| `polymarket://tool-guide` | When to use each tool and chaining workflows |\n\n## Prompts\n\nUser-triggered workflow templates that orchestrate tools:\n\n| Prompt | Description |\n|--------|-------------|\n| `research_market` | Market details → holders → research summary (`slug` or `market_link`) |\n| `compare_traders` | Side-by-side performance and positions for two wallets |\n| `scan_trending` | Trending events scan with optional `tag_slug` and `limit` |\n\n## Requirements\n\n- Python 3.12+\n- [uv](https://docs.astral.sh/uv/) (recommended) or Docker\n- [Node.js](https://nodejs.org/) (optional, only for MCP Inspector)\n\n## Quick start\n\nThis server uses **streamable HTTP** at `http://127.0.0.1:8000/mcp`. Start the server first, then connect your MCP client to that URL.\n\n```bash\ngit clone https://github.com/0xChron/polymarket-mcp.git\ncd polymarket-mcp\nuv sync\nuv run polymarket-mcp\n```\n\nOn Windows, use the same commands in **PowerShell**, **Command Prompt**, or **Git Bash**. Leave the terminal open while your MCP client is connected.\n\n### Docker\n\nWorks the same on all platforms if Docker Desktop is installed:\n\n```bash\ngit clone https://github.com/0xChron/polymarket-mcp.git\ncd polymarket-mcp\ndocker build -t polymarket-mcp .\ndocker run --rm -p 8000:8000 -e FASTMCP_HOST=0.0.0.0 polymarket-mcp\n```\n\n`FASTMCP_HOST=0.0.0.0` lets the server accept connections from outside the container.\n\n### Verify the server\n\nOpen [MCP Inspector](https://github.com/modelcontextprotocol/inspector) in another terminal:\n\n```bash\nnpx -y @modelcontextprotocol/inspector\n```\n\nConnect to `http://localhost:8000/mcp` using the **Streamable HTTP** transport.\n\n## Connect from an MCP client\n\nThis server uses the **streamable-http** transport (not stdio). **Start the server first** (see [Quick start](#quick-start)), then add the config below to your MCP client.\n\n### Claude Desktop\n\nGo to **Claude → Settings → Developer → Edit Config** to open `claude_desktop_config.json`, then include the following:\n\n```json\n{\n  \"mcpServers\": {\n    \"polymarket\": {\n      \"url\": \"http://localhost:8000/mcp\"\n    }\n  }\n}\n```\n\nIf you already have other MCP servers configured, add the `\"polymarket\"` entry inside your existing `mcpServers` object instead of replacing the whole file.\n\nConfig file location if you prefer to edit it manually:\n\n| Platform | Path |\n|----------|------|\n| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |\n| Windows | `%APPDATA%\\Claude\\claude_desktop_config.json` |\n\nSave the file and **fully quit and restart Claude Desktop**. The server must be running in a terminal before you start a new chat.\n\n### Cursor\n\nGo to **Settings → Tools & MCP → New MCP Server** to open `~/.cursor/mcp.json` (Windows: `%USERPROFILE%\\.cursor\\mcp.json`), then add the same `polymarket` entry:\n\n```json\n{\n  \"mcpServers\": {\n    \"polymarket\": {\n      \"url\": \"http://localhost:8000/mcp\"\n    }\n  }\n}\n```\n\nRestart Cursor after saving.\n\n### Example agent prompts\n\nOnce connected, an agent can call tools naturally:\n\n- \"Search Polymarket for active markets about Bitcoin ETFs\"\n- \"What are the trending markets right now?\"\n- \"Who are the top holders of the Trump election market?\"\n- \"Show the all-time P&L leaderboard for crypto traders\"\n- \"Get details for https://polymarket.com/event/will-bitcoin-hit-100k\"\n- \"Show open positions for wallet `0x…`\"\n- \"What is the all-time P&L and leaderboard rank for `0x…`?\"\n\nIn MCP Inspector, try the **Prompts** tab (e.g. `research_market`) or read **Resources** for the glossary and tool guide.\n\n## Configuration\n\nOptional environment variables override API endpoints and server settings.\n\n**macOS / Linux / Git Bash**\n\n```bash\nexport FASTMCP_HOST=0.0.0.0\nexport FASTMCP_PORT=8000\nuv run polymarket-mcp\n```\n\n**Windows (PowerShell)**\n\n```powershell\n$env:FASTMCP_HOST = \"0.0.0.0\"\n$env:FASTMCP_PORT = \"8000\"\nuv run polymarket-mcp\n```\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `GAMMA_URL` | `https://gamma-api.polymarket.com` | Gamma API base URL |\n| `DATA_URL` | `https://data-api.polymarket.com` | Data API base URL |\n| `DEFAULT_TIMEOUT` | `15` | HTTP request timeout (seconds) |\n| `FASTMCP_HOST` | `127.0.0.1` | Bind address (`0.0.0.0` for Docker) |\n| `FASTMCP_PORT` | `8000` | Listen port |\n\n## Development\n\n```bash\nuv run polymarket-mcp          # Start the server\nuv run pytest                  # Run tests\nnpx -y @modelcontextprotocol/inspector   # Open MCP Inspector\ndocker build -t polymarket-mcp .         # Build Docker image\n```\n\nOn macOS/Linux, `make run`, `make test`, and similar shortcuts in the [Makefile](Makefile) wrap the same commands.\n\nSee [`docs/PROJECT_KNOWLEDGE_BASE.md`](docs/PROJECT_KNOWLEDGE_BASE.md) for architecture, conventions, and how to add new tools.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 6170,
  "sha": "80787e52a46ae543a145986cf94e3e747d501391796569dfef84af69112c6b15",
  "repo_slug": "0xchron/polymarket-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_0xchron_polymarket_mcp_1a62f976/readme"
}