🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

polymarket-guard-mcp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polymarket-guard-mcp

MCP server for Polymarket prediction markets — buy/sell positions with USDC pay-per-call billing via LemonCake

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
19
-58.7%
Maintainers
1
Weekly downloads
 
Created
Source

polymarket-guard-mcp — Polymarket Prediction Markets MCP Server

Buy/sell positions on Polymarket prediction markets, paying in USDC with per-call billing via LemonCake. Read-only mode works with no credentials.

npm version MCP Registry License: MIT

Installation

npx polymarket-guard-mcp

Or add to your MCP client (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "polymarket": {
      "command": "npx",
      "args": ["-y", "polymarket-mcp"],
      "env": {
        "POLYMARKET_PRIVATE_KEY": "0x<your-polygon-private-key>",
        "LEMONCAKE_SELLER_KEY": "<your-lemoncake-seller-key>"
      }
    }
  }
}

Environment Variables

VariableRequiredDescription
POLYMARKET_PRIVATE_KEYFor tradingPolygon wallet private key (0x-prefixed 32-byte hex). Required for positions, balance, and all trading tools.
LEMONCAKE_SELLER_KEYOptionalLemonCake seller key. Absent = Demo Mode (charges logged, no real billing).
LEMON_CAKE_PERMITOptionalClient's ERC-2612 permit blob for non-custodial billing. Passed by the MCP client automatically when using LemonCake.

Demo Mode

  • Free/read tools work with zero env vars — no key needed.
  • Account tools (get_positions, get_balance, get_trade_history) require POLYMARKET_PRIVATE_KEY.
  • Trading tools require POLYMARKET_PRIVATE_KEY.
  • LemonCake billing is a no-op in Demo Mode if LEMONCAKE_SELLER_KEY is absent — all tools still execute, charges are logged to stderr only.

Tools

Free (no charge)

ToolDescription
list_marketsList active Polymarket markets with prices and volume
search_marketsSearch markets by keyword
get_marketGet full market details by condition ID or slug
get_order_bookGet live bid/ask order book for a market token

$0.05 per call

ToolDescription
get_positionsYour current open positions (shares held, P&L)
get_balanceUSDC balance and contract allowances
get_trade_historyPast trades with prices and timestamps

$0.10 per call

ToolDescription
place_market_orderBuy/sell at market price (FOK with slippage tolerance)
place_limit_orderPlace a GTC/FOK/IOC limit order at a specific price
cancel_orderCancel an open limit order by ID
redeem_positionsClaim USDC winnings from resolved markets

Example Usage

# Find markets about the 2024 US election
search_markets(query="US election 2024")

# Get the order book for a specific outcome token
get_order_book(token_id="0x...")

# Check your current positions
get_positions()

# Buy 100 YES shares on a market (limit order at 0.65 = 65 cents/share)
place_limit_order(
  token_id="0x...",
  side="BUY",
  price=0.65,
  size=100
)

# Buy using market order with 2% slippage tolerance
place_market_order(
  token_id="0x...",
  side="BUY",
  amount=50  # $50 USDC
)

# Claim winnings after market resolves
redeem_positions(condition_id="0x...")

Architecture

  • Market data: Polymarket Gamma API (gamma-api.polymarket.com)
  • Trading: Polymarket CLOB API (clob.polymarket.com) with L1 EIP-712 auth
  • Chain: Polygon (chainId 137)
  • Token: USDC on Polygon (6 decimals)
  • Billing: LemonCake USDC pay-per-call (@lemon-cake/mcp-sdk)

Authentication Note

Polymarket's CLOB API uses L1 auth: EIP-712 typed-data signatures over each request. This implementation includes the complete request structure. For full production signing (real orders), install ethers and integrate the Wallet.signTypedData() method — the current build uses a placeholder signature that will receive a 401 from the CLOB for authenticated endpoints.

Full signing integration:

npm install ethers
import { ethers } from "ethers";
const wallet = new ethers.Wallet(process.env.POLYMARKET_PRIVATE_KEY!);
const sig = await wallet.signTypedData(domain, types, value);

Pricing & Billing

ActionCost
Browsing marketsFree
Checking positions / balance$0.05 USDC
Placing / cancelling orders$0.10 USDC
Claiming winnings$0.10 USDC

Billing is handled by LemonCake — USDC pay-per-call infrastructure for MCP tools. No subscription, no monthly fees. You pay only when you call a tool.

License

MIT

Keywords

mcp

FAQs

Package last updated on 22 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts