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.
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 planThese steps work for both claude.ai and the Claude Desktop app.
- Go to Settings in Claude
- Select Connectors from the sidebar
- Click Add custom connector
- Enter the connector name: The Racing API
- Enter the MCP server URL:
https://mcp.theracingapi.com - 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
- 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:
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- Go to Settings > Apps > Advanced settings
- Enable Developer Mode
- Click Create App
- Enter the app name as 'The Racing API'
- Enter the MCP Server URL:
https://mcp.theracingapi.com - Ensure Authentication is set to OAuth
- Click Create — you will be redirected to a login page — enter your Racing API username and password to authorize the connection
- 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:
{
"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)
Gemini CLI
Add the following to your Gemini CLI settings file, replacing the placeholder values with your API credentials:
{
"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)
xAI API
Connect to the MCP server via the xAI API, replacing the placeholder values with your API credentials:
{
"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- Go to Settings > Connectors > Personal connectors
- Click New MCP server
- Enter the server name: The Racing API
- Enter the server URL:
https://mcp.theracingapi.com - Ensure the authentication method is set to OAuth
- Click Add & authorize — you will be redirected to a login page where you can enter your Racing API username and password
- Once authorized, The Racing API tools will be available as contextual data for the Lovable Agent
Reference: MCP Servers — Lovable Docs