tollgate serve
Start Tollgate in orchestration mode to manage multiple MCP servers from a single process with an interactive CLI.Usage
Options
| Option | Description | Default |
|---|---|---|
-c, --config <path> | Path to tollgate.yaml config file | ./tollgate.yaml |
--audit-path <path> | Custom path for audit database | ~/.tollgate/audit.db |
--timeout <ms> | Approval timeout in milliseconds | 60000 |
--approval <method> | Approval method: terminal, interactive | terminal |
--approval-port <port> | Port for interactive approval UI | 9847 |
--persist-sessions | Persist session grants to disk | false |
--session-path <path> | Path for persistent session database | ~/.tollgate/sessions.db |
--dry-run | Evaluate policies without executing tools | false |
--failure-mode <mode> | Behavior when upstream fails | fail-closed |
--all | Auto-start all configured servers | false |
-s, --servers <names...> | Specific servers to auto-start | none |
--no-interactive | Run without interactive CLI | false |
Interactive Commands
When running in interactive mode, the following commands are available:| Command | Description |
|---|---|
status / ls | Show all servers with status |
start <n|name> | Start a server by number or name |
stop <n|name> | Stop a server by number or name |
restart <n|name> | Restart a server |
start-all | Start all configured servers |
stop-all | Stop all running servers |
stats | Show orchestrator statistics |
logs <n|name> | Show recent logs for a server |
help | Show available commands |
quit / exit | Shutdown and exit |
Example Session
Configuration
The serve command uses the sametollgate.yaml configuration as the start command:
Use Cases
Development Environment
Run all your MCP servers with easy control:Production Monitoring
Run servers with persistence and monitoring:Testing Specific Servers
Start only the servers you need:Events
The orchestrator emits events for server lifecycle changes:| Event | Description |
|---|---|
server:starting | Server is starting |
server:started | Server started successfully |
server:stopping | Server is stopping |
server:stopped | Server stopped |
server:error | Server encountered an error |
server:health | Server health status changed |
orchestrator:ready | Orchestrator is ready |
orchestrator:shutdown | Orchestrator is shutting down |
vs. Multiple tollgate start
| Feature | tollgate serve | Multiple tollgate start |
|---|---|---|
| Processes | Single process | One per server |
| Control | Interactive CLI | Separate terminals |
| Health monitoring | Unified | Per-process |
| Statistics | Aggregated | Per-server |
| Memory usage | Lower | Higher |
| Approval handler | Shared | Separate |
| Session storage | Shared | Separate |
Graceful Shutdown
When you exit the orchestrator (viaquit, Ctrl+C, or SIGTERM):
- All running servers are stopped in parallel
- In-flight requests are allowed to complete (configurable timeout)
- Audit logs are flushed
- Session data is persisted (if enabled)