Polymarket MCP

io.github.beejmaxx由 GitHub 帳號 beejmaxx 發布v0.1.1更新於 Oct 24, 2026

Polymarket market data, live CLOB books, replay, simulation, and opt-in trading in Rust.

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

一個在本機執行的 Rust MCP 伺服器,提供 Polymarket 預測市場資料:市場簡報、即時訂單簿、錢包分析、回放、模擬,以及可選的受控交易。

可以做什麼
提供多種 Polymarket 研究工具設定:公開市場探索、精確的 CLOB 訂單簿、錢包分析、透過 WebSocket 取得即時市場狀態、SQLite 記錄與回放,以及成交模擬。預設 research 設定提供 30 個公開工具;另有 11 個工具的精簡 chatgpt 設定可透過 Streamable HTTP 使用。可選的交易設定會增加需驗證的帳戶與下單操作。
適用情境
當助理需要 Polymarket 市場資料、訂單簿深度、流動性、價差、滑價估算或錢包活動來進行研究與分析時使用。也適合在本機記錄並回放市場觀測資料。只有在明確選擇啟用時,交易功能才有意義。
執行需求
以本機二進位程式執行於 macOS、Linux 或 Windows,可透過腳本、Homebrew、Scoop 或發行套件安裝。預設 research 設定不需要 API 金鑰或錢包。設定使用 POLYMARKET_TOOL_PROFILE、POLYMARKET_MCP_DB 等環境變數;需要連線至 Polymarket API 與 WebSocket 的網路。
安裝前請注意
交易預設關閉,需另行啟用:POLYMARKET_TOOL_PROFILE、POLYMARKET_ENABLE_TRADING、POLYMARKET_PRIVATE_KEY、POLYMARKET_MAX_ORDER_PUSD 與 POLYMARKET_SIGNATURE_TYPE。下單會動用真實資金,且每次操作都需確認;取消訂單也有各自的確認。私鑰屬於錢包機密。本機 SQLite 會保存記錄與審批稽核。此伺服器聲明沒有遙測。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Polymarket MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Polymarket MCP

[CI] [Production API canary] [License: MIT]

A self-contained Rust MCP server for Polymarket: source-linked market briefs, public discovery, exact CLOB V2 books, wallet analytics, realtime market state, SQLite recording/replay, fill simulation, and safely gated optional trading.

The default research profile needs no API key or wallet. It exposes 30 public/realtime tools and does not advertise or accept calls to authenticated trading tools. A separate 11-tool chatgpt profile is compact, stateless, credential-blind, and available over Streamable HTTP with an optional inline market card.

Install in a minute

macOS or Linux:

bash
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/beejmaxx/polymarket-mcp-rs/main/scripts/install.sh | shpolymarket-mcp-rs doctor

Windows PowerShell:

powershell
irm https://raw.githubusercontent.com/beejmaxx/polymarket-mcp-rs/main/scripts/install.ps1 | iexpolymarket-mcp-rs doctor

Or use a package manager:

bash
brew install beejmaxx/tap/polymarket-mcp-rs
powershell
scoop bucket add beejmaxx https://github.com/beejmaxx/scoop-bucketscoop install beejmaxx/polymarket-mcp-rs

Then add it to a client:

bash
codex mcp add polymarket -- polymarket-mcp-rs# orclaude mcp add polymarket -- polymarket-mcp-rs

Prebuilt binaries and a one-click polymarket-mcp.mcpb bundle are attached to every GitHub release. See the install guide for Claude Desktop, VS Code, source builds, custom database paths, and Windows details.

Why this server

  • Verified replacement surface: 46 tools across public data, live books, research workflows, and opt-in account operations, with an automated live audit against all 25 Python demo tools.
  • Answer-ready workflows: one market brief joins metadata, executable books, history, fill impact, source URLs, timestamps, and limitations; wallet and explicit negative-risk event summaries avoid unnecessary tool chains.
  • Correct numeric boundaries: decimal financial values and 256-bit IDs stay strings across JSON, preventing floating-point and integer loss.
  • Stateful market research: Rust maintains reconstructed books and feed health internally instead of sending every tick to the model.
  • Honest replay: SQLite stores observations captured by this process, tracks dropped updates, and never presents them as complete exchange history.
  • Safe defaults: trading tools are absent by default; exposing them and enabling mutation are separate decisions.
  • Operationally simple: one binary, stdio or stateless Streamable HTTP, structured errors, health and Prometheus endpoints, an offline/online doctor, graceful shutdown, daily production canaries, containers, checksums, SBOMs, and release provenance.

A useful first prompt

