# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T09:59:44+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 models import (
PostReviewPostRequest,
PostReviewPostResponse,
PostReviewPostResponse1,
PostReviewPostResponse2,
PostReviewPostResponse3,
Rating,
)
app = MCPProxy(
contact={
'email': 'support@stellastra.com',
'name': 'Stellastra',
'url': 'https://stellastra.com/contact-us',
},
description='Stellastra makes it easy to get reviews for your cybersecurity solution in real-time with its platform-agnostic REST API.',
termsOfService='https://stellastra.com/terms-and-conditions',
title='Stellastra',
version='1.0',
servers=[
{
'description': 'Stellastra is a simple API which allows you to easily generate star ratings and reviews for your cybersecurity solution.',
'url': 'https://stellastra.com/api/',
'x-last-modified': 1669762495839,
}
],
)
@app.post(
'/post-review',
tags=['post_review_management'],
security=[
HTTPBasic(name="None"),
],
)
def post_post_review(
user_email: str,
user_name: Optional[str] = None,
rating: Rating = ...,
body: PostReviewPostRequest = ...,
):
"""
Posts the user's review to Stellastra
"""
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)