Polymarket MCP Server

io.github.joinQuantishPublished by GitHub account joinQuantishv0.1.0Updated Oct 27, 2026

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

VerifiedSTDIODesktop onlyCloud & InfrastructureFinance

Overview

AI-generated overview

Self-hosted MCP server that lets an AI agent manage a Polygon wallet and trade on Polymarket prediction markets.

What you can do
  • Create and recover accounts, deploy a Safe wallet, check wallet status and balances, and import or export private keys
  • Place, cancel and batch-execute buy/sell orders, and read order history, order books and midpoint prices
  • View and sync positions, check claimable winnings and claim resolved market payouts
  • Send USDC, MATIC and ERC-1155 shares, and get swap quotes or swap tokens via LI.FI
  • List, create and revoke API keys for the server's JSON-RPC endpoint
When to use it
For users who want an AI assistant to trade prediction markets on Polymarket with their own self-hosted infrastructure, including wallet setup, order placement and position or payout management. Market discovery tools are not included and come from a separate server.
Requirements
Runs locally as a Node.js process built from source, with a PostgreSQL database (DATABASE_URL), a 32-byte hex ENCRYPTION_KEY for wallet encryption, and a Polygon RPC endpoint (POLYGON_RPC_URL). Optional BOT_SIGNING_SECRET and PORT. Clients authenticate to the endpoint with an x-api-key header.
Before you install
The server holds and can export wallet private keys, so the ENCRYPTION_KEY and database contents are highly sensitive. Tools move real funds: placing orders, sending USDC, MATIC and shares, swapping tokens and claiming winnings all spend or transfer money. The project is no longer maintained by its team, and the README points to a third-party data service.

Installation

In SourceWeft

  1. Open Polymarket MCP Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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.

Source: README.md at commit 6851755

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.