Find the five highest-volume active Polymarket markets. For each, show the current outcome prices, liquidity, spread, order-book imbalance, and estimated slippage for 100 shares. Explain data limitations and do not recommend a trade.

Other demo prompts are in docs/DEMO.md.

Tool profiles

ProfileToolsIntended use
chatgpt11Compact stateless public research surface for hosted clients
core20Public REST discovery, books, wallets, answer-ready analysis, and simulation
research (default)30Core plus realtime watching and local recording/replay
trading36Core plus authenticated account, user-event streaming, and trading operations
all46Research and trading together

Select a profile with --tool-profile research or POLYMARKET_TOOL_PROFILE=research. Hidden tools are removed from both tools/list and dispatch. Choosing trading or all only exposes the tool definitions; order mutation still requires POLYMARKET_ENABLE_TRADING=true, a signer, local caps, and per-operation confirmation. Public HTTP accepts only chatgpt or core and constructs an application instance that ignores credentials by design.

Run polymarket-mcp-rs tools to inspect the default catalog or polymarket-mcp-rs --tool-profile all tools --json for complete schemas. See docs/TOOLS.md for the grouped reference.

Architecture

text
MCP client (stdio or Streamable HTTP)        |        vtool profile + typed MCP schemas        |        vvalidation and stable output mapping   |              |                |                 |Gamma/Data/    CLOB REST      realtime books      SQLite + tradingpublic APIs    exact books    WebSocket health    replay / audit

The market WebSocket engine seeds each watched token from CLOB REST, then applies full snapshots and incremental price changes. Authenticated profiles can separately watch account order and trade events. Connection state, reconnects, source-specific counters, local receipt time, feed age, errors, and recording gaps remain explicit. SQLite writes use a bounded channel and dedicated writer thread; active recordings flush before watches stop on MCP EOF, SIGINT, or SIGTERM.

Configuration

VariableDefaultPurpose
POLYMARKET_TOOL_PROFILEresearchchatgpt, core, research, trading, or all
POLYMARKET_MCP_DBOS application-data directorySQLite recording and approval-audit database
POLYMARKET_WS_URLProduction market WebSocketOverride the full WebSocket URL
POLYMARKET_WS_PROXYunsetUnauthenticated socks5://host:port WebSocket proxy
HTTPS_PROXY / HTTP_PROXYenvironment dependentProxy used by HTTP API clients
RUST_LOGinfostderr log filtering

The default database is in ~/Library/Application Support/polymarket-mcp/ on macOS, $XDG_DATA_HOME/polymarket-mcp/ (or ~/.local/share/polymarket-mcp/) on Linux, and %LOCALAPPDATA%\polymarket-mcp\ on Windows. ALL_PROXY=socks5://... is also honored for the public market WebSocket when POLYMARKET_WS_PROXY is unset; neither setting is needed on a normal unrestricted network. The server has no telemetry.

Trading is a separate opt-in

Read SECURITY.md and docs/THREAT_MODEL.md first. At minimum:

bash
export POLYMARKET_TOOL_PROFILE=allexport POLYMARKET_ENABLE_TRADING=trueexport POLYMARKET_PRIVATE_KEY=0x...export POLYMARKET_MAX_ORDER_PUSD=100export POLYMARKET_SIGNATURE_TYPE=eoa

EOA, legacy Proxy, Gnosis Safe, and POLY_1271 configurations are supported. preview_order performs policy and current-market-rule checks and creates a single-use five-minute approval. place_order consumes that approval and requires confirm=true; batch placement requires PLACE_BATCH. Cancellations have their own confirmations. Approval transitions are persisted before submission, and ambiguous network outcomes are never reported as safe retries. Account reads and user-event watches do not silently enable cancel-on-disconnect heartbeats.

Development and evidence

Rust 1.90 or newer is required:

bash
cargo fmt --checkcargo clippy --locked --all-targets --all-features -- -D warningscargo test --locked --all-featurescargo test --locked --test live_api -- --ignored --nocapture

Normal tests are offline and launch the compiled executable as a real stdio MCP subprocess. The ignored suite exercises current production Gamma, Data, CLOB REST, wallet, scanning, WebSocket, recording, replay, and simulation paths; it never places an order. Tool catalogs have committed golden contracts, and release tags rebuild on five OS/architecture targets.

The live semantic replacement audit launches both this server and the reference Python server through MCP, maps every Python demo tool, and fails on a Rust error or invariant violation:

bash
python3 scripts/parity_harness.py

This software provides market infrastructure, not trading recommendations or financial advice.

來源:README.md,提交 9411ea5

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分