launch • AI Agent SDK
launch: Launch all agents as a single API endpoint (HTTP) or an MCP server.
launch
Method
</div>
This is a method of the AgentTeam class in the agents module.
Launch all agents as a single API endpoint (HTTP) or an MCP server. In HTTP mode, the endpoint accepts a query and processes it through all agents in sequence. In MCP mode, serving is delegated to the `praisonai-mcp agent adapter (serve_agents), publishing ask_{agent_name} per agent plus list_agents — the same path used by Agent.launch(protocol="mcp")`.
Signature
def launch(path: str, port: int, host: str, debug: bool, protocol: str) -> AnyParameters
strAPI endpoint path (default: ‘/agents’) for HTTP. Ignored in MCP mode.
intServer port (default: 8000)
strServer host (default: ‘127.0.0.1’; changed from ‘0.0.0.0’ to avoid binding all interfaces by default — pass ‘0.0.0.0’ explicitly to expose externally). Binding a non-loopback host without `PRAISONAI_LAUNCH_AUTH_TOKEN` set auto-generates and prints a one-time bearer token.
boolEnable debug mode for uvicorn (default: False)
str“http” to launch as FastAPI, “mcp” to serve over MCP via `praisonai-mcp (install with pip install praisonai-mcp`).
Returns
AnyNone
Uses
logging.warningrstripdisplay_errorlogging.error_server_registry.get_or_create_app_server_registry.list_routesuuid.uuid4_server_registry.reserve_routeHTTPExceptionrequest.json
Source
View on GitHubpraisonaiagents/agents/agents.py at line 3686