MCP Server Setup

The Model Context Protocol (MCP) allows LLMs and AI agents to connect directly to external data sources. By connecting to our MCP server, your AI tools gain access to comprehensive horse racing data including racecards, results, form analysis, jockey and trainer statistics, and more.

Once connected, your AI tools can seamlessly interact with the API to provide horse racing information and insights, as well as gaining an improved understanding of coding and development with the API.

Server URL
https://mcp.theracingapi.com

Authentication

You'll need your Racing API credentials to connect. You can find your username and password in the dashboard under My Account after subscribing to a plan.

Web interfaces (claude.ai, chatgpt.com) use OAuth — you'll be redirected to a login page to enter your credentials. Desktop apps, CLIs, and APIs authenticate via HTTP headers included in your configuration.

Select your AI platform for setup instructions:

Web & Desktop App

Requires Pro, Max, Team, or Enterprise plan

These steps work for both claude.ai and the Claude Desktop app.

  1. Go to Settings in Claude
  2. Select Connectors from the sidebar
  3. Click Add custom connector
  4. Enter the connector name: The Racing API
  5. Enter the MCP server URL:
    https://mcp.theracingapi.com
  6. Click Add then click Connect once The Racing API appears in the Connectors list — you will be redirected to a login page where you can enter your Racing API username and password
  7. Once authenticated, The Racing API tools will be available in your conversations

Claude Code (CLI)

Run the following command in your terminal, replacing the placeholder values with your API credentials:

Terminal
claude mcp add --transport http \
  the-racing-api \
  https://mcp.theracingapi.com/ \
  --header "X-RacingAPI-Username: YOUR_USERNAME" \
  --header "X-RacingAPI-Password: YOUR_PASSWORD"

Reference: Custom integrations using remote MCP

Web Interface (chatgpt.com)

Requires Pro, Team, Enterprise, or Edu plan
  1. Go to Settings > Apps > Advanced settings
  2. Enable Developer Mode
  3. Click Create App
  4. Enter the app name as 'The Racing API'
  5. Enter the MCP Server URL:
    https://mcp.theracingapi.com
  6. Ensure Authentication is set to OAuth
  7. Click Create — you will be redirected to a login page — enter your Racing API username and password to authorize the connection
  8. In each new chat, enable Developer Mode from the model picker to use MCP tools

API (Responses API)

Connect to the MCP server programmatically using the Responses API, replacing the placeholder values with your API credentials:

JSON Request Body
{
  "model": "gpt-4.1",
  "tools": [
    {
      "type": "mcp",
      "server_label": "the-racing-api",
      "server_url": "https://mcp.theracingapi.com/",
      "headers": {
        "X-RacingAPI-Username": "YOUR_USERNAME",
        "X-RacingAPI-Password": "YOUR_PASSWORD"
      },
      "require_approval": "never"
    }
  ],
  "input": "What are today's racecards?"
}

Reference: MCP and Connectors — OpenAI API

Web Interface (gemini.google.com)

MCP connectors are not currently supported in the Gemini web interface. Use Gemini CLI instead.

Gemini CLI

Add the following to your Gemini CLI settings file, replacing the placeholder values with your API credentials:

~/.gemini/settings.json
{
  "mcpServers": {
    "the-racing-api": {
      "httpUrl": "https://mcp.theracingapi.com/",
      "headers": {
        "X-RacingAPI-Username": "YOUR_USERNAME",
        "X-RacingAPI-Password": "YOUR_PASSWORD"
      }
    }
  }
}

Reference: MCP servers with the Gemini CLI

Web Interface (grok.com)

MCP connectors are not currently supported in the Grok web interface. Use the xAI API instead.

xAI API

Connect to the MCP server via the xAI API, replacing the placeholder values with your API credentials:

JSON Request Body
{
  "model": "grok-3",
  "tools": [
    {
      "type": "mcp",
      "server_label": "the-racing-api",
      "server_url": "https://mcp.theracingapi.com/",
      "extra_headers": {
        "X-RacingAPI-Username": "YOUR_USERNAME",
        "X-RacingAPI-Password": "YOUR_PASSWORD"
      }
    }
  ],
  "input": [
    {
      "role": "user",
      "content": "What are today's racecards?"
    }
  ]
}

Reference: Remote MCP Tools — xAI

Lovable App

Requires a paid Lovable plan
  1. Go to Settings > Connectors > Personal connectors
  2. Click New MCP server
  3. Enter the server name: The Racing API
  4. Enter the server URL:
    https://mcp.theracingapi.com
  5. Ensure the authentication method is set to OAuth
  6. Click Add & authorize — you will be redirected to a login page where you can enter your Racing API username and password
  7. Once authorized, The Racing API tools will be available as contextual data for the Lovable Agent

Reference: MCP Servers — Lovable Docs