The PolyMarket MCP server provides access to prediction market data through a standardized interface. It allows you to retrieve real-time market information, prices, and historical data from PolyMarket's prediction markets, making it easy to integrate prediction market insights into your applications.
The easiest way to install the PolyMarket MCP server for Claude Desktop is through Smithery:
npx -y @smithery/cli install polymarket_mcp --client claude
To configure the server manually for Claude Desktop, edit the configuration file:
~/Library/Application\ Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the following to your configuration:
"mcpServers": {
"polymarket-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp",
"run",
"polymarket-mcp"
],
"env": {
"KEY": "<insert poly market api key>",
"FUNDER": "<insert polymarket wallet address>"
}
}
}
uv pip install -e .
.env
file with your credentials:Key=your_api_key_here
Funder=poly market wallet address
After installation, you can run the server directly:
uv run src/polymarket_mcp/server.py
If you want to run the server with the inspector:
npx @modelcontextprotocol/inspector uv --directory C:\\Users\\{INSERT_USER}\\YOUR\\PATH\\TO\\polymarket-mcp run src/polymarket_mcp/server.py
The PolyMarket MCP server provides four main tools for accessing prediction market data:
Retrieves detailed information about a specific prediction market.
Input Schema:
{
"market_id": {
"type": "string",
"description": "Market ID or slug"
}
}
Example Response:
Title: Example Market
Category: Politics
Status: Open
Resolution Date: 2024-12-31
Volume: $1,234,567.89
Liquidity: $98,765.43
Description: This is an example prediction market...
---
Lists available prediction markets with filtering options.
Input Schema:
{
"status": {
"type": "string",
"description": "Filter by market status",
"enum": ["open", "closed", "resolved"]
},
"limit": {
"type": "integer",
"description": "Number of markets to return",
"default": 10,
"minimum": 1,
"maximum": 100
},
"offset": {
"type": "integer",
"description": "Number of markets to skip (for pagination)",
"default": 0,
"minimum": 0
}
}
Example Response:
Available Markets:
ID: market-123
Title: US Presidential Election 2024
Status: Open
Volume: $1,234,567.89
---
ID: market-124
Title: Oscar Best Picture 2024
Status: Open
Volume: $234,567.89
---
Retrieves current prices and trading information for a market.
Input Schema:
{
"market_id": {
"type": "string",
"description": "Market ID or slug"
}
}
Example Response:
Current Market Prices for US Presidential Election 2024
Outcome: Democratic
Price: $0.6500
Probability: 65.0%
---
Outcome: Republican
Price: $0.3500
Probability: 35.0%
---
Retrieves historical price and volume data for a market.
Input Schema:
{
"market_id": {
"type": "string",
"description": "Market ID or slug"
},
"timeframe": {
"type": "string",
"description": "Time period for historical data",
"enum": ["1d", "7d", "30d", "all"],
"default": "7d"
}
}
Example Response:
Historical Data for US Presidential Election 2024
Time Period: 7d
Time: 2024-01-20T12:00:00Z
Price: $0.6500
Volume: $123,456.78
---
Time: 2024-01-19T12:00:00Z
Price: $0.6300
Volume: $98,765.43
---
The server includes comprehensive error handling for various scenarios:
All error messages are returned in a clear, human-readable format to help troubleshoot any issues.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "polymarket-mcp" '{"command":"uv","args":["run","src/polymarket_mcp/server.py"],"env":{"KEY":"<insert poly market api key>","FUNDER":"<insert polymarket wallet address>"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"polymarket-mcp": {
"command": "uv",
"args": [
"run",
"src/polymarket_mcp/server.py"
],
"env": {
"KEY": "<insert poly market api key>",
"FUNDER": "<insert polymarket wallet address>"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"polymarket-mcp": {
"command": "uv",
"args": [
"run",
"src/polymarket_mcp/server.py"
],
"env": {
"KEY": "<insert poly market api key>",
"FUNDER": "<insert polymarket wallet address>"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect