# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T11:04:38+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, HTTPBasic
from fastapi import Path, Query
from pydantic import conint
from starlette.requests import Request
from models import (
MicrovisorV1AccountConfig,
MicrovisorV1AccountSecret,
MicrovisorV1App,
MicrovisorV1AppAppManifest,
MicrovisorV1Device,
MicrovisorV1DeviceDeviceConfig,
MicrovisorV1DeviceDeviceSecret,
V1AppsGetResponse,
V1ConfigsGetResponse,
V1DevicesDeviceSidConfigsGetResponse,
V1DevicesDeviceSidSecretsGetResponse,
V1DevicesGetResponse,
V1SecretsGetResponse,
)
app = MCPProxy(
contact={
'email': 'support@twilio.com',
'name': 'Twilio Support',
'url': 'https://support.twilio.com',
},
description='This is the public Twilio REST API.',
license={
'name': 'Apache 2.0',
'url': 'https://www.apache.org/licenses/LICENSE-2.0.html',
},
termsOfService='https://www.twilio.com/legal/tos',
title='Twilio - Microvisor',
version='1.42.0',
servers=[{'url': 'https://microvisor.twilio.com'}],
)
@app.get(
'/v1/Apps',
description=""" Retrieve a list of all Apps for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def list_app(
page_size: Optional[conint(ge=1, le=1000)] = Query(None, alias='PageSize'),
page: Optional[conint(ge=0)] = Query(None, alias='Page'),
page_token: Optional[str] = Query(None, alias='PageToken'),
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Apps/{AppSid}/Manifest',
description=""" Retrieve the Manifest for an App. """,
tags=['app_management'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_app_manifest(app_sid: str = Path(..., alias='AppSid')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.delete(
'/v1/Apps/{Sid}',
description=""" Delete a specific App. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def delete_app(sid: str = Path(..., alias='Sid')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Apps/{Sid}',
description=""" Fetch a specific App. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_app(sid: str = Path(..., alias='Sid')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Configs',
description=""" Retrieve a list of all Configs for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def list_account_config(
page_size: Optional[conint(ge=1, le=1000)] = Query(None, alias='PageSize'),
page: Optional[conint(ge=0)] = Query(None, alias='Page'),
page_token: Optional[str] = Query(None, alias='PageToken'),
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Configs',
description=""" Create a config for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def create_account_config(request: Request):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.delete(
'/v1/Configs/{Key}',
description=""" Delete a config for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def delete_account_config(key: str = Path(..., alias='Key')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Configs/{Key}',
description=""" Retrieve a Config for an Account. """,
tags=['account_secret_handling'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_account_config(key: str = Path(..., alias='Key')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Configs/{Key}',
description=""" Update a config for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def update_account_config(key: str = Path(..., alias='Key'), request: Request = ...):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Devices',
description=""" Retrieve a list of all Devices registered with the Account. """,
tags=['app_management'],
security=[
HTTPBasic(name="None"),
],
)
def list_device(
page_size: Optional[conint(ge=1, le=1000)] = Query(None, alias='PageSize'),
page: Optional[conint(ge=0)] = Query(None, alias='Page'),
page_token: Optional[str] = Query(None, alias='PageToken'),
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Devices/{DeviceSid}/Configs',
description=""" Retrieve a list of all Configs for a Device. """,
tags=['device_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def list_device_config(
device_sid: str = Path(..., alias='DeviceSid'),
page_size: Optional[conint(ge=1, le=1000)] = Query(None, alias='PageSize'),
page: Optional[conint(ge=0)] = Query(None, alias='Page'),
page_token: Optional[str] = Query(None, alias='PageToken'),
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Devices/{DeviceSid}/Configs',
description=""" Create a config for a Microvisor Device. """,
tags=['device_configuration_management', 'device_secret_handling'],
security=[
HTTPBasic(name="None"),
],
)
def create_device_config(
device_sid: str = Path(..., alias='DeviceSid'), request: Request = ...
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.delete(
'/v1/Devices/{DeviceSid}/Configs/{Key}',
description=""" Delete a config for a Microvisor Device. """,
tags=['device_secret_handling', 'device_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def delete_device_config(
device_sid: str = Path(..., alias='DeviceSid'), key: str = Path(..., alias='Key')
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Devices/{DeviceSid}/Configs/{Key}',
description=""" Retrieve a Config for a Device. """,
tags=['device_configuration_management', 'device_secret_handling'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_device_config(
device_sid: str = Path(..., alias='DeviceSid'), key: str = Path(..., alias='Key')
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Devices/{DeviceSid}/Configs/{Key}',
description=""" Update a config for a Microvisor Device. """,
tags=['device_secret_handling'],
security=[
HTTPBasic(name="None"),
],
)
def update_device_config(
device_sid: str = Path(..., alias='DeviceSid'),
key: str = Path(..., alias='Key'),
request: Request = ...,
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Devices/{DeviceSid}/Secrets',
description=""" Retrieve a list of all Secrets for a Device. """,
tags=['device_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def list_device_secret(
device_sid: str = Path(..., alias='DeviceSid'),
page_size: Optional[conint(ge=1, le=1000)] = Query(None, alias='PageSize'),
page: Optional[conint(ge=0)] = Query(None, alias='Page'),
page_token: Optional[str] = Query(None, alias='PageToken'),
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Devices/{DeviceSid}/Secrets',
description=""" Create a secret for a Microvisor Device. """,
tags=['device_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def create_device_secret(
device_sid: str = Path(..., alias='DeviceSid'), request: Request = ...
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.delete(
'/v1/Devices/{DeviceSid}/Secrets/{Key}',
description=""" Delete a secret for a Microvisor Device. """,
tags=['device_secret_handling', 'device_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def delete_device_secret(
device_sid: str = Path(..., alias='DeviceSid'), key: str = Path(..., alias='Key')
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Devices/{DeviceSid}/Secrets/{Key}',
description=""" Retrieve a Secret for a Device. """,
tags=['device_secret_handling'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_device_secret(
device_sid: str = Path(..., alias='DeviceSid'), key: str = Path(..., alias='Key')
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Devices/{DeviceSid}/Secrets/{Key}',
description=""" Update a secret for a Microvisor Device. """,
tags=['device_secret_handling', 'device_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def update_device_secret(
device_sid: str = Path(..., alias='DeviceSid'),
key: str = Path(..., alias='Key'),
request: Request = ...,
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Devices/{Sid}',
description=""" Fetch a specific Device. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_device(sid: str = Path(..., alias='Sid')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Devices/{Sid}',
description=""" Update a specific Device. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def update_device(sid: str = Path(..., alias='Sid'), request: Request = ...):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Secrets',
description=""" Retrieve a list of all Secrets for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def list_account_secret(
page_size: Optional[conint(ge=1, le=1000)] = Query(None, alias='PageSize'),
page: Optional[conint(ge=0)] = Query(None, alias='Page'),
page_token: Optional[str] = Query(None, alias='PageToken'),
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Secrets',
description=""" Create a secret for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def create_account_secret(request: Request):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.delete(
'/v1/Secrets/{Key}',
description=""" Delete a secret for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def delete_account_secret(key: str = Path(..., alias='Key')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/v1/Secrets/{Key}',
description=""" Retrieve a Secret for an Account. """,
tags=['account_configuration_management', 'account_secret_handling'],
security=[
HTTPBasic(name="None"),
],
)
def fetch_account_secret(key: str = Path(..., alias='Key')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/v1/Secrets/{Key}',
description=""" Update a secret for an Account. """,
tags=['account_configuration_management'],
security=[
HTTPBasic(name="None"),
],
)
def update_account_secret(key: str = Path(..., alias='Key'), 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)