Skip to main content
The praisonai serve command launches various PraisonAI server types with unified discovery support.

Server Types

Bot Servers (Messaging Platforms)

Quick Start

Usage

Basic Server

Expected Output:

Custom Port and Host

Binding to a non-localhost host (--host 0.0.0.0) requires an API key. Without one, praisonai serve agents exits at startup with a SystemExit because POST /agents can execute YAML-defined tools. Set PRAISONAI_SERVE_API_KEY or pass --api-key. See Serve Agents Authentication.

Alternative Flag Style

UI-Gateway Server (Pattern C)

API Endpoints

When the server starts, it automatically creates these endpoints:

Run All Agents

Response:

Run Specific Agent

Response:

List Available Agents

Response:

Example agents.yaml

Integration with n8n

The serve command works seamlessly with n8n workflows:
The n8n workflow will call individual agent endpoints, allowing you to:
  • Visualize agent execution flow
  • Add conditional logic between agents
  • Integrate with other n8n nodes
The POST /api/v1/agents/{id}/invoke endpoint isolates conversations by session_id and provides an ephemeral mode when the field is omitted — see n8n API → Session semantics.

Use Cases

Microservices

Expose agents as REST APIs for microservice architectures

n8n Integration

Connect agents to n8n workflows for automation

Web Applications

Backend API for web or mobile applications

Testing

Test agents via HTTP requests during development

Python SDK Equivalent

The serve command is equivalent to:

Command Options

Global Options

Agents Server Options

Environment Variables: See Serve Agents Authentication for the full localhost allowlist and error reference.

Gateway Server Options

UI-Gateway Server Options

MCP Server Options

ACP Server Options

LSP Server Options

UI Server Options

RAG Server Options

Registry Server Options

Docs Server Options

Scheduler Options

Recipe Server Options

A2A Server Options

A2U Server Options

Unified Server Options

Bot Server Options (Telegram, Discord, Slack)

Environment Variables:
  • TELEGRAM_BOT_TOKEN - Telegram bot token
  • DISCORD_BOT_TOKEN - Discord bot token
  • SLACK_BOT_TOKEN - Slack bot token

Discovery Endpoint

All servers expose a unified discovery endpoint at /__praisonai__/discovery:
Response:

Server-Specific Commands

A2A Server

A2U Server

MCP Server

Tools MCP Server