Unified Serve

Start any PraisonAI server with a single unified command

All PraisonAI servers are accessible through praisonai serve <type> – one command to start any server.

Diagram

praisonai serve

agents

HTTP API

gateway

WebSocket

mcp

MCP Protocol

ui

Web UI

recipe

Recipe Server

unified

All-in-One

Quick Start

  1. Start Agents Server
    bash
    praisonai serve agents --port 8000
  2. Start Gateway Server
    bash
    praisonai serve gateway --port 8765
  3. Start All-in-One Server
    bash
    praisonai serve unified --port 8765

All Serve Commands

CommandProtocolPortDescription
praisonai serve agentsHTTP8000Agents as HTTP REST API
praisonai serve gatewayWebSocket8765Multi-agent real-time coordination
praisonai serve mcpSTDIO/SSE8080MCP server for Claude/Cursor
praisonai serve acpSTDIO–Agent Client Protocol for IDEs
praisonai serve lspSTDIO–Language Server Protocol
praisonai serve uiHTTP8082Chainlit web interface
praisonai serve ragHTTP9000RAG query server
praisonai serve registryHTTP7777Package registry server
praisonai serve docsHTTP3000Documentation preview
praisonai serve schedulerBackground–Job scheduler daemon
praisonai serve recipeHTTP8765Recipe runner server
praisonai serve a2aJSON-RPC8082Agent-to-Agent protocol
praisonai serve a2uSSE8002Agent-to-User event stream
praisonai serve unifiedHTTP/SSE8765Agents API + A2A + A2U combined
praisonai serve openaiHTTP/SSE8765OpenAI API compatibility layer

Server Details

Agents

HTTP REST API for agents.

bash
praisonai serve agents --file agents.yaml --port 8000

Options:

OptionDefaultDescription
--host127.0.0.1Host to bind to
--port8000Port to bind to
--fileagents.yamlAgents YAML file
--reloadfalseEnable hot reload
--api-key–API key for auth

Test with curl:

bash
curl http://localhost:8000/

Gateway

WebSocket server for multi-agent coordination.

bash
praisonai serve gateway --port 8765 --agents agents.yaml

Options:

OptionDefaultDescription
--host127.0.0.1Host to bind to
--port8765Port to bind to
--agents–Agents YAML file

Connect with WebSocket:

javascript
const ws = new WebSocket('ws://localhost:8765');

MCP

MCP server for Claude Desktop and Cursor.

bash
praisonai serve mcp --transport sse --port 8080

Options:

OptionDefaultDescription
--host127.0.0.1Host to bind to
--port8080Port to bind to
--transportstdioTransport: stdio, sse
--name–Server name from config

Recipe

Recipe runner server.

bash
praisonai serve recipe --port 8765 --reload

Options:

OptionDefaultDescription
--host127.0.0.1Host to bind to
--port8765Port to bind to
--config–Config file path
--reloadfalseEnable hot reload

Unified

All providers in one server.

bash
praisonai serve unified --port 8765

Options:

OptionDefaultDescription
--host127.0.0.1Host to bind to
--port8765Port to bind to
--fileagents.yamlAgents YAML file
--reloadfalseEnable hot reload

Includes: agents-api, a2a, a2u when --file exists; only a2u otherwise. Recipe and MCP run as their own servers.


Authentication

Set --api-key to require a key on every request. Send it with either header.

bash
# Start with a key
praisonai serve agents --api-key $API_KEY --host 0.0.0.0
bash
# Authorization header
curl -H "Authorization: Bearer $API_KEY" http://localhost:8000/agents

# X-API-Key header
curl -H "X-API-Key: $API_KEY" http://localhost:8000/agents

Both headers are equivalent and use constant-time comparison. Missing or wrong keys return 401 {"error": "Unauthorized"}.

These paths stay public even when --api-key is set:

PathPurpose
/healthHealth check
/Root info
/.well-known/agent.jsonA2A agent card
/__praisonai__/*Discovery endpoints
Diagram

Yes

No

Yes

No

🔑 Request

🛡️ Public path?

✅ 200 Response

🛡️ Valid key?

⛔ 401 Unauthorized


How It Works

Diagram
AgentServerpraisonai serveUserAgentServerpraisonai serveUserpraisonai serve agentsStart FastAPIReady on port 8000POST /agentsProcess requestResponseJSON response

Common Patterns

Development with Hot Reload
bash
praisonai serve agents --reload --port 8000

Changes to agents.yaml auto-reload the server.

Production with Auth
bash
praisonai serve agents --api-key $API_KEY --host 0.0.0.0

Bind to all interfaces with API key authentication.

Multiple Servers
bash
# Terminal 1: Agents API
praisonai serve agents --port 8000

# Terminal 2: Gateway
praisonai serve gateway --port 8765

# Terminal 3: MCP
praisonai serve mcp --transport sse --port 8080

Run different server types simultaneously.

All-in-One Development
bash
praisonai serve unified --port 8765 --reload

Single server with all providers for development.


Discovery Endpoint

All HTTP servers expose /__praisonai__/discovery for endpoint discovery.

bash
curl http://localhost:8000/__praisonai__/discovery
json
{
  "server_name": "praisonai-agents",
  "version": "1.0.0",
  "providers": [...],
  "endpoints": [...]
}

Best Practices

Use Unified for Development

Start with praisonai serve unified during development to access all providers. Split into separate servers for production.

Always Set Host in Production

Use --host 0.0.0.0 to accept external connections. Default 127.0.0.1 only accepts local connections.

Enable Auth for Public Servers

Always use --api-key when exposing servers publicly. Never run unauthenticated servers on public networks.


Related