Skip to content

MCPModel Context Protocol

@predictefy/mcp is a guardrailed Model Context Protocol server for the Predictefy API. It gives AI agents one tool surface over all 16 served venues, including PredictStreet. list_venues reports each venue’s capability notes — read them before assuming a venue has a trades tape or a trading service.

It uses the hosted API via the Predictefy SDK. The default surface registers 50 tools: the 41 read, intelligence, and platform tools below plus the nine paper tools (paper trading), with ten optional guardrailed execution and collateral tools. The ten are off by default; set MCP_ENABLE_TRADE=true or 1 to enable them. Unset or MCP_ENABLE_TRADE=false disables them. See Turning them off to run a server that genuinely cannot trade or move collateral.

This is deliberate agent-surface curation, not REST parity. The MCP surface does not cover every REST operation.

Tools are grouped and parameterized rather than one-per-endpoint: a kind or scope enum selects the verb inside a family, so an agent sees a readable tool list instead of ninety near-identical entries. Since a grouped tool shares one schema across its kinds, a parameter the chosen kind cannot honor is refused with an error naming it, never silently dropped — an agent must never read an unfiltered or unpaged result as if its filter had applied.

Covered operations do not imply parameter parity. get_orderbook and get_trades clamp their limit at 100 versus REST’s 1000. get_ohlcv exposes three resolutions versus REST’s twelve. get_orderbooks accepts up to 100 ids even though REST caps the batch at 50.

Claude Desktop (claude_desktop_config.json) or any MCP-compatible client:

{
"mcpServers": {
"predictefy": {
"command": "npx",
"args": ["-y", "@predictefy/mcp"],
"env": {
"PREDICTEFY_API_KEY": "pk_live_your_key_here"
}
}
}
}

Claude Code one-liner:

Terminal window
claude mcp add predictefy -e PREDICTEFY_API_KEY=pk_live_your_key_here -- npx -y @predictefy/mcp
VariableDefaultPurpose
PREDICTEFY_API_KEY—API key sent as Authorization: Bearer ….
PREDICTEFY_API_URLhttps://data.predictefy.comAPI origin override; the hosted reads origin is the default.
PREDICTEFY_MCP_TIMEOUT_MS15000Per-tool-call time budget (ms).
PREDICTEFY_API_MAX_OFFSET10000The API’s direct-offset cap for page.resumeOffset.
MCP_ENABLE_TRADEfalseRegisters the ten execution/collateral tools only for true or 1; unset and other values leave them off.
MCP_EXEC_BASE_URLhttps://exec.predictefy.comIsolated execution origin used by the exec_* tools.
MCP_EXEC_ALLOWED_HOSTS— (any valid non-metadata host)Optional comma-separated host allowlist for MCP_EXEC_BASE_URL; the configured host must match when set.
ToolWhat it doesServer-side caps
list_venuesThe served venues with capability notes (book tier, trades tape).none (static, no upstream call)
search_marketsText search over markets on one venue, or ALL venues when omitted.max 100 rows
screen_marketsScreen markets with catalog filters and price-change windows.max 100 rows
get_marketOne market by venue + marketId (or slug).50KB response budget
get_eventsEvent-shaped listings on one venue or ALL venues; accepts cursor for pagination.max 100 rows
get_eventOne event (with markets) by venue + eventId (or slug).50KB response budget
get_orderbookLive order book for one outcome (venue + outcomeId).depth clamp 100 when asked
get_orderbooksMany books in one call (outcomeIds csv) → an outcomeId → book map.max 100 ids
get_ohlcvOHLCV candles (resolution 1m/1h/1d, optional start/end).max 5000 candles
get_tradesRecent public trades tape where the venue exposes one.max 100 rows
get_catalog_metadatakind: categories, tags, series, event-metadata, capabilities (has), paginated pages.max 100 rows
get_execution_priceStateless VWAP calculator over a book you pass; detailed adds the partial-fill breakdown.50KB response budget
filter_catalogPure stateless filter over market or event rows you already have.50KB response budget
get_feed_dataReference feeds — kind: list, markets, ticker, tickers, ohlcv, oracle round/history, prices.candles 5000 / rows 100

search_markets and screen_markets take the same price and priceChange* range arguments. price with outcome: "yes" and priceChange24h with outcome: "yes" and no max reach the server as priceMin/priceMax and priceChange24hMin; every other side or bound runs over a bounded page walk that reports meta.localFilter (bounds below). filter_catalog filters the rows you pass with no network call. The hosted POST /api/router/filterMarkets route still exists for direct API callers on plans that include bulk routes. Three other tools always call a bulk route, so they need the Builder plan or above: get_orderbooks (fetchOrderBooks), get_feed_data with kind: "tickers" (the feeds fetchTickers) and get_platform_metadata with kind: "mappings" (/v1/mappings).

Read tools validate their arguments against a strict schema. An undeclared argument returns InvalidParams naming the key and listing the arguments the tool accepts, instead of a silently unfiltered page. A caller that passed a filter the tool did not declare now gets an error it can correct.

Every filter the REST route supports is now declared and forwarded: searchMatch, sortDir, excludeCategories, excludeTags, venues, marketId, slug, eventId, rewardsOnly, volume24hMin, liquidityMin, priceMin, priceMax and priceChange24hMin on search_markets and screen_markets; the catalog filters on get_catalog_metadata per kind; q, series, excludeCategories, excludeTags, venues, undated, sort, sortDir and marketsLimit on get_events; start and end on get_trades; side, at, since and until on get_orderbook; the detail selectors on get_market and get_event; and includeHeld on get_discrepancies.

Two filters that the cluster and scored-trade routes cannot honor are refused loudly: get_discrepancies and get_smart_money declare tags and return a tool error naming category as the working alternative. get_events declares its five event profile controls (searchProfile, topicProfile, topic, searchMatch, searchMode) and refuses them, because the plain event list does not forward them.

price and priceChange24h on the market tools map to the server where the route can express them exactly: price with outcome: "yes" becomes priceMin/priceMax, and priceChange24h with outcome: "yes" and no max becomes priceChange24hMin. Each forwarded bound is the tighter of the range form and the existing scalar argument. The API evaluates priceChange24hMin on its movers list, which takes a narrower filter set: combining priceChange24h with text search or a taxonomy filter returns the API’s NOT_SUPPORTED error naming the extra parameter. A non-yes outcome, or a 24h max the route does not have, stays in the bounded page walk, so no bound is dropped or applied to the wrong side.

The page walk stops at the requested match count, the end of the catalog, 10 upstream pages, 1,000 scanned rows or 8 seconds, whichever comes first. It de-duplicates matches by venue and market id, and reports meta.localFilter with scope: "page-walk", pagesScanned, rowsScanned, matched, unfilteredTotal, exhausted, scanCap and elapsedMs. page.total is the API’s unfiltered total and never the match count. page.resumeOffset continues the walk while exhausted is false; the withheld-page fields replace it when the 50 KB budget drops rows. The walk answer passes through the same byte-budget helper as every other list page.

search_markets, screen_markets, get_events, and get_catalog_metadata with kind: "markets" or kind: "events" accept closeAfter and closeBefore. Other catalog metadata kinds reject these bounds. Use strings containing epoch milliseconds, YYYY-MM-DD (UTC midnight), or RFC 3339 with Z or a +HH:MM/-HH:MM offset. The bounds are exclusive. Undated markets are excluded; events contain only matching members.

Each accepted bound is echoed in the page’s meta beside meta.asOf and meta.provenance. Keep the bounds on continuation requests. The full echo rule, including the CLOSE_BOUNDS_IGNORED refusal, is in the TypeScript SDK close-date section.

The tools apply the same check. A missing, misplaced, or mismatched echo, or an echo for a bound the request did not send, returns isError: true with CLOSE_BOUNDS_IGNORED; the rejected page is never exposed. Calls without bounds are unaffected.

search_markets and screen_markets accept undated, ids, updatedAfter, and sort: "updatedAt". get_catalog_metadata with kind: "markets" accepts undated, ids, and updatedAfter only. Event lists and other catalog metadata kinds reject these controls.

undated takes exclude (default), include, or only; only rejects close bounds. ids is a comma-separated string of up to 80 venue-prefixed market ids; results keep the requested order and meta.count reports the returned match count. updatedAfter is an exclusive lower bound on the row write time and needs an ISO timestamp with seconds and a timezone. sort: "updatedAt" walks row write time ascending and requires lexical search.

Event records returned by get_events add venueVolume24h, the venue-stated parent 24-hour volume in native units, or null. Gemini events state one total only, so their member markets serve null volume. Category totals append the filterable uncategorised slug.

ToolWhat it doesServer-side caps
get_matchesCross-venue matches — scope: market, event, or related (subset/superset outcome edges).max 100 rows
get_matched_marketsBrowse matched pairs ranked by INDICATIVE price difference.max 100 rows
compare_market_pricesOne anchor across venues — kind: venues (per-venue prices) or hedges (opposite-side candidates).max 100 rows
get_clustersCross-venue clusters — kind: canonical (plus clusterId for one cluster’s members), market, event.max 100 rows
get_discrepanciesIndicative discrepancies; clusterId + size runs the fail-closed live qualification instead.stored 100 / live 10
get_arbitrageFully gated live-book execution analysis at a size; optional stake projects a USD budget; executableOnly serves only passing rows.max 500 rows

The optional stake on get_arbitrage is a finite, positive USD budget of at most 1,000,000 with at most two decimal places. It is available only when Predictefy has enabled it; while it is unavailable, supplying stake returns VALIDATION_ERROR with stake is not enabled.

Sports catalogue, screen, and comparison tools are live and metered. get_sports_launches reads the static launch answer, one row per canonical sport. Read the record; do not infer a launch from a sport name. launchStatus is a label, not a filter: preview sports are served too. When the sports surface is not enabled for your account, they return ROUTE_NOT_FOUND. The screen can be unavailable while catalog reads still answer. Unavailable calls are not charged. The grid is a price comparison; avg, fair, edge, and hold are Predictefy’s own calculations, not an arbitrage claim. If a page is truncated, its cursor is withheld to avoid skipping dropped rows; reduce limit or request fewer venues. The complete-set sports arrays (facets, one fixture’s markets, comparison blocks, price history) have no cursor; when sliced they return returned, total and a narrowHint.

ToolWhat it doesServer-side caps
get_sports_launchesLaunch status per sport: launched or preview, with the launch record and soccer settlement disclosure.none (static answer)
get_sports_facetsBrowse facets, competitions, or teams by kind; cascade requires competition.50KB response budget
get_sports_screenCross-venue fixture price comparison with filters, snapshot metadata, and keyset paging.default 5 / max 25 rows
get_fixturesFiltered fixture listings with market-block availability and keyset paging.default 20 / max 100 rows
get_fixtureOne fixture’s identity, market blocks, and snapshot metadata.50KB response budget
compare_fixture_pricesCompare one fixture’s market blocks across venues.50KB response budget
get_fixture_price_historyPrice history of one fixture market block.50KB response budget

get_fixture_price_history requires fixtureId and defaults interval to 1h. It is available only when Predictefy has enabled it; an unavailable route returns ROUTE_NOT_FOUND. If truncated is true, narrow venues, from, or to, or choose a coarser interval to fit the response budget.

ToolWhat it doesServer-side caps
get_market_tradersWallet-attributed trades for one market, with keyset pagination.max 100 rows
get_market_holdersTop holders per outcome for one market.max 100 rows
get_leaderboardVenue profit/volume/score rankings, or cross-venue score rankings.max 100 rows
get_wallet_profileVenue-scoped wallet statistics, score, factors, category, and provenance.50KB response budget
get_wallet_tradesOne wallet’s venue-scoped trade history, keyset-paged.max 100 rows
get_smart_moneyRanked notable scored trades with venue/wallet/market/category filters.max 100 rows

