Skip to main content

launch

Method
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, an MCP server is started, exposing a tool to run the agent workflow.

Signature

def launch(path: str, port: int, host: str, debug: bool, protocol: str) -> Any

Parameters

path
str
default:"'/agents'"
API endpoint path (default: ‘/agents’) for HTTP, or base path for MCP.
port
int
default:"8000"
Server port (default: 8000)
host
str
default:"'0.0.0.0'"
Server host (default: ‘0.0.0.0’)
debug
bool
default:"False"
Enable debug mode for uvicorn (default: False)
protocol
str
default:"'http'"
“http” to launch as FastAPI, “mcp” to launch as MCP server.

Returns

Returns
Any
None

Uses

  • logging.warning
  • rstrip
  • display_error
  • logging.error
  • FastAPI
  • uuid.uuid4
  • request.json
  • HTTPException
  • request.form
  • asyncio.iscoroutinefunction

Source

View on GitHub

praisonaiagents/agents/agents.py at line 1591