SDK

MCP Server

@racehooks/mcp is a Model Context Protocol server that gives AI assistants (Claude, Cursor, Windsurf) direct access to your RaceHooks account.Ask Claude to create webhooks, analyse a race, check delivery health, or set up a fantasy scoring integration without leaving your chat window. The data tools cover Formula 1.

Claude DesktopClaude CodeCursorWindsurf
GitHub repository →npm package →

How it works

The MCP server runs as a local stdio process. It never binds a network port, and your credentials are sent only to the RaceHooks API to obtain an access token. It exposes 59 tools, 7 live resources, and 6 guided prompts to any MCP-compatible client. Every call uses your account's credentials, so what a tool returns depends on your plan. Token refresh is handled automatically.

Installation

bash
npm install -g @racehooks/mcp

Or run directly without installing:

bash
npx -y @racehooks/mcp

The server needs RACEHOOKS_CLIENT_ID and RACEHOOKS_CLIENT_SECRET in its environment and exits on start-up without them.RACEHOOKS_BASE_URL is optional and defaults to https://api.racehooks.io.

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the Windows equivalent:

claude_desktop_config.json
{
  "mcpServers": {
    "racehooks": {
      "command": "npx",
      "args": ["-y", "@racehooks/mcp"],
      "env": {
        "RACEHOOKS_CLIENT_ID":     "your-client-id",
        "RACEHOOKS_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Claude Code

Add the server with the Claude Code CLI:

bash
claude mcp add racehooks \
  -e RACEHOOKS_CLIENT_ID=your-client-id \
  -e RACEHOOKS_CLIENT_SECRET=your-client-secret \
  -- npx -y @racehooks/mcp

Add --scope project to share it with your team through a project .mcp.json, or --scope user to use it in every project. To commit .mcp.json without secrets, reference environment variables:

.mcp.json
{
  "mcpServers": {
    "racehooks": {
      "command": "npx",
      "args": ["-y", "@racehooks/mcp"],
      "env": {
        "RACEHOOKS_CLIENT_ID":     "${RACEHOOKS_CLIENT_ID}",
        "RACEHOOKS_CLIENT_SECRET": "${RACEHOOKS_CLIENT_SECRET}"
      }
    }
  }
}

Cursor / Windsurf

.cursor/mcp.json
{
  "mcpServers": {
    "racehooks": {
      "command": "npx",
      "args": ["-y", "@racehooks/mcp"],
      "env": {
        "RACEHOOKS_CLIENT_ID":     "your-client-id",
        "RACEHOOKS_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Windsurf uses the same JSON in ~/.codeium/windsurf/mcp_config.json.

✦
Your RACEHOOKS_CLIENT_ID and RACEHOOKS_CLIENT_SECRET are on the API Keys page.

Example prompts

>Check my RaceHooks account health
>Create a events.race webhook for https://myapp.com/hook, filtering for Ferrari only
>Compare VER and NOR tyre degradation in the last race
>Show me which feeds are using the most delivery quota today
>Set up a fantasy scoring webhook for my VER, NOR, LEC team at https://scoring.myapp.com/hook
>List all my webhooks and tell me which ones are paused

Tools

All tool inputs are validated with Zod schemas that Claude uses to generate high-quality arguments. The plan line is what the API enforces for that tool.

ℹ
Simulation tools are being updated. The session-replay tools in the current release (start_simulation and related) are not working right now; replay sessions from the console until the updated tools ship.

Live

get_live_sessionCurrent session state: flag, lap, running order, intervals, tyres, and race control messages. Empty when nothing is live.All plans. Free gets the latest milestone classification instead of live timing.
list_events(year, upcoming, limit)Race weekends with session schedules and status.All plans

Post-race insights

list_insight_races(season)Races with a completed post-race analytics bundle.All plans
get_race_insights(raceId)Per-driver, per-lap model outputs (pit, safety car, overtake, undercut, tyre health, cliff risk, LTOE, win probability, expected points) plus pit stops, stints, and lap times.All plans. Free gets tyre state only; strategic predictions need Developer or higher.
get_model_metaPublic model manifest: what each model predicts, model family, calibration tier, and last trained date.All plans
get_session_analytics(sessionId)Per-lap analytics snapshot for a session.Developer or higher
get_race_summary(raceId)Post-race analytics status and aggregate telemetry metrics.All plans. Aggregates need Developer or higher.

Races

get_race(raceId)Race details with results and qualifying grid.All plans. Timing fields need Developer or higher.
get_race_qualifying(raceId)Qualifying results.All plans. Q1/Q2/Q3 times need Developer or higher.
get_race_pitstops(raceId)Pit stop records (driver, stop, lap, duration).All plans
get_race_tyres(raceId)Tyre stints (compound, lap range, tyre age).All plans
get_race_weather(raceId)Lap-by-lap weather.All plans
get_race_laps(raceId, driverId)Per-lap times and positions.Developer or higher
get_event_pace(eventId)Practice and qualifying pace summary per driver.Developer or higher

History

list_drivers(search, nationality, active, limit, offset)Drivers, searchable.All plans. Page size 25 on Free, 100 on paid plans.
get_driver(driverId)Driver profile with career statistics.All plans
get_driver_results(driverId, season)Race-by-race results for a driver.All plans. Timing fields need Developer or higher.
get_driver_standings(driverId, season)Championship standings history for a driver.All plans
list_constructors(lineage, active, limit, offset)Constructors.All plans
get_constructor(constructorId)Constructor profile with lineage history.All plans
get_constructor_results(constructorId, season)Race-by-race results for a constructor.All plans. Timing fields need Developer or higher.
get_constructor_standings(constructorId, season)Championship standings history for a constructor.All plans
list_circuits(country, limit, offset)Circuits with location.All plans
get_circuit(circuitId)Circuit details and analytics.All plans
list_seasonsSeasons with race counts.All plans
get_season_standings(year)Final driver and constructor standings for a season.All plans
get_season_races(year)Races in a season.All plans

Telemetry

get_telemetry_laps(raceId, driverId, lapNumber)Per-lap telemetry aggregates (speed, throttle, brake, DRS, aggression).Developer or higher
get_telemetry_driver_laps(raceId, driverId)Per-lap telemetry for one driver.Developer or higher
get_telemetry_lap_comparison(raceId, lapNumber)Every driver's telemetry for one lap.Developer or higher
get_telemetry_race_summary(raceId)Race-level telemetry summary.Developer or higher
get_race_telemetry_laps(raceId, driverId)Per-lap telemetry metrics from the race data API.Developer or higher
get_race_telemetry_stints(raceId, driverId)Per-stint telemetry and degradation slopes.Custom (not included in Developer)
get_race_telemetry_aggression(raceId)Driver aggression index rankings.Custom (not included in Developer)

Fantasy

get_fantasy_scores(raceId)Estimated F1 Fantasy points per driver with the full scoring breakdown.Developer or higher
get_fantasy_pit_times(sessionId)Pit-stop time leaderboard (stationary time) for a session.Developer or higher

Account, usage and webhooks

list_feeds(limit)Feed catalog with the plan each feed requires.All plans
list_webhooks(limit, offset)Webhook subscriptions on this account.All plans
get_webhook(webhookId)One webhook by ID, with its filters.All plans
create_webhook(feedId, webhookUrl, webhookMethod, filters)Create a webhook with optional driver/constructor/position filters. Returns the signing secret once.All plans
update_webhook(webhookId, webhookUrl, filters, active)Change URL, method, or filters; pause or resume with active.All plans
delete_webhook(webhookId)Delete a webhook.All plans
test_webhook(webhookId)Send a test payload now and return the result.All plans
get_webhook_logs(webhookId, limit)Recent delivery logs.All plans
get_webhook_secret(webhookId)Current signing secret.All plans
rotate_webhook_secret(webhookId)Rotate the signing secret. The old secret stops working immediately.All plans
get_subscriptionTier, plan limits, and usage snapshot.All plans
get_billing_planCurrent plan, limits, usage this period, and billing period dates.All plans
get_usageDeliveries and failures this period, and remaining monthly bucket.All plans
get_usage_by_feedDeliveries broken down by feed this period.All plans
get_usage_latencyDelivery latency percentiles by feed.All plans
get_usage_hourlyHourly deliveries for the last 24 hours.All plans
get_usage_historyDelivery history across past periods.All plans

Resources

Resources are read-only named contexts the assistant loads into its context window without you having to ask. They stay fresh because they are fetched live on each request.

racehooks://feedsRaceHooks feed catalog with tier requirements, loaded into context automatically.
racehooks://liveCurrent live session: flag status, lap counter, full driver standings with tyre compounds.
racehooks://webhooksAll active webhook subscriptions including filter configurations.
racehooks://usageCurrent delivery usage: total this month, failure count, monthly limit, remaining capacity.
racehooks://driversCurrent-season driver roster with car numbers and three-letter codes.
racehooks://circuitsCircuits with location and country.
racehooks://seasonsAvailable seasons with race counts.

Guided prompts

Prompts are workflows that work like slash commands in supporting clients (Claude Desktop, Claude Code). They accept parameters and generate a complete conversational setup sequence.

setup_race_event_webhookGuided workflow: create a events.race webhook with optional driver, constructor, or position filters. Claude collects your endpoint URL and preferences, then creates and tests the webhook.
setup_fantasy_scoring_webhookGuided workflow: create a webhook for a fantasy scoring engine. Accepts your driver list (TLAs) and registers a events.race webhook filtered to those drivers.
check_account_healthFull account health summary: calls get_subscription, get_usage_by_feed, list_webhooks, and get_live_session in parallel, then summarises tier, delivery budget, webhook status, and live session state.
analyze_race_strategyPit strategy, tyre management, and model predictions for one race, optionally focused on one driver. Uses get_race_insights, get_race_laps, get_race_pitstops, and get_race_tyres (lap times need Developer or higher).
compare_driversTwo drivers head-to-head across a race: pace delta, tyre degradation, strategy, and model outputs.
explain_ml_predictionsWhat the models predicted versus what happened in the most recent race with analytics, including each model's calibration tier.

Security

ℹ
The MCP server runs as a local stdio process. It never binds a network port. Your credentials are passed via environment variables and are never included in tool call arguments or resource URIs. All diagnostic output goes to stderr to avoid corrupting the JSON-RPC channel.
← Node.js SDKAnalytics →