serve command starts an HTTP API server for agents defined in a YAML file, enabling programmatic access to your agents via REST endpoints.
Quick Start
Usage
Basic Server
Custom Port and Host
Alternative Flag Style
API Endpoints
When the server starts, it automatically creates these endpoints:| Endpoint | Method | Description |
|---|---|---|
/agents | POST | Run ALL agents sequentially |
/agents/{name} | POST | Run a specific agent |
/agents/list | GET | List all available agents |
/health | GET | Health check |
/docs | GET | Swagger API documentation |
Run All Agents
Run Specific Agent
List Available Agents
Example agents.yaml
Integration with n8n
The serve command works seamlessly with n8n workflows:- Visualize agent execution flow
- Add conditional logic between agents
- Integrate with other n8n nodes
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
| Option | Default | Description |
|---|---|---|
--port | 8005 | Server port |
--host | 127.0.0.1 | Server host |
--serve | - | Flag to start server (alternative to serve command) |

