# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-07-11T17:13:39+00:00
import argparse
import json
import os
from typing import *
from typing import Optional
from autogen.mcp.mcp_proxy import MCPProxy
from autogen.mcp.mcp_proxy.security import APIKeyQuery, BaseSecurity
from models import ApodGetResponse
app = MCPProxy(
contact={'email': 'evan.t.yates@nasa.gov'},
description='This endpoint structures the APOD imagery and associated metadata so that it can be repurposed for other applications. In addition, if the concept_tags parameter is set to True, then keywords derived from the image explanation are returned. These keywords could be used as auto-generated hashtags for twitter or instagram feeds; but generally help with discoverability of relevant imagery',
license={
'name': 'Apache 2.0',
'url': 'http://www.apache.org/licenses/LICENSE-2.0.html',
},
title='APOD',
version='1.0.0',
servers=[
{'url': 'https://api.nasa.gov/planetary'},
{'url': 'http://api.nasa.gov/planetary'},
],
)
@app.get(
'/apod',
description=""" Returns the picture of the day """,
tags=['image_retrieval'],
security=[
APIKeyQuery(name="api_key"),
],
)
def get_apod(date: Optional[str] = None, hd: Optional[bool] = None):
"""
Returns images
"""
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)