> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# launch • AI Agent SDK

> launch: Launch all agents as a single API endpoint (HTTP) or an MCP server.

# launch

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AgentTeam**](../classes/AgentTeam) class in the [**agents**](../modules/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_&#123;agent_name&#125;` per agent plus
`list_agents` — the same path used by `Agent.launch(protocol="mcp")`.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def launch(path: str, port: int, host: str, debug: bool, protocol: str) -> Any
```

## Parameters

<ParamField query="path" type="str" required={false} default="'/agents'">
  API endpoint path (default: '/agents') for HTTP. Ignored in MCP mode.
</ParamField>

<ParamField query="port" type="int" required={false} default="8000">
  Server port (default: 8000)
</ParamField>

<ParamField query="host" type="str" required={false} default="'127.0.0.1'">
  Server 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.
</ParamField>

<ParamField query="debug" type="bool" required={false} default="False">
  Enable debug mode for uvicorn (default: False)
</ParamField>

<ParamField query="protocol" type="str" required={false} default="'http'">
  "http" to launch as FastAPI, "mcp" to serve over MCP via `praisonai-mcp` (install with `pip install praisonai-mcp`).
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  None
</ResponseField>

## Uses

* `logging.warning`
* `rstrip`
* `display_error`
* `logging.error`
* `_server_registry.get_or_create_app`
* `_server_registry.list_routes`
* `uuid.uuid4`
* `_server_registry.reserve_route`
* `HTTPException`
* `request.json`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agents/agents.py#L2998">
  `praisonaiagents/agents/agents.py` at line 2998
</Card>
