# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T06:39:44+00:00
import argparse
import json
import os
from typing import *
from typing import Union
from uuid import UUID
from autogen.mcp.mcp_proxy import MCPProxy
from autogen.mcp.mcp_proxy.security import APIKeyQuery, BaseSecurity, HTTPBearer
from fastapi import Header
from starlette.requests import Request
from models import (
GenerateUploadPostResponse,
GenerateUploadPostResponse1,
GenerateUploadPostResponse2,
GenerateUploadPostResponse3,
GenerateUrlPostRequest,
GenerateUrlPostResponse,
GenerateUrlPostResponse1,
GenerateUrlPostResponse2,
GenerateUrlPostResponse3,
GenerateUserPostRequest,
GenerateUserPostResponse,
GenerateUserPostResponse1,
GenerateUserPostResponse2,
GenerateUserPostResponse3,
GetDelayGetResponse,
GetListPageGetResponse,
SkinInfo,
UserValidation,
)
app = MCPProxy(
contact={
'email': 'info@mineskin.org',
'name': 'inventivetalent',
'url': 'https://discord.gg/nzAdvPc',
},
description='Client implementations: \nJava: https://github.com/InventivetalentDev/MineskinClient\nNodeJS: https://github.com/InventivetalentDev/mineskin-client\n\nExamples: https://github.com/MineSkin/examples\n',
license={
'name': 'MIT',
'url': 'https://github.com/MineSkin/api.mineskin.org/blob/master/LICENSE',
},
title='MineSkin API',
version='1.0.0',
servers=[{'url': 'https://api.mineskin.org'}],
)
@app.post(
'/generate/upload',
tags=['user_profile_management'],
security=[
APIKeyQuery(name="key"),
HTTPBearer(name="None"),
],
)
def post_generate_upload(
user__agent: str = Header(..., alias='User-Agent'), request: Request = ...
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/generate/url',
tags=['url_creation'],
security=[
APIKeyQuery(name="key"),
HTTPBearer(name="None"),
],
)
def post_generate_url(
user__agent: str = Header(..., alias='User-Agent'),
body: GenerateUrlPostRequest = ...,
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.post(
'/generate/user',
tags=['user_profile_management'],
security=[
APIKeyQuery(name="key"),
HTTPBearer(name="None"),
],
)
def post_generate_user(
user__agent: str = Header(..., alias='User-Agent'),
body: GenerateUserPostRequest = ...,
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/get/delay',
tags=['user_profile_management'],
security=[
APIKeyQuery(name="key"),
HTTPBearer(name="None"),
],
)
def get_get_delay(user__agent: str = Header(..., alias='User-Agent')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get(
'/get/id/{id}',
description=""" Deprecated. Use /get/uuid instead. """,
tags=['user_profile_management'],
)
def get_get_id__id(id: float, user__agent: str = Header(..., alias='User-Agent')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get('/get/list/{page}', tags=['delay_settings'])
def get_get_list__page(page: float, user__agent: str = Header(..., alias='User-Agent')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get('/get/uuid/{uuid}', tags=['uuid_handling', 'user_profile_management'])
def get_get_uuid__uuid(uuid: UUID, user__agent: str = Header(..., alias='User-Agent')):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get('/validate/name/{name}', tags=['user_profile_management'])
def get_validate_name__name(
name: str, user__agent: str = Header(..., alias='User-Agent')
):
raise RuntimeError("Should be patched by MCPProxy and never executed")
@app.get('/validate/uuid/{uuid}', tags=['uuid_handling', 'user_profile_management'])
def get_validate_uuid__uuid(
uuid: str, user__agent: str = Header(..., alias='User-Agent')
):
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)