Polymarket MCP Server

io.github.joinQuantish由 GitHub 帳號 joinQuantish 發布v0.1.0更新於 Oct 27, 2026

Self-hosted MCP server for AI agent trading on Polymarket prediction markets

已驗證STDIO僅桌面雲端與基礎設施金融

概覽

AI 產生的概覽

自架式 MCP 伺服器,讓 AI 代理管理 Polygon 錢包並在 Polymarket 預測市場交易。

可以做什麼
  • 建立或復原帳戶、部署 Safe 錢包、查看錢包狀態與餘額、匯入或匯出私鑰
  • 下單、取消訂單、批次原子執行買賣訂單,並查詢訂單紀錄、訂單簿與中間價
  • 查看與同步持倉、查詢可領取獎金並領取已結算市場的收益
  • 傳送 USDC、MATIC 與 ERC-1155 份額,取得兌換報價或透過 LI.FI 兌換代幣
  • 列出、建立與撤銷用於伺服器 JSON-RPC 端點的 API 金鑰
適用情境
適合想用 AI 助理在 Polymarket 預測市場交易、並自行架設基礎設施的使用者,涵蓋錢包設定、下單以及持倉與收益管理。市場探索類工具不包含在內,需另裝其他伺服器。
執行需求
以 Node.js 本機程序從原始碼建置執行,需要 PostgreSQL 資料庫(DATABASE_URL)、用於錢包加密的 32 位元組十六進位 ENCRYPTION_KEY,以及 Polygon RPC 端點(POLYGON_RPC_URL)。可選 BOT_SIGNING_SECRET 與 PORT。用戶端透過 x-api-key 標頭存取端點。
安裝前請注意
伺服器持有並可匯出錢包私鑰,ENCRYPTION_KEY 與資料庫內容極為敏感。相關工具會動用真實資金:下單、傳送 USDC、MATIC 與份額、兌換代幣、領取收益都會花費或轉移資金。此專案已不再由其團隊維護,README 另推薦一個第三方資料服務。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

Polymarket MCP Server

⚠️ Notice: Quantish is winding down. The Quantish platform (quantish.live) is shutting down. This MCP server is self-hosted and will continue to work independently, but the Quantish team will no longer be maintaining or updating this project. If you're building in the prediction market space and need real-time data infrastructure, check out polynode.dev.

Self-hosted MCP server for trading on Polymarket prediction markets.

Overview

This package provides an MCP (Model Context Protocol) server that enables AI agents to trade on Polymarket prediction markets via the Polygon network.

Features

  • Full Polymarket Trading - Buy/sell on any Polymarket market
  • Polygon Wallet Management - Generate and manage wallets with Safe integration
  • Gasless Transactions - Most operations use Polymarket's relayer (no MATIC needed)
  • MCP Compatible - Works with Claude, Cursor, and any MCP client
  • Self-Hostable - Run on Railway, Fly.io, or any Node.js host

Quick Start

bash
git clone https://github.com/joinQuantish/polymarket-mcpcd polymarket-mcpnpm install

Environment Variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string
ENCRYPTION_KEYYes32-byte hex string for wallet encryption
POLYGON_RPC_URLYesPolygon RPC endpoint
BOT_SIGNING_SECRETNoSecret for trusted bot HMAC authentication
PORTNoServer port (defaults to 3000)

Generate Encryption Keys

bash
# Generate ENCRYPTION_KEY (32 bytes = 64 hex chars)node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# Generate BOT_SIGNING_SECRET (for trusted bot auth)node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Database Setup

Any PostgreSQL database works. Options:

ProviderNotes
RailwayAdd PostgreSQL service, copy DATABASE_URL from variables
SupabaseFree tier at supabase.com, copy connection string from Settings > Database
NeonServerless Postgres at neon.tech, free tier available
Local Dockerdocker run -e POSTGRES_PASSWORD=pass -p 5432:5432 postgres

Set your DATABASE_URL then run:

bash
# Generate Prisma clientnpm run db:generate
# Create tablesnpm run db:push

Running the Server

bash
# Developmentnpm run dev
# Productionnpm run buildnpm start

Available Tools

Account & Wallet

ToolDescription
request_api_keyCreate account with new wallet (or recover existing)
setup_walletDeploy Safe wallet and set approvals
get_wallet_statusCheck wallet deployment and approval status
get_balancesGet USDC/MATIC balances
get_deposit_addressesGet addresses for depositing (EVM, Solana, BTC)
export_private_keyExport wallet private key
import_private_keyImport existing wallet

Trading

ToolDescription
place_orderPlace buy/sell order
cancel_orderCancel an open order
cancel_all_ordersCancel all open orders
get_ordersGet order history
execute_atomic_ordersExecute multiple orders atomically
get_orderbookGet market bids/asks
get_priceGet market midpoint price

Positions

ToolDescription
get_positionsGet your positions
sync_positionsSync positions from Polymarket API
get_claimable_winningsCheck redeemable winnings
claim_winningsClaim resolved market winnings
get_onchain_sharesGet all ERC-1155 holdings (including gifted)

Transfers & Swaps

ToolDescription
transfer_usdcSend bridged USDC
transfer_native_usdcSend Circle native USDC
transfer_sharesSend ERC-1155 shares
send_maticSend MATIC from EOA
swap_tokensSwap tokens via LI.FI
get_swap_quoteGet swap quote

API Keys

ToolDescription
list_api_keysList your API keys
create_additional_api_keyCreate new API key
revoke_api_keyRevoke an API key

Note: Market search tools (search_markets, get_market, get_active_markets) are available via the Discovery MCP.

API Format

The server exposes a JSON-RPC 2.0 endpoint at /mcp:

bash
curl -X POST https://your-server.com/mcp \  -H "Content-Type: application/json" \  -H "x-api-key: YOUR_API_KEY" \  -d '{    "jsonrpc": "2.0",    "method": "tools/call",    "params": {      "name": "get_balances",      "arguments": {}    },    "id": 1  }'

MCP Client Configuration

Claude Desktop / Cursor

json
{  "mcpServers": {    "polymarket": {      "command": "npx",      "args": [        "-y",        "mcp-remote",        "https://your-server.com/mcp",        "--header",        "x-api-key: YOUR_API_KEY"      ]    }  }}

Security

Returning Users

For security, returning users (existing externalId) cannot get new API keys without authentication. Options:

  1. Use existing API key - If you have it saved
  2. HMAC Authentication (trusted bots only) - Sign with BOT_SIGNING_SECRET:
    signature = HMAC-SHA256(externalId:timestamp, BOT_SIGNING_SECRET)
  3. New Account - Use a different externalId

Development

bash
# Install dependenciesnpm install
# Generate Prisma clientnpm run db:generate
# Run migrationsnpm run db:push
# Start development servernpm run dev

Resources

License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

Free for personal use, research, and non-commercial purposes. Commercial use requires explicit permission from Quantish Inc. Contact [email protected] for commercial licensing.


Built by Quantish Inc.

來源:README.md,提交 6851755

工具

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

版本歷史

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

評分

已滿足適用檢查項的 40%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

    請在儲存庫或註冊中心條目中宣告授權條款。