Skip to main content

Command & Control for Celery Workers

Project description

Celery Root

Docs: https://docs.celeryroot.eu

Celery Root is a control plane for Celery. It provides a Django-based UI, an event listener/collector, and helper utilities for inspecting tasks, workers, queues, and beat schedules. The Python package and distribution remain celery_root for compatibility.

Features

  • Task list with filtering, sorting, and detail views (args/kwargs/result/traceback).
  • Task relation graph visualization (chains, groups, chords, maps).
  • Worker fleet overview and per-worker drill-down.
  • Broker queue inspection and purge actions.
  • Beat schedule overview and editor.
  • Pluggable storage (SQLite by default).

Quickstart (demo)

Requirements: Python >= 3.13, uv, and Docker (for the demo broker/redis).

export CELERY_ROOT_WORKERS="your_app.celery:app,another_app.celery:app"

Start the supervisor + UI (standalone):

celery_root -A your_app.celery:app

Or run as a Celery subcommand:

celery -A your_app.celery:app celery_root

By default the UI binds to 127.0.0.1:8000.

Demo stack

Requirements: Python >= 3.10, uv, and Docker (for the demo broker/redis).

make demo-infra
make demo-worker-math
make demo-worker-text
make demo-root

Then open http://127.0.0.1:8000.

To enqueue demo tasks:

make demo-tasks

Installation (repo)

Celery Root is currently built and run from this repository.

make install

This runs:

  • uv sync --all-extras --dev --frozen
  • uv run pre-commit install
  • npm --prefix frontend/graph-ui install

Build the frontend assets:

celery_root -A demo.worker_math:app

Via Celery:

celery -A demo.worker_math:app celery_root

Optional dependencies

Celery Root ships optional components behind extras. Install only what you need.

  • web: Django-based UI.
  • mcp: MCP server (FastMCP + Uvicorn) and Django for ASGI integration.
  • prometheus: Prometheus metrics exporter.
  • otel: OpenTelemetry exporter.

Install with uv:

uv sync --extra web --extra prometheus

Or install all extras:

uv sync --all-extras

Editable install with pip:

pip install -e ".[web,prometheus]"

Configuration

Configuration is explicit via Pydantic models. Components are enabled when their config is provided (set to None to disable).

from pathlib import Path

from celery_root import (
    BeatConfig,
    CeleryRootConfig,
    DatabaseConfigSqlite,
    FrontendConfig,
    LoggingConfigFile,
    OpenTelemetryConfig,
    PrometheusConfig,
)

config = CeleryRootConfig(
    logging=LoggingConfigFile(log_dir=Path("./logs")),
    database=DatabaseConfigSqlite(db_path=Path("./celery_root.db")),
    beat=BeatConfig(schedule_path=Path("./celerybeat-schedule")),
    prometheus=PrometheusConfig(port=8001, prometheus_path="/metrics"),
    open_telemetry=OpenTelemetryConfig(endpoint="http://localhost:4317"),
    frontend=FrontendConfig(host="127.0.0.1", port=5555),
)

The web UI reads worker import paths from CELERY_ROOT_WORKERS (comma-separated). If you need to override settings before Django settings load:

from celery_root.config import set_settings

set_settings(config)

Library usage

Start the supervisor from Python:

from celery_root import CeleryRoot

root = CeleryRoot("your_app.celery:app")
root.run()

MCP server (AI tools)

Celery Root ships with an optional MCP server that exposes read-only tools over HTTP. It is designed for MCP clients (Codex CLI, Claude Code, etc.) to inspect the Celery Root store safely without write access.

Configuration:

  • CELERY_ROOT_MCP_ENABLED: Enable the MCP server (1/true).
  • CELERY_ROOT_MCP_HOST: Host interface (default: 127.0.0.1).
  • CELERY_ROOT_MCP_PORT: Port (default: 9100).
  • CELERY_ROOT_MCP_PATH: Base path (default: /mcp/).
  • CELERY_ROOT_MCP_AUTH_KEY: Required auth token for clients.
  • CELERY_ROOT_MCP_READONLY_DB_URL: Deprecated (RPC-based access replaces direct DB reads).

Example:

export CELERY_ROOT_MCP_ENABLED=1
export CELERY_ROOT_MCP_AUTH_KEY="your-secret-token"

Start the supervisor (or MCP server) and open the Settings page to copy client snippets.

Development

Run checks locally:

uv run precommit
uv run mypy
uv run pytest

Project structure

  • celery_root/components/: optional components (web, metrics, beat).
  • celery_root/core/: engine + DB + logging internals.
  • demo/: demo workers and task scripts.
  • tests/: unit and integration tests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

celery_root-0.3.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

celery_root-0.3.0-py3-none-any.whl (899.1 kB view details)

Uploaded Python 3

File details

Details for the file celery_root-0.3.0.tar.gz.

File metadata

  • Download URL: celery_root-0.3.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for celery_root-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ba05df0b777fed8e027b215259ec83a1731a44685b6eca3ab1bf1c12f00ec292
MD5 2a90470d24c02ceaadf180409d1cabf6
BLAKE2b-256 673d558b1e2dec6142a0c8b41a2dd02b6862e4750fc554be8c6d3bbf1dd3cc2b

See more details on using hashes here.

File details

Details for the file celery_root-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: celery_root-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 899.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for celery_root-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e5c2edb6c0e7171c9edf9dd72b5cb24c494a951c6e59d73d7200b53100468dc
MD5 45888ea35105161fca3d556cea75f38b
BLAKE2b-256 04a2016f1c0c73db6afaaef2ea58405b9757b9c858b5296a9262ae47def3d72e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page