https://github.com/carlosibcu/polymarket-mcp
Model Context Protocol server for Polymarket CLOB โ FastAPI, Docker-ready, LLM-tool compatible
https://github.com/carlosibcu/polymarket-mcp
ai api clob continue-vscode crypto cursor defi docker fastapi github-copilot-chat jetbrains-ai-assistant llm-tools mcp model-context-protocol openai-assistants-api plugin polymarket prediction-markets python server
Last synced: about 1 month ago
JSON representation
Model Context Protocol server for Polymarket CLOB โ FastAPI, Docker-ready, LLM-tool compatible
- Host: GitHub
- URL: https://github.com/carlosibcu/polymarket-mcp
- Owner: CarlosIbCu
- License: other
- Created: 2025-06-16T10:21:03.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-02T12:06:45.000Z (12 months ago)
- Last Synced: 2025-07-02T12:28:57.114Z (12 months ago)
- Topics: ai, api, clob, continue-vscode, crypto, cursor, defi, docker, fastapi, github-copilot-chat, jetbrains-ai-assistant, llm-tools, mcp, model-context-protocol, openai-assistants-api, plugin, polymarket, prediction-markets, python, server
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Polymarket MCP Server
A **Model Context Protocol (MCP)** compliant server that exposes the public Polymarket Central Limit Order Book (CLOB) REST API as tools that any LLM-powered IDE or agent can invoke. Compatible with **Cursor**, **Continue** (VS Code), **GitHub Copilot Chat**, **JetBrains AI Assistant**, **OpenAI ChatGPT (Assistants API)**, **Smithery** and any other MCP-aware interface.
---
## โจ Features
* ๐ช **Universal MCP Support** โ works with Cursor, Continue, Copilot, JetBrains AI, Smithery and more
* โก **Python implementation** โ using native MCP protocol with async support
* ๐ **Essential endpoints out-of-the-box** โ list markets, fetch single market details and more
* ๐ **Stateless & no auth required** โ queries Polymarket's public REST endpoints; no keys needed
* ๐ณ **Docker-ready** โ ship & deploy anywhere in seconds
* ๐ **MIT licensed** โ free for personal and commercial use
---
## ๐ Quick Start
### Local Development
```bash
# Clone the repository
git clone https://github.com/CarlosIbCu/polymarket-mcp.git
cd polymarket-mcp
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m polymarket_mcp.main
```
### Testing with MCP Inspector
You can test the server using the official MCP Inspector:
```bash
# Install and run the MCP Inspector
npx @modelcontextprotocol/inspector python -m polymarket_mcp.main
```
This will:
1. Start the MCP server
2. Launch the inspector web interface
3. Provide a URL to access the inspector (usually http://localhost:6274)
The inspector allows you to:
- View available MCP tools
- Test tool calls interactively
- Inspect server capabilities
- Debug MCP protocol messages
### Docker Deployment
```bash
# Build the image
docker build -t polymarket-mcp .
# Run the container
docker run -p 3333:3333 polymarket-mcp
```
### Smithery Deployment
This server is ready for deployment on [Smithery](https://smithery.ai), the MCP hosting platform:
1. Fork/clone this repository
2. Connect your GitHub account to Smithery
3. Select this repository and choose "Custom Deploy"
4. Smithery will automatically detect the configuration and deploy
The `smithery.yaml` configuration includes:
- Container runtime settings
- Server configuration options
- Health checks
- Tool schemas
## ๐ Available Tools
### `list_markets`
List available prediction markets with optional limit parameter.
**Parameters:**
- `limit` (integer, optional): Maximum number of markets to return (default: 10)
**Example:**
```json
{
"limit": 5
}
```
### `get_market`
Fetch detailed information about a specific market.
**Parameters:**
- `market_id` (string, required): Market ID to fetch
**Example:**
```json
{
"market_id": "0x9deb0baac40648821f96f01339229a422e2f5c877de55dc4dbf981f95a1e709c"
}
```
## ๐ง Configuration
Server configuration is handled via environment variables or Smithery config:
```yaml
server:
host: "0.0.0.0" # Server host
port: 3333 # Server port
timeout: 30 # Request timeout in seconds
```
## ๐ API Documentation
- **MCP Inspector**: Use `npx @modelcontextprotocol/inspector` for interactive testing
- **Polymarket API Docs**: [Official Documentation](https://docs.polymarket.com)
## ๐งช Testing
```bash
# Test the Polymarket API connectivity
python test_server.py
# Run with MCP Inspector for interactive testing
npx @modelcontextprotocol/inspector python -m polymarket_mcp.main
```
## ๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## ๐ License
This project is MIT licensed. See the [LICENSE](LICENSE) file for details.
---