PolyMarket MCP Server
PolyMarket MCP サーバー
PolyMarket APIを通じて予測市場データへのアクセスを提供するモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、予測市場から市場情報、価格、履歴データを取得するための標準化されたインターフェースを実装しています。
特徴
現在の価格と確率を含むリアルタイム予測市場データ
カテゴリ、解決日、説明を含む詳細な市場情報
カスタマイズ可能な時間枠(1日、7日、30日、すべて)の過去の価格と取引量のデータ
組み込みのエラー処理とレート制限管理
簡単に消費できるクリーンなデータフォーマット
Related MCP server: Polymarket MCP Server
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop 用の PolyMarket Predictions を自動的にインストールするには:
npx -y @smithery/cli install polymarket_mcp --client claudeクロードデスクトップ
MacOSの場合:
~/Library/Application\ Support/Claude/claude_desktop_config.jsonWindows の場合:
%APPDATA%/Claude/claude_desktop_config.json
"mcpServers": {
"polymarket-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/{INSERT_USER}/YOUR/PATH/TO/polymarket-mcp",
"run",
"polymarket-mcp" //or src/polymarket_mcp/server.py
],
"env": {
"KEY": "<insert poly market api key>",
"FUNDER": "<insert polymarket wallet address"
}
}
}ローカルで実行
リポジトリをクローンし、依存関係をインストールします。
ライブラリをインストールする
uv pip install -e .ランニング
json ファイル経由で Claude クライアントを MCP ツールに接続し、パッケージをインストールすると、Claude はサーバーの mcp ツールを確認できるようになります。
以下の方法でサーバーを自分で実行できます: polymarket-mcp リポジトリ内:
uv run src/polymarket_mcp/server.py*サーバーと一緒にサーバーインスペクターを実行する場合:
npx @modelcontextprotocol/inspector uv --directory C:\\Users\\{INSERT_USER}\\YOUR\\PATH\\TO\\polymarket-mcp run src/polymarket_mcp/server.pyPolyMarket API キーを使用して
.envファイルを作成します。
Key=your_api_key_here
Funder=poly market wallet addressClaude クライアントを json ファイル経由で MCP ツールに接続した後、サーバーを実行します。alpha-vantage-mcp リポジトリで、 uv run src/polymarket_mcp/server.py実行します。
利用可能なツール
サーバーは 4 つのツールを実装します。
get-market-info: 特定の予測市場に関する詳細情報を取得するlist-markets: フィルタリングオプションを使用して利用可能な予測市場を一覧表示するget-market-prices: 現在の価格と取引情報を取得するget-market-history: 過去の価格と取引量データを取得する
市場情報を取得する
入力スキーマ:
{
"market_id": {
"type": "string",
"description": "Market ID or slug"
}
}応答例:
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...
---リスト市場
入力スキーマ:
{
"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
}
}応答例:
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
---市場価格を取得する
入力スキーマ:
{
"market_id": {
"type": "string",
"description": "Market ID or slug"
}
}応答例:
Current Market Prices for US Presidential Election 2024
Outcome: Democratic
Price: $0.6500
Probability: 65.0%
---
Outcome: Republican
Price: $0.3500
Probability: 35.0%
---市場履歴を取得する
入力スキーマ:
{
"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"
}
}応答例:
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
---エラー処理
サーバーには、さまざまなシナリオに対応する包括的なエラー処理機能が含まれています。
レート制限(429エラー)
無効な API キー (403 エラー)
無効なマーケットID(404エラー)
ネットワーク接続の問題
APIタイムアウト条件(30秒タイムアウト)
不正な応答
エラー メッセージは、明確で人間が読める形式で返されます。
前提条件
Python 3.9以上
httpx>=0.24.0
mcp-core
python-dotenv>=1.0.0
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。大きな変更については、まずIssueを開いて、変更したい点について議論してください。
Available Tools
4 toolsget-market-historyC
Get historical price and volume data for a market
Inputs: market_id (required), timeframe.
get-market-infoC
Get detailed information about a specific prediction market
Inputs: market_id (required).
get-market-pricesB
Get current prices and trading information for a market
Inputs: market_id (required).
list-marketsB
Get a list of prediction markets with optional filters
Inputs: limit, offset, status.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The tools have overlapping purposes that could cause confusion. get-market-history, get-market-info, and get-market-prices all retrieve data about a specific market, making it unclear which to use for different needs. However, the descriptions provide some guidance on the type of data each returns (historical vs. current vs. detailed info), which helps reduce misselection.
All tool names follow a consistent verb_noun pattern with hyphens (e.g., get-market-history, list-markets). The naming is predictable and uniform across all four tools, making it easy for agents to understand the pattern and purpose at a glance.
With only 4 tools, the server feels thin for a prediction market domain, which typically involves actions like creating markets, placing bets, or managing positions. While the tools cover data retrieval well, the lack of operational tools (e.g., trade, create-market) suggests the scope is limited, bordering on under-provisioned for the apparent purpose.
There are significant gaps in the tool surface for a prediction market server. The tools only support read-only operations (get and list), with no ability to interact with markets (e.g., trade, resolve, create). This will cause agent failures when trying to perform common actions in this domain, as the surface is severely incomplete for the stated purpose.
Maintenance
Related MCP Connectors
Fetches live Polymarket prediction market orderbooks, implied Yes/No probabilities, volume, and wh
Read-only Polymarket search, market details, order books, price history, and market cards.
Polymarket in your AI: market rules, real fill costs, who is trading, top traders. Read-only.
Real-time Polymarket and Kalshi prediction market odds, orderbooks, probabilities, and events API.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables interaction with Polymarket prediction markets through read-only access to market data, events, orderbooks, and user positions, plus authenticated trading capabilities for creating and managing orders.1-
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Polymarket prediction markets, including retrieving market data, user positions, and trading history.813 npm13Apache 2.0
- AlicenseNot gradedqualityCmaintenanceProvides access to Polymarket prediction-market data via Gamma and CLOB public APIs, enabling AI agents to query market information.89 npmMIT
- AlicenseBqualityDmaintenanceEnables LLM agents to interact with Polymarket prediction markets, including market discovery, real-time pricing, analytics, account management, and trading with built-in safety guards.34MIT