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 分

    请在仓库或注册中心条目中声明许可证。