# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T03:32:15+00:00
import argparse
import json
import os
from typing import *
from typing import Optional, Union
from autogen.mcp.mcp_proxy import MCPProxy
from autogen.mcp.mcp_proxy.security import BaseSecurity
from starlette.requests import Request
from models import (
AccessTokenInfoResponse,
Error,
RefreshTokenInfoResponse,
TokenResponseIF,
)
app = MCPProxy(
title='',
version='v1',
servers=[{'url': 'https://api.hubapi.com/'}],
)
@app.get('/oauth/v1/access-tokens/{token}', tags=['oauth_access_management'])
def get__oauth_v1_access_tokens__token__get(token: str):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.delete('/oauth/v1/refresh-tokens/{token}', tags=['oauth_access_management'])
def delete__oauth_v1_refresh_tokens__token__archive(token: str):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get('/oauth/v1/refresh-tokens/{token}', tags=['oauth_access_management'])
def get__oauth_v1_refresh_tokens__token__get(token: str):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post('/oauth/v1/token', tags=['oauth_access_management'])
def post__oauth_v1_token_create(request: Request):
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)