npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

guessmarket-mcp

v1.2.0

Published

MCP server for GuessMarket prediction markets — lets AI agents discover markets, analyze prices, view portfolios, build trading transactions, and get contract ABIs across 5 EVM chains

Downloads

81

Readme

GuessMarket MCP Server

MCP server for GuessMarket prediction markets. Gives AI agents full access to discover markets, analyze price history, view wallet portfolios, build trading transactions, and get smart contract ABIs.

Live on 5 EVM chains: Ethereum, Base, Polygon, BSC, and PulseChain.

Tools

Read-Only

| Tool | Description | |------|-------------| | list_markets | List prediction markets with filters for status and chain | | get_market | Get detailed market info: question, YES/NO odds, volume, liquidity, end time | | get_market_history | Get timestamped price history for trend analysis | | get_networks | Get all supported chains with contract addresses | | get_portfolio | Get a wallet's trading activity across all markets | | get_abi | Get smart contract ABI for custom integrations |

Transaction Builders

All transaction builders return unsigned EVM transaction objects. Sign with your wallet and broadcast to the chain. Amounts are human-readable (e.g. "10.5") and automatically converted to the correct decimals per chain (6 for USDC, 18 for BSC USDT).

| Tool | Description | Key Parameters | |------|-------------|----------------| | build_approve_tx | Approve stablecoin spending for a market | market_address, amount (or "max" for unlimited), chain_id | | build_buy_shares_tx | Buy YES or NO outcome shares | market_address, outcome, amount, chain_id, min_shares (slippage) | | build_sell_shares_tx | Sell YES or NO outcome shares | market_address, outcome, shares, chain_id, min_usdc (slippage) | | build_add_liquidity_tx | Add stablecoin liquidity, receive LP tokens | market_address, amount, chain_id | | build_remove_liquidity_tx | Burn LP tokens, receive stablecoin back | market_address, lp_tokens, chain_id | | build_claim_winnings_tx | Claim winnings from a resolved market | market_address, chain_id | | build_create_market_tx | Create a new prediction market | question, end_time (unix timestamp), chain_id | | build_buy_with_approval_tx | Approve + buy in one call (returns 2 ordered transactions) | market_address, outcome, amount, chain_id, min_shares (slippage) |

Slippage Protection

build_buy_shares_tx and build_sell_shares_tx accept optional slippage parameters (min_shares and min_usdc). When set to 0 (default), the server returns a warning. Set a minimum to protect against front-running.

Trading Flow

Buy Shares

1. list_markets               → Find a market to trade
2. get_market                  → Check current odds and liquidity
3. build_approve_tx            → Approve stablecoin spending
4. build_buy_shares_tx         → Buy YES or NO shares
5. Sign and broadcast both transactions with your wallet

Or combine steps 3-4 with build_buy_with_approval_tx which returns both transactions in order.

Sell Shares

1. build_sell_shares_tx        → Sell shares back to the market
2. Sign and broadcast the transaction

Provide Liquidity

1. build_approve_tx            → Approve stablecoin spending
2. build_add_liquidity_tx      → Deposit stablecoin, receive LP tokens
3. build_remove_liquidity_tx   → Later: burn LP tokens to withdraw

Create a Market

1. build_create_market_tx      → Deploy a new prediction market
2. Sign and broadcast — the new market address is in the tx receipt

Transaction Response Format

{
  "transaction": {
    "to": "0x...",
    "data": "0x...",
    "chainId": 8453,
    "value": "0x0"
  },
  "description": "Buy YES shares for 10 USDC on market 0x... (Base Mainnet)",
  "meta": {
    "chain": "Base Mainnet",
    "stablecoin": "USDC",
    "outcome": "YES",
    "function": "buyShares(uint8,uint256,uint256)"
  },
  "warnings": []
}

Quickstart

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "guessmarket": {
      "command": "npx",
      "args": ["-y", "guessmarket-mcp"]
    }
  }
}

Claude Code

Add to your project with the CLI:

claude mcp add guessmarket -- npx -y guessmarket-mcp

Or add to .mcp.json in your project root:

{
  "mcpServers": {
    "guessmarket": {
      "command": "npx",
      "args": ["-y", "guessmarket-mcp"]
    }
  }
}

VS Code

Add to your VS Code settings or .vscode/mcp.json:

{
  "mcp": {
    "servers": {
      "guessmarket": {
        "command": "npx",
        "args": ["-y", "guessmarket-mcp"]
      }
    }
  }
}

Supported Chains

| Chain | Chain ID | Stablecoin | |-------|----------|------------| | Ethereum | 1 | USDC (6 decimals) | | Base | 8453 | USDC (6 decimals) | | Polygon | 137 | USDC (6 decimals) | | BSC | 56 | USDT (18 decimals) | | PulseChain | 369 | USDC (6 decimals) |

Configuration

No API keys required — the server uses the public GuessMarket REST API.

Custom API URL

By default the server connects to https://guessmarket.com/wp-json/guessmarket/v1. Override with an environment variable:

{
  "mcpServers": {
    "guessmarket": {
      "command": "npx",
      "args": ["-y", "guessmarket-mcp"],
      "env": {
        "GUESSMARKET_API_URL": "https://your-instance.com/wp-json/guessmarket/v1"
      }
    }
  }
}

Architecture

AI Agent  <-->  MCP Server  <-->  GuessMarket REST API
   |                                      |
   |                                5 EVM Chains
   |                            (Ethereum, Base, Polygon,
   |                               BSC, PulseChain)
   |
   └── Signs & broadcasts unsigned transactions on-chain

The MCP server provides market data (via REST API) and builds unsigned transactions (via local ABI encoding). The agent signs transactions with its own wallet and broadcasts directly to the blockchain.

Requirements

  • Node.js 18 or later (uses native fetch)

Development

npm install
npm run build
node build/index.js

License

MIT