Skip to main content

Command & Control for Celery Workers

Reason this release was yanked:

Does not run =)

Project description

Celery Root

Docs: https://docs.celeryroot.eu

Celery Root is a command & control plane for Celery It ships with a Django-based UI, a lightweight event listener/collector, and helper utilities for inspecting queues, tasks, workers, and beat schedules. The distribution and Python package names are still celery_root for compatibility; only the product name and visuals have changed.

Features

  • Task list with filtering, sorting, and details (args/kwargs/result/traceback).
  • Task relation graph visualization.
  • 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.10, uv, and Docker (for the demo broker/redis).

make demo-infra

Start the demo workers in separate terminals:

make demo-worker-math
make demo-worker-text

Launch the Celery Root supervisor + web UI:

make demo-root

Then open http://127.0.0.1:5555.

To enqueue demo tasks:

make demo-tasks

Running the web UI

If you already have Celery workers and a broker running, you can point the UI at your apps via CELERY_ROOT_WORKERS and run the web server:

export CELERY_ROOT_WORKERS="your_app.celery:app,another_app.celery:app"
uv run python celery_root/components/web/manage.py migrate
uv run python -m celery_root.components.web.devserver --host 127.0.0.1 --port 8000

The UI reads task/worker data from the Celery Root SQLite store (see configuration below).

CLI usage

You can run the supervisor via the CLI, either standalone or as a Celery subcommand.

Standalone:

celery-root -A demo.worker_math:app

Via Celery:

celery -A demo.worker_math:app celery_root

Configuration

Configuration is explicit via Pydantic models:

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),
)

Components are enabled when their config is provided (set to None to disable).

The web UI still 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)

BROKER_URL and BACKEND_URL are standard Celery settings used by the demo math worker. The demo text and sleep workers use BROKER2_URL/BACKEND2_URL and BROKER3_URL/BACKEND3_URL respectively.

Library usage

For programmatic use, you can 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 to let MCP clients (Codex CLI, Claude Code, etc.) inspect the Celery Root SQLite store safely without write access.

How it works:

  • The MCP server runs as a separate process when CELERY_ROOT_MCP_ENABLED=1.
  • Requests are served from the Celery Root SQLite store using a read-only SQLAlchemy engine.
  • Tools include schema discovery, limited SQL querying (SELECT/WITH only), and a dashboard stats payload that matches the web UI.
  • Authentication is enforced with a static bearer token (CELERY_ROOT_MCP_AUTH_KEY).
  • The web Settings page renders copy/paste snippets for MCP client configuration and CLI commands for Codex + Claude.

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: Optional read-only database URL (defaults to SQLite read-only mode using CELERY_ROOT_DB_PATH). If you provide a regular database URL via CELERY_ROOT_MCP_READONLY_DB_URL, it is used as-is; ensure the credentials are truly read-only or queries will not be protected by the database itself.

Example:

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

Start the supervisor (or MCP server) and then open the Settings page to grab the client config snippets. The page includes JSON config for MCP clients plus CLI examples for Codex and Claude.

Development

Run checks locally:

uv run precommit

Run tests directly:

uv run pytest

Type checking:

uv run mypy

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.1.0.tar.gz (968.7 kB 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.1.0-py3-none-any.whl (882.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: celery_root-0.1.0.tar.gz
  • Upload date:
  • Size: 968.7 kB
  • 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.1.0.tar.gz
Algorithm Hash digest
SHA256 62a6d8fafd79eff0abe84171440212081caf47ade7cab882bd0085f1369d23f9
MD5 c8f33c75fcbfb12507f26ca6362ab3ae
BLAKE2b-256 f2665a9f90d6b043dea260ad8d1cb15914f794548af0686958438e2f8401044f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: celery_root-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 882.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1480f54661176c4efd745faf5939e4eb0965272e92c95e88832bbe1347d37c5c
MD5 c0d33ebac079c0e602d49ff21ea61428
BLAKE2b-256 62a1a65ec6d2b1b97a4fc08f3e069d3c8c068515e9a223c7fd34924ae7dbb9c4

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