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 分