Skip to main content

Polymarket MCP

MCP 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.

Tools

Tool Description
search_markets Search markets by title or description
get_market_details Full details for a single market (by slug or Polymarket URL)
get_user_positions Open positions for a wallet address
get_user_performance Portfolio value, P&L, volume, and leaderboard rank

All tools return markdown formatted for agent consumption. No API keys or wallet signing are required.

Requirements

  • Python 3.12+
  • uv (recommended) or Docker

Quick start

Clone the repo, install dependencies, and start the server:

git clone https://github.com/0xChron/polymarket-mcp.git
cd polymarket-mcp
uv sync
make run

The server listens on streamable HTTP at http://127.0.0.1:8000/mcp.

Verify it is running with the MCP Inspector:

make inspector

Connect the inspector to http://localhost:8000/mcp using the Streamable HTTP transport.

Connect from an MCP client

This server uses the streamable-http transport (not stdio). Start the server first, then point your client at the /mcp endpoint.

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project-scoped):

{
  "mcpServers": {
    "polymarket": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Restart Cursor (or reload the window) after saving. The server must be running before the client connects.

Claude Desktop / other HTTP clients

Any MCP client that supports streamable HTTP can connect to the same URL. Refer to your client's documentation for remote server configuration.

Example agent prompts

Once connected, an agent can call tools naturally:

Docker

Build and run the container:

make build
docker run --rm -p 8000:8000 -e FASTMCP_HOST=0.0.0.0 polymarket-mcp

FASTMCP_HOST=0.0.0.0 is required so the server accepts connections from outside the container. Then connect your MCP client to http://localhost:8000/mcp.

Configuration

Optional environment variables override API endpoints and server settings:

Variable Default Description
GAMMA_URL https://gamma-api.polymarket.com Gamma API base URL
DATA_URL https://data-api.polymarket.com Data API base URL
DEFAULT_TIMEOUT 15 HTTP request timeout (seconds)
FASTMCP_HOST 127.0.0.1 Bind address (0.0.0.0 for Docker)
FASTMCP_PORT 8000 Listen port

Development

make run        # Start the server
make test       # Run tests
make inspector  # Open MCP Inspector
make build      # Build Docker image

See docs/PROJECT_KNOWLEDGE_BASE.md for architecture, conventions, and how to add new tools.

License

MIT — see LICENSE.

Release files for 0xchron-polymarket-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for 0xchron-polymarket-mcp 0.1.1
File Size Uploaded
0xchron_polymarket_mcp-0.1.1.tar.gz 45.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for 0xchron-polymarket-mcp 0.1.1
File Interpreter ABI Platform
0xchron_polymarket_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 53.3 kB

Release files / 0xchron_polymarket_mcp-0.1.1.tar.gz

Download URL 0xchron_polymarket_mcp-0.1.1.tar.gz
Size 45.9 kB
Tags Source
SHA-256 checksum
How to use checksums
effb35f386d384fa02727d760c03492bcd7203967a359653b06901ad7a55fa9c
BLAKE2b-256 checksum
How to use checksums
8b9fff9422ffc26edee846ad1e004e2a2ef02bda1bfbadfb6c40778e2bf5b3ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / 0xchron_polymarket_mcp-0.1.1-py3-none-any.whl

Download URL 0xchron_polymarket_mcp-0.1.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6985f03d8f9c60887ae222f848626f569a96028b6f99bb8ab385e7dc57cf2f4a
BLAKE2b-256 checksum
How to use checksums
62afc469090f965b9a6870c837ef0709f0ae229b64fdd5be53eeef8ae635ce3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page