launch • AI Agent SDK
launch: Launch the agent as an HTTP API endpoint or an MCP server.
launch
Method
</div>
Launch the agent as an HTTP API endpoint or an MCP server.
Signature
def launch(path: str, port: int, host: str, debug: bool, protocol: str) -> AnyParameters
ParamField
strAPI endpoint path (default: ‘/’) for HTTP, or base path for MCP.
ParamField
intServer port (default: 8000)
ParamField
strServer host (default: ‘127.0.0.1’)
ParamField
boolEnable debug mode for uvicorn (default: False)
ParamField
str“http” to launch as FastAPI, “mcp” to launch as MCP server.
Returns
ResponseField
AnyNone
Uses
rstriplogging.errorFastAPIlogging.warningrequest.jsonHTTPExceptionrequest.formasyncio.iscoroutinefunctionachatasyncio.get_event_loop
Source
View on GitHubpraisonaiagents/agent/agent.py at line 6826