Predict.aiDocs
V1Guides

MCP — connect your AI

The official predictAI MCP server puts the whole platform in your AI agent's hands — forecasts, goals, anomaly detection, and live events, over the Model Context Protocol.

predictAI ships an official MCP server — a Model Context Protocol integration that lets AI agents (Claude, Cursor, ChatGPT connectors, or anything MCP-capable) operate the platform for you. Ask your assistant "upload this CSV and tell me if next week looks risky" and it composes the right API calls: ingestion, a goal, a forecast, an alert — no code, no docs-diving.

Everything in these docs is reachable through it: 39 curated, task-oriented tools covering signals, segments, goals, foundation models, pipelines, trainings, deployments, predictions, scenarios, alerts, and billing — including quick_forecast, which turns a raw CSV into a zero-shot forecast in a single tool call, and three wait tools that turn the platform's asynchronous jobs into single tool calls by listening on the realtime WebSocket stream.

Two ways to connect

Hosted (recommended)Local (npm)
SetupPaste a URL, sign in with your emailnpx + an API token in env
AuthOAuth 2.1 — no token handlingYour API token
Works withWeb clients (Claude web, ChatGPT) and desktopDesktop clients (Cursor, Claude Desktop, Claude Code)
RunsOn predictAI's infrastructureOn your machine

Hosted — paste a URL

Add the endpoint to any MCP client:

https://mcp.predict.ai/mcp

On first use your browser opens a predictAI consent page. Enter your email, click the sign-in link we send you — the same login as the app — and pick the workspace the client may use, or create a fresh one right there (agents often deserve their own isolated space; brand-new accounts start with one this way too). Behind the scenes an API token named after the client (e.g. MCP — Cursor) is created in your account and sealed into the OAuth credential handed to the client. You never copy a token, and you stay in control: the token shows up under Settings → API tokens, and revoking it kills the grant instantly. (Prefer to bring your own token? There's a "paste an API token" option on the same page.)

In Cursor (~/.cursor/mcp.json) or any client that takes a URL:

{
  "mcpServers": {
    "predictai": { "url": "https://mcp.predict.ai/mcp" }
  }
}

One URL for every account, regardless of region: the consent flow resolves your account's home region and bakes it into the grant, so every tool call is routed to where your data lives.

Prefer to skip the browser flow? The hosted endpoint also accepts your API token directly as a Bearer credential:

{
  "mcpServers": {
    "predictai": {
      "url": "https://mcp.predict.ai/mcp",
      "headers": {
        "Authorization": "Bearer pa_live_...",
        "X-Workspace-Id": "ws_..."
      }
    }
  }
}

Local — run it yourself

The same server ships as an npm package for stdio-based clients. No infrastructure, talks to the normal REST API from your machine:

{
  "mcpServers": {
    "predictai": {
      "command": "npx",
      "args": ["-y", "predictai-mcp"],
      "env": {
        "PREDICTAI_TOKEN": "pa_live_...",
        "PREDICTAI_WORKSPACE_ID": "ws_..."
      }
    }
  }
}

Or with the Claude Code CLI:

claude mcp add predictai -e PREDICTAI_TOKEN=pa_live_... -e PREDICTAI_WORKSPACE_ID=ws_... -- npx -y predictai-mcp
Environment variableRequiredWhat it does
PREDICTAI_TOKENYesAn API token (pa_live_...).
PREDICTAI_WORKSPACE_IDNoDefault workspace scope. Without it, the agent starts with list_workspaces and passes workspace_id per call.
PREDICTAI_BASE_URLNoAPI base URL override. The default works for every account — region redirects are followed automatically.

The tools

Tools are task-oriented, not endpoint-shaped — descriptions are written for agents, and results include "what to do next" hints.

GroupTools
Quick winquick_forecast — CSV in, forecast out, one call (upload → segment → zero-shot foundation model → prediction)
Orientlist_workspaces · create_workspace · get_workspace_overview
Datapush_signals · record_event · upload_csv · get_ingestion_status · delete_signals
Explorelist_signals · analyze_correlations · analyze_causality · list_segments · create_segment · preview_segment
Goals (autopilot)create_goal · list_goals · get_goal · get_goal_forecast · get_goal_drivers · run_scenario · run_sensitivity_analysis · preview_alert · create_alert · list_notifications
Models & pipelineslist_foundation_models · deploy_foundation_model · create_pipeline · trigger_training · list_trainings · get_training · deploy_trained_model · get_deployment_status · get_prediction
Billingget_billing_balance · estimate_cost
Wait (realtime)wait_for_ingestion · wait_for_training · wait_for_goal

Read-only tools (lists, gets, previews, analyses, and the wait tools) declare the standard readOnlyHint annotation, so MCP clients that auto-approve safe tools can run them without a confirmation prompt.

The one destructive tool, delete_signals, declares destructiveHint (clients that gate dangerous tools will ask before running it) and permanently removes every stored value for the selected signal keys and/or event streams. It follows the same safety net as the app: marketplace-subscribed (read-only) signals are skipped, and if a selected key is published on the marketplace nothing is deleted — the call returns a confirmation summary (listings, subscriber counts) and only proceeds when re-called with force=true.

The async story — wait tools

Trainings, CSV imports, and goal setup are asynchronous: the API returns an id immediately and the work happens in the background. Most platforms make agents poll. predictAI's MCP server instead subscribes to the realtime event stream and holds the tool call open until the terminal event arrives — an hour of tournament becomes one tool call from the agent's point of view.

ToolListens forReturns
wait_for_ingestioningestion.execution.completed / failedThe final execution record — rows processed, signals created.
wait_for_trainingtraining.job.completed / failedThe full training record — pool scores, the winner, accuracy.
wait_for_goalgoal.status: serving or goal.run.failedThe goal — champion, drivers, plus every stage event seen along the way.

Each takes a timeout_s (default 300). On timeout it doesn't fail — it returns "status": "still_running" with the latest progress and the agent simply calls it again. Before listening, each tool checks current state over REST, so an already-finished job returns instantly. And the socket is the fast path, not a single point of failure: a REST poll runs alongside it, so even if the realtime stream is unreachable or drops an event, the tool still answers — it can never hang.

While a wait is in flight the server streams MCP progress notifications (when the client sends a progressToken), so clients that reset their request timeout on progress — Cursor, Claude, and most modern MCP clients do — never abort a long wait. Cancelling the request on the client side stops the wait immediately.

What a session looks like

The shortest possible session is one tool call:

You: Here's stocks.csv — predict the close price in 5 days.

Agent: (calls quick_forecast with the CSV, target: "close", horizon: 120, interval_seconds: 3600)

The zero-shot forecast puts the close at ~103.4 in 5 days, with an 80% band of 98.1–108.9.

One call uploads the data, waits for the import, builds the segment, deploys a pretrained foundation model, and returns the forecast — no training, no tournament, seconds not minutes.

When the user wants predictions that keep improving and watch themselves:

You: Here's orders.csv — what does next month look like, and warn me if a bad week is coming.

Agent: (calls upload_csvwait_for_ingestioncreate_goal with goal_type: forecast_valuewait_for_goalget_goal_forecastpreview_alertcreate_alert)

Next month averages ~13,400 orders/day with a mid-month dip the model attributes to your post-promo lull. I've armed an alert that pings Slack if any week trends into the bottom 10% of the expected range.

Seven API operations — two of them long-running — from one sentence.

Errors, spend, and safety

  • Errors are structured. Every failure returns the API's error envelope — machine-readable code, HTTP status, details — plus a hint where one helps (e.g. insufficient_credits points the agent at get_billing_balance).
  • Spend is visible. estimate_cost prices trainings and goals before they run; server instructions tell agents to check when the user cares about cost.
  • Scopes apply. The server can only do what the underlying API token's scopes allow, and OAuth grants are pinned to a single workspace. Revoke the token, and every credential minted from it dies with it.

For agents reading this

If you are an AI agent with these tools available: start with get_workspace_overview, prefer goals over manual pipelines, never poll in a loop (use the wait tools), and check estimate_cost before training when the user has mentioned budget.

On this page