Skip to main content
Glama
berlinbra

PolyMarket MCP Server

by berlinbra

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

  • Windows の場合: %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"
            }
        }
    }

ローカルで実行

  1. リポジトリをクローンし、依存関係をインストールします。

ライブラリをインストールする

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.py
  1. PolyMarket API キーを使用して.envファイルを作成します。

Key=your_api_key_here
Funder=poly market wallet address

Claude クライアントを 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 tools
get-market-historyC

Get historical price and volume data for a market

ParametersJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket ID or slug
timeframeNoTime period for historical data7d

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it indicates this is a read operation ('Get'), it lacks details on permissions, rate limits, data freshness, or error handling. For a tool fetching historical market data, this omission is significant, as users need to understand constraints like data availability or API limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get historical price and volume data for a market'. It's front-loaded with the core purpose, has zero waste, and is appropriately sized for a simple tool. Every word earns its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (historical data retrieval with parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain what the return values look like (e.g., data format, fields), potential limitations (e.g., max timeframe), or how it differs from siblings. For a tool without structured output documentation, this leaves gaps in usability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents both parameters ('market_id' and 'timeframe') with descriptions and an enum for 'timeframe'. The description adds no additional parameter semantics beyond implying historical data retrieval, which is already covered by the tool's purpose. Baseline 3 is appropriate as the schema handles most documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get historical price and volume data for a market'. It specifies the verb ('Get'), resource ('historical price and volume data'), and target ('for a market'). However, it doesn't explicitly distinguish this tool from sibling tools like 'get-market-prices' or 'get-market-info', which might also retrieve market data but with different scopes or timeframes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get-market-prices' or 'get-market-info', nor does it specify scenarios where this tool is preferred (e.g., for historical analysis vs. current data). Without such context, users might struggle to choose between similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-market-infoC

Get detailed information about a specific prediction market

ParametersJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket ID or slug

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool retrieves 'detailed information' but doesn't specify what that includes (e.g., market status, participants, outcomes), whether it's read-only (implied by 'Get'), or any behavioral traits like rate limits, authentication needs, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool with one parameter and is front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed information' entails, the return format, or how this tool fits with siblings. For a tool that likely returns complex market data, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'market_id' documented as 'Market ID or slug'. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or valid slug patterns, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('detailed information about a specific prediction market'), making the purpose unambiguous. However, it doesn't explicitly differentiate from siblings like 'get-market-history' or 'get-market-prices', which likely provide different types of market data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list-markets' or 'get-market-history'. It doesn't specify prerequisites, such as needing a market ID, or contextual factors like whether this is for real-time data or historical analysis.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-market-pricesB

Get current prices and trading information for a market

ParametersJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket ID or slug

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves 'current prices and trading information', implying a read-only operation, but doesn't specify aspects like rate limits, authentication needs, data freshness, or error handling. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is front-loaded with the core functionality, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is adequate but has clear gaps. It covers the basic purpose but lacks usage guidelines and behavioral details, making it incomplete for optimal agent decision-making in a context with sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'market_id' parameter clearly documented as 'Market ID or slug'. The description adds no additional meaning beyond this, such as examples or format details, but since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('current prices and trading information for a market'), making it easy to understand what it does. However, it doesn't explicitly differentiate itself from sibling tools like 'get-market-info' or 'get-market-history', which might also retrieve market-related data, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get-market-info' or 'get-market-history'. It lacks context about specific use cases, prerequisites, or exclusions, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list-marketsB

Get a list of prediction markets with optional filters

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of markets to return (default: 10)
offsetNoNumber of markets to skip (for pagination)
statusNoFilter by market status (e.g., open, closed, resolved)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'optional filters' but fails to describe key behaviors: whether this is a read-only operation, how pagination works with limit/offset, what the default sorting is, or what the response format looks like. For a listing tool with zero annotation coverage, this leaves significant gaps in understanding its operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Get a list of prediction markets') and adds essential qualification ('with optional filters'). There is no wasted language, and every word serves to clarify the tool's function appropriately for its complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a listing tool with 3 parameters. It doesn't explain the return format, pagination behavior, or any error conditions. While the schema covers parameters well, the overall context for agent usage remains underspecified, especially for behavioral aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all parameters well-documented in the schema (limit, offset, status with enum values). The description adds minimal value beyond the schema by mentioning 'optional filters,' which aligns with the status parameter but doesn't provide additional context or examples. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('list of prediction markets'), making the purpose immediately understandable. It distinguishes this tool from its siblings (get-market-history, get-market-info, get-market-prices) by focusing on listing with filters rather than retrieving specific market details. However, it doesn't explicitly contrast with siblings beyond the general 'list' vs 'get' distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through 'with optional filters,' suggesting this tool is for filtered listing operations. However, it provides no explicit guidance on when to use this tool versus its siblings (e.g., use list-markets for overviews vs get-market-info for details) or any prerequisites. The context is clear but lacks specific alternatives or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedget-market-history
    • First observedget-market-info
    • First observedget-market-prices
    • First observedlist-markets

TDQS

B3.1/5.0

Scored across 4 tools

Disambiguation3/5

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.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables 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
    -
  • A
    license
    B
    quality
    D
    maintenance
    Enables LLM agents to interact with Polymarket prediction markets, including market discovery, real-time pricing, analytics, account management, and trading with built-in safety guards.
    34
    MIT