MCP server
OpenAI Agents SDK Sports Data MCP: Responses API Setup
The hosted SportsDataHQ MCP server at https://mcp.sportsdatahq.com/mcp works as a remote MCP tool in the OpenAI Responses API and as a streamable HTTP server in the Agents SDK. It gives agents nine sports with box scores, play-by-play, ratings and odds history. 1,000 free credits a month.
Which setup fits
OpenAI offers three routes to a remote MCP server, and the right one depends on who should hold the connection.
- Responses API remote MCP tool. You declare the server in the
toolsarray and OpenAI's platform connects to it, lists its tools and calls them during the response. Good for a backend that already uses the Responses API. - Agents SDK with `HostedMCPTool`. The same remote tool, declared inside an agent. The server is not added to
mcp_servers, because the Responses API connects for you. - Agents SDK with `MCPServerStreamableHttp`. Your own process connects, lists tools and forwards calls. Good when you want to set headers yourself, cache the tool list or run the connection from inside a private network.
All three reach the same URL. The server is read-only and hosted, and nothing installs on your machine. Because the Responses API connects from OpenAI's side, the server has to be reachable from the public internet, which this one is.
The configuration shapes here come from OpenAI's current documentation: the Responses API remote MCP guide and the Agents SDK MCP page, both read on December 6, 2026. OpenAI changes these interfaces often, so check them before you ship.
Get a key
Create a free key at app.sportsdatahq.com. The server accepts it in an x-api-key header, and also as a bearer token in an Authorization header, which is what the Responses API authorization field sends. Connecting and listing tools cost no credits.
Responses API remote MCP
from openai import OpenAI
import os
client = OpenAI()
resp = client.responses.create(
model="YOUR_MODEL",
tools=[
{
"type": "mcp",
"server_label": "sportsdatahq",
"server_url": "https://mcp.sportsdatahq.com/mcp",
"authorization": os.environ["SDHQ_API_KEY"],
"require_approval": "never",
"allowed_tools": ["list_sports", "find_tool", "describe_tool", "run_tool"],
}
],
input="Who hit the most home runs in MLB this season?",
)
print(resp.output_text)What each field does, per OpenAI's guide:
| Field | Meaning |
|---|---|
type | Always "mcp" |
server_label | A name for the server in the response |
server_url | The remote MCP endpoint |
authorization | The access token the server expects; the Responses API does not store it, so send it on every request |
require_approval | "always", "never", or an object naming tools that skip approval |
allowed_tools | The tool names to import |
Replace YOUR_MODEL with a model that supports tools. A sport route such as https://mcp.sportsdatahq.com/mcp/mlb imports that sport's tools directly, 26 for baseball, and allowed_tools can then name just the ones you want.
OpenAI's page does not document a custom headers field for this tool, so this draft uses authorization. If you need the x-api-key header specifically, use the Agents SDK route below.
Agents SDK with a streamable HTTP server
import asyncio
import os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main():
async with MCPServerStreamableHttp(
name="SportsDataHQ",
params={
"url": "https://mcp.sportsdatahq.com/mcp",
"headers": {"x-api-key": os.environ["SDHQ_API_KEY"]},
},
cache_tools_list=True,
) as server:
agent = Agent(
name="Sports analyst",
instructions="Use the sports tools for every number. Say which tool you used.",
mcp_servers=[server],
)
result = await Runner.run(agent, "Show the 2026 MLB standings leader and its run differential.")
print(result.final_output)
asyncio.run(main())cache_tools_list=True is safe here because the hub root exposes four discovery tools that rarely change. OpenAI's docs say to enable caching only when tool definitions are stable, and to call invalidate_tools_cache() to refresh.
How the hub tools work
The root URL keeps the tool list short for the model.
| Tool | What it does | Credits |
|---|---|---|
list_sports | Every sport, its leagues, tool count and route | 0 |
find_tool | Search tools by plain words | 0 |
describe_tool | Full description and input schema for one tool | 0 |
run_tool | Call a tool by sport, name and arguments | the tool's price |
With only four tool definitions in context, the model uses fewer tokens before it starts, then discovers what it needs.
Example questions and the tools they call
| Question | Tools called | Credits |
|---|---|---|
| Who led MLB in home runs this season? | find_tool, run_tool (get_leaders) | 5 |
| Show one pitcher's pitch mix with velocity and whiff rate. | run_tool (search_players, get_pitch_mix) | 1 + 5 |
| Which NBA teams have the best Elo ratings today? | run_tool (get_ratings) | 2 |
| How did a game's total move before the start? | run_tool (get_line_movement) | 10 |
| What does the standings tool cost, and what arguments does it take? | describe_tool | 0 |
| Which datasets are stale right now? | run_tool (get_data_status) | 1 |
Credit costs
| Credits | Examples |
|---|---|
| 0 | Connecting, tools/list, list_sports, find_tool, describe_tool |
| 1 | list_teams, search_players, get_data_status |
| 2 | get_standings, get_schedule, get_ratings, get_injuries |
| 5 | get_game, get_leaders, get_player, get_pitch_mix, get_odds (one game) |
| 10 | get_plate_appearances, get_plays, get_line_movement, get_player_props, get_prop_history |
| 25 | get_prop_backtest, and get_line_movement in football and hockey |
Agents can loop, so give the model a budget in its instructions, for example "at most 10 data calls per question", and tell it to pass estimate_only first on any tool that supports it.
Verified examples you can run now
OpenAI's side of these snippets needs your own OpenAI key, so the commands below verify the server half: the same URL, headers and tool calls your agent will make. Export your key as KEY first. Each was run on December 6, 2026 and returned HTTP 200.
The authorization style the Responses API sends, a bearer token, against the baseball route (0 credits):
curl -s -X POST https://mcp.sportsdatahq.com/mcp/mlb \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'It lists 26 tools.
The handshake an Agents SDK client performs (0 credits):
curl -s -X POST https://mcp.sportsdatahq.com/mcp \
-H "x-api-key: $KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}'The server answered with protocol version 2025-03-26 and the name sportsdatahq.
The call the agent makes through run_tool (2 credits):
curl -s -X POST https://mcp.sportsdatahq.com/mcp \
-H "x-api-key: $KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"run_tool","arguments":{"sport":"mlb","tool":"get_standings","arguments":{"season":2026}}}}'The first row was Milwaukee at 103 wins and 59 losses.
And the same data over REST, for a function tool in your own code (5 credits):
curl -s -X POST https://api.sportsdatahq.com/v1/mlb/get_leaders \
-H "x-api-key: $KEY" \
-H "Content-Type: application/json" \
-d '{"stat": "hr", "season": 2026, "limit": 3}'When not to use this
- You want the model to place or size a bet. Odds tools return prices and probabilities as market data. They do not recommend a wager, work out a stake or place anything.
- You need in-play data. Odds and props are pre-game only.
- You need the server on a private network. The Responses API connects from OpenAI's side, so it needs a public URL. Use the Agents SDK route from inside your network instead.
- You want a raw feed to resell. You may store the data, train models, backtest and build products that show your users what you derive. You may not redistribute the data, or odds as a raw feed.
- You want a whole season in bulk. An agent pulling it call by call is slow and costs credits. A Parquet data package is one download.
- You need a fixed answer every time. A model chooses tools, so two runs can take different paths. For a scheduled report, call the REST endpoints from code.
Related pages
For other clients see Claude Code and Cursor. For odds history see the historical odds MCP server. Per-sport pages: NBA, NFL, NHL, MLB and soccer.
Try it
- Get a free key: 1,000 credits a month, no card.
- Download a data package if you want a full season in a file.
FAQ
Which OpenAI interface should I use with this server?
Use the Responses API remote MCP tool when you want OpenAI to call the server for you, or MCPServerStreamableHttp in the Agents SDK when your own process should connect and own the headers. Both reach the same hosted server at https://mcp.sportsdatahq.com/mcp.
How do I authenticate from the Responses API?
Pass your key in the tool's authorization field. The server accepts the key as an Authorization bearer token as well as an x-api-key header, and OpenAI documents that it does not store the authorization value, so send it on every request.
Can ChatGPT use the same server?
Yes, through developer mode, which OpenAI offers on workspace plans and which may need an admin to enable. Add a custom MCP connector, paste the URL and choose OAuth, so no key is copied into the chat.
How do I stop the model from spending too many credits?
Limit the tools with allowed_tools, keep approvals on for expensive calls, and ask the model to price a call with estimate_only first. Connecting and listing tools are free, and data calls cost 1 to 25 credits.
Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.