# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T09:36:22+00:00
import argparse
import json
import os
from typing import *
from autogen.mcp.mcp_proxy import MCPProxy
from autogen.mcp.mcp_proxy.security import APIKeyHeader, APIKeyQuery, BaseSecurity
from models import (
FieldFormatDfsSlatesByTournamentTournamentidGetResponse,
FieldFormatInjuriesByHistoricalGetResponse,
FieldFormatInjuriesGetResponse,
FieldFormatNewsByDateDateGetResponse,
FieldFormatNewsByPlayerIDPlayeridGetResponse,
FieldFormatNewsGetResponse,
FieldFormatPlayerSeasonStatsSeasonGetResponse,
FieldFormatPlayersGetResponse,
FieldFormatPlayerTournamentProjectionStatsTournamentidGetResponse,
FieldFormatTournamentsGetResponse,
FieldFormatTournamentsSeasonGetResponse,
Format,
Leaderboard,
Player,
PlayerTournament,
Season,
)
app = MCPProxy(
contact={'x-twitter': 'nfldata'},
title='Golf v2',
version='1.0',
servers=[
{'url': 'http://azure-api.sportsdata.io/golf/v2'},
{'url': 'https://azure-api.sportsdata.io/golf/v2'},
],
)
@app.get(
'/{format}/CurrentSeason',
tags=['season_data'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def current_season(format: Format = 'XML'):
"""
Current Season
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/DfsSlatesByTournament/{tournamentid}',
tags=['tournament_leaderboard_info'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def dfs_slates(format: Format = 'XML', tournamentid: str = ...):
"""
DFS Slates
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/Injuries',
tags=['player_injury_tracking'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def injuries(format: Format = 'XML'):
"""
Injuries
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/InjuriesByHistorical',
tags=['player_injury_tracking'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def injuries_historical(format: Format = 'XML'):
"""
Injuries (Historical)
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/Leaderboard/{tournamentid}',
tags=['tournament_leaderboard_info'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def leaderboard(format: Format = 'XML', tournamentid: str = ...):
"""
Leaderboard
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/News',
tags=['tournament_news'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def news(format: Format = 'XML'):
"""
News
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/NewsByDate/{date}',
tags=['tournament_news'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def news_by_date(format: Format = 'XML', date: str = ...):
"""
News by Date
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/NewsByPlayerID/{playerid}',
tags=['tournament_news', 'player_profile_retrieval'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def news_by_player(format: Format = 'XML', playerid: str = ...):
"""
News by Player
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/Player/{playerid}',
tags=['player_stats_analysis', 'player_profile_retrieval'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def player(format: Format = 'XML', playerid: str = ...):
"""
Player
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/PlayerSeasonStats/{season}',
tags=['season_data', 'player_stats_analysis'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def player_season_stats_w_world_golf_rankings(
format: Format = 'XML', season: str = ...
):
"""
Player Season Stats (w/ World Golf Rankings)
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/PlayerTournamentProjectionStats/{tournamentid}',
tags=['player_stats_analysis', 'tournament_leaderboard_info'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def player_tournament_projected_stats_w_draftkings_salaries(
format: Format = 'XML', tournamentid: str = ...
):
"""
Player Tournament Projected Stats (w/ DraftKings Salaries)
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/PlayerTournamentStatsByPlayer/{tournamentid}/{playerid}',
tags=['player_stats_analysis', 'tournament_leaderboard_info'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def player_tournament_stats_by_player(
format: Format = 'XML', tournamentid: str = ..., playerid: str = ...
):
"""
Player Tournament Stats By Player
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/Players',
tags=['player_stats_analysis', 'player_profile_retrieval'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def players(format: Format = 'XML'):
"""
Players
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/Tournaments',
tags=['season_data'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def schedule(format: Format = 'XML'):
"""
Schedule
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/{format}/Tournaments/{season}',
tags=['season_data'],
security=[
APIKeyHeader(name="Ocp-Apim-Subscription-Key"),
APIKeyQuery(name="key"),
],
)
def schedule_by_season(format: Format = 'XML', season: str = ...):
"""
Schedule by Season
"""
raise RuntimeError("Should be patched by MCPProxy and never executed")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="MCP Server")
parser.add_argument(
"transport",
choices=["stdio", "sse", "streamable-http"],
help="Transport mode (stdio, sse or streamable-http)",
)
args = parser.parse_args()
if "CONFIG_PATH" in os.environ:
config_path = os.environ["CONFIG_PATH"]
app.load_configuration(config_path)
if "CONFIG" in os.environ:
config = os.environ["CONFIG"]
app.load_configuration_from_string(config)
if "SECURITY" in os.environ:
security_params = BaseSecurity.parse_security_parameters_from_env(
os.environ,
)
app.set_security_params(security_params)
mcp_settings = json.loads(os.environ.get("MCP_SETTINGS", "{}"))
app.get_mcp(**mcp_settings).run(transport=args.transport)