> ## 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 the agent as an HTTP API endpoint or an MCP server.

# launch

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

> This is a method of the [**Agent**](../classes/Agent) class in the [**agent**](../modules/agent) module.

Launch the agent as an HTTP API endpoint or an MCP server.

## 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="'/'">
  API endpoint path (default: '/') for HTTP, or base path for MCP.
</ParamField>

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

<ParamField query="host" type="str" required={false} default="'0.0.0.0'">
  Server host (default: '0.0.0.0')
</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 launch as MCP server.
</ParamField>

### Returns

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

## Uses

* `rstrip`
* `logging.error`
* `FastAPI`
* `logging.warning`
* `request.json`
* `HTTPException`
* `request.form`
* `asyncio.iscoroutinefunction`
* `achat`
* `asyncio.get_event_loop`

## Source

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