Skip to main content
Glama
joinQuantish

Polymarket MCP Server

by joinQuantish

Polymarket MCP Server

⚠️ お知らせ:Quantishは閉鎖予定です。 Quantishプラットフォーム(quantish.live)は間もなく終了します。このMCPサーバーはセルフホスト型であり、引き続き独立して動作しますが、Quantishチームは本プロジェクトのメンテナンスやアップデートを今後行いません。予測市場分野で活動しており、リアルタイムデータインフラが必要な場合は、polynode.devをご確認ください。

Polymarketの予測市場で取引を行うための、セルフホスト型MCPサーバーです。

概要

このパッケージは、Polygonネットワークを介してAIエージェントがPolymarketの予測市場で取引できるようにするMCP(Model Context Protocol)サーバーを提供します。

Related MCP server: polymarket-mcp

機能

  • 完全なPolymarket取引 - あらゆるPolymarket市場で売買可能

  • Polygonウォレット管理 - Safe統合によるウォレットの生成と管理

  • ガスレス取引 - ほとんどの操作はPolymarketのリレイヤーを使用(MATICは不要)

  • MCP互換 - Claude、Cursor、および任意のMCPクライアントで動作

  • セルフホスト可能 - Railway、Fly.io、または任意のNode.jsホストで実行可能

クイックスタート

git clone https://github.com/joinQuantish/polymarket-mcp
cd polymarket-mcp
npm install

環境変数

変数

必須

説明

DATABASE_URL

はい

PostgreSQL接続文字列

ENCRYPTION_KEY

はい

ウォレット暗号化用の32バイトの16進文字列

POLYGON_RPC_URL

はい

Polygon RPCエンドポイント

BOT_SIGNING_SECRET

いいえ

信頼済みボットHMAC認証用のシークレット

PORT

いいえ

サーバーポート(デフォルトは3000)

暗号化キーの生成

# 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'))"

データベース設定

任意のPostgreSQLデータベースが使用可能です。オプション:

プロバイダー

注意事項

Railway

PostgreSQLサービスを追加し、変数からDATABASE_URLをコピー

Supabase

supabase.comの無料枠、Settings > Databaseから接続文字列をコピー

Neon

neon.techのサーバーレスPostgreSQL、無料枠あり

ローカルDocker

docker run -e POSTGRES_PASSWORD=pass -p 5432:5432 postgres

DATABASE_URLを設定した後、以下を実行:

# Generate Prisma client
npm run db:generate

# Create tables
npm run db:push

サーバーの実行

# Development
npm run dev

# Production
npm run build
npm start

利用可能なツール

アカウントとウォレット

ツール

説明

request_api_key

新しいウォレットでアカウントを作成(または既存のアカウントを復元)

setup_wallet

Safeウォレットをデプロイし、承認を設定

get_wallet_status

ウォレットのデプロイ状態と承認状態を確認

get_balances

USDC/MATIC残高を取得

get_deposit_addresses

入金用アドレスを取得(EVM、Solana、BTC)

export_private_key

ウォレットの秘密鍵をエクスポート

import_private_key

既存のウォレットをインポート

取引

ツール

説明

place_order

買い注文または売り注文を出す

cancel_order

オープン注文をキャンセル

cancel_all_orders

全てのオープン注文をキャンセル

get_orders

注文履歴を取得

execute_atomic_orders

複数の注文をアトミックに実行

get_orderbook

市場のbid/askを取得

get_price

市場の中間価格を取得

ポジション

ツール

説明

get_positions

自身のポジションを取得

sync_positions

Polymarket APIからポジションを同期

get_claimable_winnings

引き出し可能な賞金を確認

claim_winnings

確定した市場の賞金を受け取る

get_onchain_shares

全てのERC-1155保有分を取得(贈与された分も含む)

送金とスワップ

ツール

説明

transfer_usdc

ブリッジされたUSDCを送金

transfer_native_usdc

CircleネイティブUSDCを送金

transfer_shares

ERC-1155シェアを送金

send_matic

EOAからMATICを送金

swap_tokens

LI.FI経由でトークンをスワップ

get_swap_quote

スワップの見積もりを取得

APIキー

ツール

説明

list_api_keys

APIキーを一覧表示

create_additional_api_key

新しいAPIキーを作成

revoke_api_key

APIキーを失効

注: 市場検索ツール(search_marketsget_marketget_active_markets)は、Discovery MCPから利用できます。

API形式

サーバーは/mcpでJSON-RPC 2.0エンドポイントを公開します:

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クライアント設定

Claude Desktop / Cursor

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

セキュリティ

既存ユーザー

セキュリティのため、既存ユーザー(既存のexternalId)は認証なしで新しいAPIキーを取得できません。オプション:

  1. 既存のAPIキーを使用 - 保存している場合

  2. HMAC認証(信頼済みボットのみ) - BOT_SIGNING_SECRETで署名:

    signature = HMAC-SHA256(externalId:timestamp, BOT_SIGNING_SECRET)
  3. 新しいアカウント - 別のexternalIdを使用

開発

# Install dependencies
npm install

# Generate Prisma client
npm run db:generate

# Run migrations
npm run db:push

# Start development server
npm run dev

リソース

ライセンス

このプロジェクトは、PolyForm Noncommercial License 1.0.0の下でライセンスされています。

個人使用、研究、非営利目的での使用は無料です。 商業利用にはQuantish Inc.の明示的な許可が必要です。商用ライセンスについては、hello@quantish.liveまでお問い合わせください。


Built by Quantish Inc.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    An MCP server that gives AI agents direct access to Polymarket Crypto prediction markets, enriched with live spot prices. Discover markets, analyze order books, paper trade strategies, track activity, and execute live trades — all through natural language.
    1
    AGPL 3.0
  • A
    license
    -
    quality
    B
    maintenance
    An MCP server and Python toolkit that provides AI agents with real-time tools for Polymarket prediction markets, including liquidity scanning, arbitrage detection, and slippage estimation. It also offers advanced wallet intelligence, portfolio risk calculation, and probabilistic reasoning to enhance market analysis and strategy.
    1
    MIT
  • A
    license
    C
    quality
    B
    maintenance
    MCP server that provides a unified prediction market API for multiple venues like Polymarket and Kalshi, allowing AI agents to discover markets, fetch order books, and execute trades through a single interface.
    32
    438
    8
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    Agent-native, self-hosted MCP server for crypto trading and DeFi management. Enables agents to query balances, execute trades, and manage positions with a policy engine and secure key storage.
    7
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • No-KYC managed MCP for AI agents: sandboxed TypeScript trading SDK, isolated sub-accounts, futures.

  • HiveCapital MCP Server — autonomous investment layer for AI agents

  • Polymarket + Hyperliquid + macro for AI agents. 38 tools, signal backtest, SSE streaming. Free tier.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/joinQuantish/polymarket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server