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.

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:

FieldMeaning
typeAlways "mcp"
server_labelA name for the server in the response
server_urlThe remote MCP endpoint
authorizationThe 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_toolsThe 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.

ToolWhat it doesCredits
list_sportsEvery sport, its leagues, tool count and route0
find_toolSearch tools by plain words0
describe_toolFull description and input schema for one tool0
run_toolCall a tool by sport, name and argumentsthe 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

QuestionTools calledCredits
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_tool0
Which datasets are stale right now?run_tool (get_data_status)1

Credit costs

CreditsExamples
0Connecting, tools/list, list_sports, find_tool, describe_tool
1list_teams, search_players, get_data_status
2get_standings, get_schedule, get_ratings, get_injuries
5get_game, get_leaders, get_player, get_pitch_mix, get_odds (one game)
10get_plate_appearances, get_plays, get_line_movement, get_player_props, get_prop_history
25get_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

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

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.

Get a free key

Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.