The six trader tools use the live, capability-qualified Trader Intelligence routes. Unsupported venue/verb combinations fail honestly instead of returning made-up empty data. Scores are informational signals, not financial advice, and tool output is not a recommendation.

ToolWhat it doesServer-side caps
get_accountVenue account resources — not the API account (credits: get_usage); owner-read rules further down this page. kind: capabilities, snapshot, balances, positions, open-orders, fills.max 100 rows
get_fundingFunding and bridge INFO — kind: requirements, bridge-status. Artifact-bearing reads are gated.50KB response budget
get_platform_metadatakind: portfolio (public address valuation), mappings, venue-metrics.100 mapping pairs
run_sqlOne read-only SQL statement. Requires an API key with the sql scope, enforced server-side.50KB response budget
get_usageCredit balance, current-period usage and one ledger page of the API account behind the key, not a venue wallet.max 100 rows
get_webhooksThis account’s endpoints (kind=endpoints) or one endpoint’s deliveries.max 100 rows
manage_webhookWrite. action=create or action=rotate (signing secret returned once), or action=delete. All need confirm: true; rotate also needs id. See Rotating a secret.—
create_billing_sessionWrite. Opens a Stripe session URL — kind: checkout, subscribe, portal. Buys nothing itself.—

manage_webhook and create_billing_session are the only non-execution tools that write, and both touch nothing but the caller’s own account through the caller’s own key. They are annotated for what they are — readOnlyHint: false, plus destructiveHint: true on the delete-capable one — rather than hidden behind a read-only hint.

The Stripe webhook callback route is deliberately absent: it is an inbound provider callback with no client meaning, and the TypeScript SDK omits it too.

