The Opinion MCP Server enables AI agents to interact with Opinion.trade, a prediction market platform on the BNB Chain. This server provides comprehensive access to market data, real-time pricing, order books, and user portfolio information.
By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to discover prediction markets, analyze odds (probabilities), and track trading activity directly through their context window, bridging the gap between AI and decentralized prediction markets.
- Market Discovery: Search and filter prediction markets by status, type (binary/categorical), and keywords.
- Real-time Pricing: Access live price data, implied probabilities, and depth-of-market (order books) for any outcome token.
- Portfolio Tracking: Monitor user positions, trade history, and unrealized PnL for specific wallet addresses.
- Metadata Access: Retrieve detailed market rules, resolution criteria, and available quote tokens.
To use this server without installing it globally:
npx @iqai/mcp-opiniongit clone https://github.com/IQAIcom/mcp-opinion.git
cd mcp-opinion
pnpm install
pnpm run buildAdd the following configuration to your MCP client settings (e.g., claude_desktop_config.json).
{
"mcpServers": {
"opinion": {
"command": "npx",
"args": ["-y", "@iqai/mcp-opinion"],
"env": {
"OPINION_API_KEY": "your_api_key_here"
}
}
}
}{
"mcpServers": {
"opinion": {
"command": "node",
"args": ["/absolute/path/to/mcp-opinion/dist/index.js"],
"env": {
"OPINION_API_KEY": "your_api_key_here",
"OPINION_CHAIN_ID": "56"
}
}
}
}| Variable | Required | Description | Default |
|---|---|---|---|
OPINION_API_KEY |
Yes | Your Opinion.trade API key | - |
OPINION_CHAIN_ID |
No | BNB Chain ID (56 for Mainnet, 97 for Testnet) | 56 |
OPINION_PRIVATE_KEY |
No | Reserved for future trading capabilities | - |
- "What are the trending prediction markets on Opinion right now?"
- "Search for markets related to 'Bitcoin' or 'BTC'."
- "Find active markets about the US Election."
- "Show me the order book for token 0x123... and check the spread."
- "What is the current probability implied by the price of the 'Yes' token?"
- "Get the 1-hour price history for this market token over the last 24 hours."
- "What positions am I currently holding in wallet 0xabc...?"
- "Summarize my trade history for the last month."
- "Check if I have any winning positions that need to be redeemed."
Get the current/latest trade price for a prediction market token
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenId |
string | ✅ | The token ID to get the latest price for |
Get detailed information about a specific prediction market by its ID
| Parameter | Type | Required | Description |
|---|---|---|---|
marketId |
number | ✅ | The unique identifier of the market |
Get a list of prediction markets from Opinion.trade with optional filters for status and market type
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit |
number | 10 | Number of markets to return (max 20) | |
status |
number | Filter by status: 1=Created, 2=Active, 3=Resolving, 4=Resolved | ||
marketType |
number | Market type: 0=Binary, 1=Categorical, 2=All | ||
page |
number | Page number for pagination |
Get the order book (bids and asks) for a specific prediction market token
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenId |
string | ✅ | The token ID to get the order book for |
Get the current prediction market positions held by a wallet address
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
walletAddress |
string | ✅ | The wallet address to get positions for | |
limit |
number | 20 | Maximum number of positions to return | |
page |
number | Page number for pagination |
Get historical price data for a prediction market token
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
tokenId |
string | ✅ | The token ID to get price history for | |
interval |
string | "1h" | Time interval: 1m (1 minute), 5m (5 minutes), 1h (1 hour), 1d (1 day) |
Get the list of available quote tokens (currencies) that can be used for trading on Opinion.trade
No parameters
Get the trade history for a wallet address on Opinion.trade
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
walletAddress |
string | ✅ | The wallet address to get trade history for | |
limit |
number | 20 | Maximum number of trades to return | |
page |
number | Page number for pagination |
Search for prediction markets by keyword in the market title
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query |
string | ✅ | Search keyword to find in market titles | |
limit |
number | 10 | Maximum number of results to return | |
status |
number | Filter by status: 1=Created, 2=Active, 3=Resolving, 4=Resolved |
pnpm run buildpnpm run watchpnpm run lint
pnpm run formatsrc/tools/: Individual tool definitionssrc/services/: API client and business logicsrc/lib/: Shared utilitiessrc/index.ts: Server entry point
This project is an unofficial tool and is not directly affiliated with Opinion.trade. It interacts with financial and prediction market data. Users should exercise caution and verify all data independently. Trading in prediction markets involves risk.