Docker Deployment¶
Pre-built Docker images bundle the hub server with all dependencies. A Docker Compose stack adds a Caddy reverse proxy that exposes OpenAPI + MCP on a single port.
Docker Files¶
The project includes several Docker-related files in the docker/ directory:
Dockerfile— Container definitioncompose.yaml— Docker Compose configuration with Caddy gateway.env.sample— Sample environment variables fileCaddyfile— Caddy reverse proxy configurationMakefile— Build automation and deployment targets
Quick Start¶
The quickest way to get started is using the pre-built Docker image with Docker Compose:
- Create a
.envfile based on the sample - (Optional) Create a
tools.jsoncfile to customize which tools are loaded (see Tool Configuration below) - Start the server using Docker Compose:
docker-compose up -d
The server will be available at http://localhost:8000 (or the port set by GATEWAY_PORT).
Environment Variables¶
Key environment variables:
API_BEARER_TOKEN: Authentication token for API accessGATEWAY_PORT: External port for the Caddy gateway (default: 8000)IMAGE_TAG: Docker image tag to use (default:latest)SEARXNG_URL: URL for SearXNG search engineBRAVE_API_KEY: API key for Brave search, supporting comma separating multiple keys (round robin)TAVILY_API_KEY: API key for Tavily search, supporting comma separating multiple keys (round robin)JINA_API_KEY: Optional Jina Reader API key for authenticated requests (comma-separated for multi-key rotation)CDP_ENDPOINT: Optional WebSocket URL of a CDP-compatible browser for self-hosted SPA rendering (e.g.,ws://localhost:9222)WEBSEARCH_PRIORITY: Comma-separated engine priority order for auto modeWEBSEARCH_PARALLEL_ENGINES: Comma-separated engines to query in parallel mode (default:brightdata,brave)
Architecture¶
Caddy Gateway¶
The Docker Compose stack uses a Caddy reverse proxy as a unified entry point. All three service backends run behind a single external port:
| Path | Backend | Description |
|---|---|---|
/mcp |
MCP streamable-http | Primary MCP endpoint |
/sse |
MCP SSE | Server-Sent Events transport |
/docs |
OpenAPI | Interactive API documentation |
/openapi |
→ /docs |
Convenience redirect |
/* |
OpenAPI | Default backend |
All backends are configured with flush_interval -1 to prevent SSE/streaming buffering.
Backend services use expose instead of ports — they are not directly accessible from the host, only through the Caddy gateway.
Server Modes¶
With the Caddy gateway, all modes are available simultaneously on a single port. For standalone use without the gateway:
OpenAPI Mode (Default)¶
MCP Mode with Streamable HTTP Transport¶
docker run -p 8000:8000 oaklight/toolregistry-hub-server:latest toolregistry-hub mcp --transport=streamable-http --host=0.0.0.0 --port=8000
MCP Mode with SSE Transport¶
docker run -p 8000:8000 oaklight/toolregistry-hub-server:latest toolregistry-hub mcp --transport=sse --host=0.0.0.0 --port=8000
Tool Configuration¶
You can customize which tools are loaded at startup using a tools.jsonc configuration file. The Docker Compose files mount ./tools.jsonc into the container automatically.
Setup¶
-
Download the example configuration:
# Via jsDelivr CDN (recommended, works in regions where GitHub is not directly accessible) curl -o tools.jsonc https://cdn.jsdelivr.net/gh/Oaklight/toolregistry-hub@master/tools.jsonc.example # Or directly from GitHub curl -o tools.jsonc https://raw.githubusercontent.com/Oaklight/toolregistry-hub/master/tools.jsonc.example # Ensure the file is readable by the container user (appuser, uid=10001) chmod 644 tools.jsonc -
Edit
tools.jsoncto customize your setup: -
Restart the containers:
Configuration Options¶
mode:"denylist"(default) or"allowlist"disabled: Namespaces to disable (denylist mode)enabled: Namespaces to enable (allowlist mode)tools: Custom tool class list (optional, overrides built-in defaults)
For full configuration details, see the Server Configuration — Tool Configuration documentation.
No Configuration File
If no tools.jsonc file is present, the server loads all available tools with default settings. The volume mount will simply be ignored if the file doesn't exist.
Development Deployment¶
The Makefile includes a deploy-dev target for building and deploying to a remote server:
This target:
- Builds a Python wheel from the current source
- Builds the Docker image locally
- Transfers the image via zstd compression over SSH
- Restarts the remote Docker Compose stack
- Runs a health check against the deployed service
Troubleshooting¶
| Issue | Solution |
|---|---|
| Container fails to start | docker logs toolregistry-hub-server |
| Cannot connect to server | Check port mapping and firewall rules |
| Auth failing | Verify API_BEARER_TOKEN matches the request header |
| Search tools unavailable | Confirm API keys are set — see Environment Variables |