01
Create an API key
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read
Connect Claude, Codex, or Cursor to Unhedged prediction markets with the Model Context Protocol (MCP). Research markets, track your positions, and trade with scoped API keys.
Run this command in your terminal.
claude mcp add unhedged --scope user --transport stdio \ --env UNHEDGED_API_KEY='ak_your_key_here' \ -- npx -y @unhedged/mcp
Replace the key placeholder before connecting.
Full setup instructions01 / Setup
AI client
Requires Node.js 20+ and npx on the computer running the server. Replace the key placeholder if you have not entered one above.
01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Run this command in your terminal.
claude mcp add unhedged --scope user --transport stdio \ --env UNHEDGED_API_KEY='ak_your_key_here' \ -- npx -y @unhedged/mcp
03
Open a new Claude Code session, type /mcp, and look for unhedged.
claude 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Run this command in your terminal.
codex mcp add unhedged \ --env UNHEDGED_API_KEY='ak_your_key_here' \ -- npx -y @unhedged/mcp
03
Open a new Codex session, type /mcp, and look for unhedged.
codex 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
In the Claude desktop app, open Settings > Developer > Edit Config. Merge the entry below into claude_desktop_config.json, keeping any existing servers.
{
"mcpServers": {
"unhedged": {
"command": "npx",
"args": ["-y", "@unhedged/mcp"],
"env": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
Fully quit and reopen Claude Desktop. Check that Unhedged tools appear in a new chat, then try this prompt.
Find an active BTC Up or Down market using Unhedged MCP. What makes Up win, and when does it close? 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Merge this entry into ~/.cursor/mcp.json in your home directory to make Unhedged available across projects. Keep any existing servers.
{
"mcpServers": {
"unhedged": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@unhedged/mcp"],
"env": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
Enable unhedged in Cursor's MCP settings. Start an Agent chat and try this prompt using Unhedged tools.
Find an active BTC Up or Down market using Unhedged MCP. What makes Up win, and when does it close? 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Merge this entry into ~/.gemini/settings.json in your home directory. Keep your existing settings and any other entries under mcpServers.
{
"mcpServers": {
"unhedged": {
"command": "npx",
"args": ["-y", "@unhedged/mcp"],
"env": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
Run gemini and type /mcp to check that unhedged is connected. Then try this prompt.
Find an active BTC Up or Down market using Unhedged MCP. What makes Up win, and when does it close? 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Merge this entry into ~/.copilot/mcp-config.json, keeping existing servers. If COPILOT_HOME is set, use that directory instead.
{
"mcpServers": {
"unhedged": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@unhedged/mcp"],
"env": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
Run MCP: List Servers in VS Code and start unhedged. In Copilot Chat, select Agent mode, enable Unhedged tools, and try this prompt.
Find an active BTC Up or Down market using Unhedged MCP. What makes Up win, and when does it close? Set UNHEDGED_API_KEY in the server's environment configuration. Keep the key out of the command, arguments, and chat.
01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Add a custom MCP server in Grok Bot, choose Command, and enter the fields below. Requires Node.js 20+ and npx on the Bot's computer.
Name: unhedged Server type: Command Command: npx Arguments: -y @unhedged/mcp Environment variable: UNHEDGED_API_KEY=ak_your_key_here
03
In your own Grok Bot chat, ask it to list the Unhedged tools. Then try this research prompt and check that it returns a market, its rules, and its closing time.
Find an active BTC Up or Down market using Unhedged MCP. What makes Up win, and when does it close? Pi needs an MCP adapter. Run this once, then restart Pi.
pi install npm:pi-mcp-adapter
01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Save this entry in ~/.config/mcp/mcp.json. Merge it with your existing config if the file already exists.
{
"mcpServers": {
"unhedged": {
"command": "npx",
"args": ["-y", "@unhedged/mcp"],
"env": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
Open /mcp and check that unhedged is connected.
pi 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Save this entry in ~/.omp/agent/mcp.json. Merge it with your existing config if the file already exists.
{
"mcpServers": {
"unhedged": {
"command": "npx",
"args": ["-y", "@unhedged/mcp"],
"env": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
In OMP, run /mcp reload, then /mcp test unhedged.
omp 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Save this entry in ~/.hermes/config.yaml. Merge it with your existing config if the file already exists.
mcp_servers:
unhedged:
command: npx
args: ["-y", "@unhedged/mcp"]
env:
UNHEDGED_API_KEY: "ak_your_key_here" 03
Run hermes mcp test unhedged, then start a new Hermes chat.
hermes chat 01
Start with read access. Add trading permissions when you need them.
Research only
market:readportfolio:readbet:readorder:readbalance:read02
Save this entry in ~/.config/opencode/opencode.json. Merge it with your existing config if the file already exists.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"unhedged": {
"type": "local",
"command": ["npx", "-y", "@unhedged/mcp"],
"enabled": true,
"environment": { "UNHEDGED_API_KEY": "ak_your_key_here" }
}
}
} 03
Run opencode mcp list and check that unhedged is connected.
opencode 02 / Capabilities
Research
“Which open markets cover the next Counter-Strike major, and what are the implied probabilities?”
search_markets Portfolio
“Summarise my positions, my available and locked balance, and where my risk is concentrated.”
get_portfolio Trading
“Buy 50 shares of MLBB finals YES at 62 cents, then show me the fill.”
place_order Combo tools require @unhedged/mcp 0.3.0 or later. The 0.2.0 release has no combo tools. This catalog describes the 0.3.2 source; confirm that version is published before installing it, or build the matching source checkout.
Retail: create a combo, request a quote, inspect it, accept or cancel, then reconcile the fill and positions. Acceptance needs order:place and order:read; cancellation needs order:cancel; positions need portfolio:read. ACCEPTED is not a completed trade. The process tracks pending BUY spend until confirmed execution or non-execution.
Makers need MARKET_MAKER or SUPER_ADMIN, order:read, and order:place. The combo-quoting skill uses await_combo_quote_events and post_combo_quote. Confirmation runs in the process; confirm_combo_quote is only a retry after confirmError within the remaining three-second window. Capped maker quotes require full quantity and reserve the larger cash side. Retail uses the combo-trading skill and REST reconciliation.
Read the combo contract and examplesCheck combo availability
Read global combo availability; category and leg eligibility still apply.
get_combo_config Public endpointRead a combo
Read a combo and its selected outcomes.
get_combo Public endpointFind group combos
Page through combos containing a child of a market group.
list_group_combos Public endpointRead public book depth
Snapshot bid/ask levels best price first, with truncation and receipt-time metadata.
get_order_book Public endpointFind markets
Find active and ended markets by asset, sport, topic, or tag. Request resolved markets for history.
search_markets Public endpointRead a market
Check the outcomes, close time, and resolution rule.
get_market Public endpointCompare market activity
See implied probabilities, volume, and bet activity.
get_market_stats Public endpointRead quotes and confirmed fills
Read quotes, request status, and fill; reconcile pending retail session spend.
list_combo_quotes order:readRead funded combo positions
Read gross long/short claims, including zero-net positions; settled claims disappear.
get_combo_positions portfolio:readRead every active position
Page through active and ended positions, including fractional contracts.
list_positions portfolio:readRead settled positions
Page through resolved or voided positions.
list_position_history portfolio:readRead executed trades
Reconcile fills, signed fees, and independently paginated complete-set burns.
list_trades order:readRecover client order IDs
Look up retained client IDs for accepted orders, including closed orders.
list_order_aliases order:readCheck your balance
See spendable and locked USD, plus held CC.
get_balance balance:readReview your positions
See position exposure, performance, and recent payouts.
get_portfolio portfolio:readReview your pool bets
See your pool bets and whether they are open or settled.
list_bets bet:readReview open orders
See open order book orders across your account or one market.
list_orders order:readBuild a combo
Get or create a definition from 2–32 eligible outcome legs. Creates no trade.
get_or_create_combo order:placeRequest a combo quote
Open a full-quantity BUY or SELL RFQ. SELL requires unreserved long inventory.
request_combo_quote order:placeCancel an open combo RFQ
Cancel only OPEN requests. ACCEPTED requests must be reconciled through confirmation or expiry.
cancel_combo_quote_request order:cancelAccept a combo quote
Reserve BUY cost and accept. AWAITING_CONFIRMATION and UNKNOWN are not fills; background REST reads reconcile the result.
accept_combo_quote order:place, order:readPreview execution and fees
Estimate fills, fees, and execution prices without placing an order.
quote_order order:readWatch account fills
Read account events; reconnects and dropped events require reconciliation.
await_order_events order:readStart disconnect protection
Start account-wide protection with automatic heartbeats; requires admin enablement.
start_order_session order:cancelInspect disconnect protection
Read this process’s session state and last successful heartbeat.
get_order_session Public endpointStop disconnect protection
Stop this session; may cancel account-wide orders. New submissions require reconnect.
stop_order_session order:cancelPlace a pool bet
Commit a USD amount to an outcome in a pool market.
place_bet bet:placePlace an order
Submit a limit, market, stop loss, or take profit order (optional clientOrderId).
place_order order:placeBatch-place orders
Place 1–32 non-Market orders on one market in one request (legs may fill; one write rate unit).
batch_place_orders order:placeCancel orders
Cancel by orderIds and/or clientOrderIds, or cancel-all when both lists are empty.
cancel_order order:cancelReplace an open Limit order
Replace or amend one open Limit order. quantity is a total fill limit; same-price decreases keep id/priority. Send postOnly: true on reductions.
replace_order order:place, order:cancelBatch-replace open Limit orders
Replace or amend 1–32 open Limit orders (quantity is a total fill limit). Commits even if a leg fails; HTTP 400 when any failed.
batch_replace_orders order:place, order:cancelRequest a withdrawal
Send funds out as CC on Canton or USDC on Ethereum.
request_withdrawal balance:withdrawCheck market maker terms
Read your fee tier, rebates, limits, and exposure.
get_market_maker_profile portfolio:readAwait combo RFQ events
Hold the combo-quotes WebSocket. This process confirms your last-look accepts.
await_combo_quote_events order:readPost a combo quote
Post a price (and optional quantity) against an open combo quote request. Reposting replaces this maker's previous OPEN quote.
post_combo_quote order:placeConfirm a combo quote
Retry confirm only if in-process last-look set confirmError. Accept still has a 3s server window.
confirm_combo_quote order:place03 / Permissions
Read markets, positions, and balances.
Read your account, place bets and orders, and cancel open orders.
Trade and send funds out of your account.
UNHEDGED_MAX_SPEND_PER_SESSION caps bet stakes, buy orders, retail combo BUY commitments, and maker combo collateral in USD. Confirmed retail non-execution releases reservations; uncertain outcomes retain them. Buy budgets that include fees count in full; other fees and withdrawals are excluded. The cap resets when the MCP server restarts.
UNHEDGED_MAX_SPEND_PER_SESSION Caps bet stakes, buy placements, and incremental bid replace notional (above remaining open lock) in USD. Counts full fee-inclusive buy budgets, pending/filled retail combo BUY cost, and worst-side maker combo collateral. Retail non-execution releases reservations; ambiguous outcomes retain them. Other fees and withdrawals are excluded. Resets on restart.04 / Links
A guide to sizing, fills, fees, and failed requests.