The nine paper tools below are always registered. A paper order reaches no venue and moves no money, so MCP_ENABLE_TRADE has nothing to gate here. Availability is the API’s decision: every /v1/paper/* route needs an API key carrying the trade scope, and each plan caps how many paper orders may be open at once. See Paper trading for the simulation itself.

ToolWhat it doesServer-side caps
paper_accountThe simulated USD account. reserved is a hold inside cash, so free cash is the difference.50KB response budget
paper_reset_accountWrite. Restarts the simulation — working orders canceled, positions flattened, fills kept. Needs confirm: true.—
paper_place_orderWrite. Places a simulated order against the real book. idempotencyKey is required and never minted for you.—
paper_list_ordersThis account’s paper orders, newest first, filtered by status and/or venue, cursor-paged.max 100 rows
paper_get_orderOne paper order together with its fills — the only read that carries them.50KB response budget
paper_cancel_orderWrite. Cancels one working order and releases its unspent hold; filled size stays filled.—
paper_list_fillsEvery simulated fill on this account, newest first, cursor-paged.max 100 rows
paper_positionsPer-outcome size, average cost, realized PnL, and a catalog mark (null when unmarkable).50KB response budget
paper_portfolioThe account, its positions, and their totals from ONE consistent snapshot (asOf).50KB response budget

Only paper_reset_account previews. It is the one paper call that cannot be undone — working orders are canceled and positions flattened, and nothing restores them — so it does nothing unless passed confirm: true. Placing and cancelling a simulated order need no confirmation step: nothing is at risk, a cancel only releases a hold, and the required caller-chosen idempotencyKey already makes a retry replay the stored order instead of placing a second one.

Refusals name what to do about them. SCOPE_MISSING means the key lacks the trade scope, PLAN_REQUIRED means the plan gate answered, and PAPER_WORKING_ORDER_CAP means the plan’s open-order allowance is full — cancel a working order or move to a larger plan. PAPER_NO_LIVE_BOOK is a refusal rather than a verdict on the order: no live book is captured for that outcome, so nothing could fill it.

The ten execution and collateral tools below are off by default. Enable them with MCP_ENABLE_TRADE=true or 1; new API keys default to read, so opt into trade per key in the console. Existing keys are unchanged. MCP_EXEC_BASE_URL defaults to the canonical isolated execution origin https://exec.predictefy.com; set it explicitly to point at another execution environment. A malformed or link-local/cloud-metadata value refuses to boot rather than risk sending a signed order to the wrong server.

ToolWhat it does
exec_venuesRead-only: which venues are enabled now (build/submit/cancel/modify per venue).
exec_quoteRead-only preview of the live-book cost. Nothing is built, signed, or submitted.
exec_prepareBuilds an unsigned order artifact; it never signs.
exec_submitRelays a client-signed artifact. Dry-run unless confirm is exactly true.
exec_cancelBuilds an unsigned cancel intent. It cancels nothing on its own.
exec_modifyBuilds an unsigned modify intent for a resting order.
exec_refreshRe-reads one execution’s venue status with a transient, never-stored credential.
exec_ordersRead-only: kind order, list, trades, positions, or balance for this account.
prepare_fundingBuilds unsigned collateral steps, opens a bridge session, or reports a payment.
get_funding_artifactsRead-only funding reads that RETURN signable artifacts: transfer plan, bridge quote, bridge session.

Cancel and modify follow exactly the same shape as prepare: they hand back an unsigned artifact for your own wallet to sign, and the signed artifact goes back through exec_submit. Nothing is ever signed server-side, and no tool both builds and submits.

prepare_funding and get_funding_artifacts sit with this surface because both hand back caller-signable, collateral-moving transactions. Only the purely informational funding lookups (venue requirements and transfer status) stay ungated, on get_funding. One honest caveat: get_funding kind=bridge-status relays the bridge provider’s status payload verbatim (thin-client), so its artifact-freedom is provider-shaped rather than structurally enforced by Predictefy.

Leave MCP_ENABLE_TRADE unset or set it to false in the server’s environment. The ten tools above are then not registered at all, and the surface is exactly the forty-one read, intelligence, and platform tools listed earlier plus the nine paper tools — nothing that can trade real money or move collateral, and nothing that hands back a transaction to sign.

{
"mcpServers": {
"predictefy": {
"command": "npx",
"args": ["-y", "@predictefy/mcp"],
"env": {
"PREDICTEFY_API_KEY": "pk_live_your_key_here",
"MCP_ENABLE_TRADE": "false"
}
}
}
}

No tool both builds and submits an order, and no signing endpoint exists. The execution service still enforces trade scope, spend caps, artifact bounds, and idempotency.

Guardrails (designed in, enforced server-side)

Section titled “Guardrails (designed in, enforced server-side)”
  • Hard limit clamps — most list tools cap at 100 rows, live discrepancy lists at 10 rows, and get_ohlcv at 5,000 candles at the wire, regardless of what the model asks for.
  • Response byte budget — payloads over ~50KB are truncated with an explicit "truncated": true + note (never silently).
  • Paged list tools never skip rows: an oversized page is fetched again at the largest limit that fits, so the response’s own continuation key continues exactly after the last row shown. That key is envelope-specific: page.nextCursor when the page object carries it, the top-level nextCursor on the account, paper and arbitrage envelopes, and page.offset plus page.limit on an offset page. A reduced page carries truncated: true, the unchanged truncatedNote, and page.limitReduced (requested, served, reason, requests, and a note naming that key), where requests counts every page request the call made. The refetch starts only when the remaining tool budget can hold another fetch of the first page’s duration plus a 2,000 ms margin, and it runs under the remaining time minus that margin, so a slow backend or a 429 backoff aborts it inside the tool deadline. If rows grow between refetches, the tool retries at most twice; after that, or when the refetch fails, the cursor is withheld: page.nextCursor is null, the top-level nextCursor is removed, page.hasMore is true, page.returned and page.limit are the rows shown, and the page carries page.resumeOffset (offset paging, equal to page.offset plus page.limit) or page.restartRequired (cursor paging) plus a cursorWithheld sentence. get_arbitrage never refetches: an oversized walk goes straight to the withheld page. If even one row does not fit, the response keeps the JSON-prefix preview with no resume fields. An exec_orders list whose data is not an array fails with EXEC_INVALID_RESPONSE, never an empty list.
  • Complete-set arrays: get_ohlcv, the get_sports_facets lists, get_fixture, compare_fixture_prices, get_fixture_price_history, filter_catalog, and the get_feed_data array kinds have no cursor; when sliced they add returned, total and a narrowHint naming an input that narrows the next call.
  • Bounded local filter walk: search_markets and screen_markets forward the yes-side price and priceChange24h bounds to the server, and walk at most 10 pages, 1,000 rows or 8 seconds for every other price or price-change bound. The walk stops early at the requested match count, de-duplicates by venue and market id, and reports meta.localFilter (pagesScanned, rowsScanned, matched, unfilteredTotal, exhausted, scanCap, elapsedMs). page.total is the API’s unfiltered total, never the match count, and page.resumeOffset continues the walk when rows remain.
  • Strict read-tool arguments: every read tool validates its arguments against a strict schema. An undeclared argument returns InvalidParams naming the key and listing the accepted arguments, never a silently unfiltered page. get_discrepancies and get_smart_money declare tags and refuse it with a tool error naming category as the working alternative.
  • Per-request timeout — a hung upstream surfaces a clean MCP error after 15s (configurable), never a hang.
  • Input validation — unknown venues are rejected before any upstream call, with the full valid venue list in the error.
  • No secrets in output — the API key is redacted from every error path.
  • Honest annotations — every read tool is annotated readOnlyHint: true, and every tool that writes says so. exec_quote, exec_venues, and exec_orders are read-only; exec_prepare, exec_cancel, exec_modify, exec_refresh, prepare_funding, and create_billing_session are not read-only; exec_submit and manage_webhook are destructive — and both still preview unless passed confirm: true — manage_webhook on create, delete, and rotate. The paper writes follow the same rule: paper_place_order is not read-only, while paper_reset_account and paper_cancel_order are destructive, and only the reset previews unless passed confirm: true.
  • myriad has a dual book model: myriad:ob:* markets serve native CLOB depth, while AMM markets expose an emulated indicative top-of-book. gemini serves real sized CLOB depth. Only rain is wholly emulated as a one-level synthetic book. list_venues reports the tier per venue.
  • Cross-venue price gaps served by the platform are labeled indicative price discrepancy — observed price gaps (stored Yes prices by default, live order-book mid-prices with live=true), not executable opportunities.
  • get_trades returns the server’s honest NOT_SUPPORTED error on venues without a public tape.
  • Trader tools return the server’s honest TRADERS_UNSUPPORTED error when a venue or trader verb is unavailable. Cross-venue get_leaderboard calls require by=score; wallets stay venue-scoped, and window=all means “since collection began” for the scored-trade feed.
  • There are no streaming tools. MCP is request/response, so the WebSocket surface — live books, trades, price frames, and the arbitrage feed — has no MCP equivalent, and none is faked. Use get_arbitrage for a point-in-time snapshot of the arbitrage stream, and the SDK watch* verbs or the raw WebSocket when you need a live subscription.
  • Data Feeds (get_feed_data) are reference price sources — Binance spot and Chainlink oracles — not prediction-market venues. Their orderbook kind is a permanent capability gap: reference feeds publish prices, not depth, so it always answers NOT_SUPPORTED.
  • get_account reads one venue wallet or trading account, not the Predictefy API account. Use get_usage for API credits and usage. Every kind except capabilities needs a public address as accountId. Owner-authenticated reads are unavailable because this hosted server holds no venue credentials. Dedicated requests for owner-authenticated resources return 400 ACCOUNTS_UNSUPPORTED from the hosted API with the resource’s state and the venue’s recorded reason; where the SDK could serve the read locally with credentials, the error also names the venueCredentials.<venue> configuration to supply. snapshot reports per-resource availability. The SDK maps ACCOUNTS_UNSUPPORTED to NotSupportedError without changing .code.
  • run_sql needs an API key carrying the sql scope. The server enforces the scope and read-only access; a key without it gets a plain authorization error.
  • The paper tools need a key carrying the trade scope, exactly like the execution tools: a read-only key can never place even a simulated order. Paper trading itself is open on every plan, which differ only in how many paper orders may be open at once.