goosed) provides a REST API for all Goose functionality, enabling web applications, remote clients, and multi-user deployments. This guide covers deployment strategies, configuration, and best practices.
Overview
Thegoose-server crate provides:
- REST API: HTTP endpoints for session management, message streaming, and configuration
- Multi-user support: Isolated sessions per user
- Extension management: Dynamic MCP server configuration
- Streaming responses: Server-Sent Events (SSE) for real-time AI responses
Architecture
Quick Start
Running Locally
http://127.0.0.1:3000 by default.
Using Docker
Goose provides a multi-stage Dockerfile for minimal production images:Docker Compose
Configuration
Environment Variables
The server uses the same configuration system as the CLI. See
crates/goose-server/src/configuration.rs for implementation details.Configuration File
Placeconfig.yaml in ~/.config/goose/ (or use GOOSE_CONFIG_DIR):
API Reference
OpenAPI Specification
The server provides an OpenAPI spec atui/desktop/openapi.json. Generate it after server changes:
Key Endpoints
Session Management
Create SessionMessage Streaming
Send Message (Server-Sent Events)Extension Management
List ExtensionsProduction Deployment
Security Considerations
Recommended setup:Extension Allowlist
Restrict which MCP servers can be loaded using an allowlist:The allowlist prevents command injection by rejecting additional arguments. See
crates/goose-server/ALLOWLIST.md for details.Resource Limits
Memory: Goose sessions store conversation history in memory. Plan for ~10-50MB per active session. CPU: Primarily bound by AI provider latency. Goose itself is lightweight. Storage: Sessions are persisted to disk:- Location:
~/.local/share/goose/sessions/ - Size: ~1-5KB per message
Monitoring
Goose uses structured logging viatracing. Configure log levels:
Kubernetes Deployment
Scaling Considerations
Stateful Sessions
Sessions are currently stored per-instance. For multi-instance deployments:- Sticky sessions: Route users to the same instance
- Shared storage: Mount a shared filesystem for session data
- Session migration: Export/import sessions between instances (future feature)
Database Integration
For persistent session storage, consider implementing a custom session manager:crates/goose/src/session/session_manager.rs for the session storage interface.
Troubleshooting
Server won’t start
Connection timeouts
Increase timeout for slow AI providers:SSE not working
Ensure your reverse proxy doesn’t buffer responses:Resources
- Server implementation:
crates/goose-server/src/ - Route handlers:
crates/goose-server/src/routes/ - OpenAPI spec:
ui/desktop/openapi.json - Configuration:
crates/goose-server/src/configuration.rs