Skip to main content

mcp-server-celery

CI

An MCP server that lets AI agents debug a running Celery deployment. It checks which workers are alive, what each one consumes, and where messages are piling up — the checks you'd otherwise run by hand with celery inspect and rabbitmqctl every time something gets stuck.

It is read-only by default. Broker passwords are masked in every response, including the broker info that Celery's own inspect stats sends back in plain text.

Works with RabbitMQ (amqp://) and Redis (redis://, rediss://).

Tools

Tool What it answers
list_workers Which workers respond, their pool and concurrency, uptime, prefetch count, tasks processed, and the queues each one listens to.
queue_depths How many messages are waiting in each queue and which workers consume it. With no arguments it checks your configured queues plus every queue a live worker consumes.

Coming next: active_tasks, reserved_tasks, scheduled_tasks, task_status, and diagnose_stuck, which cross-references the above to flag queues no worker listens to, tasks routed to queues with no consumer, and workers that stopped responding. See the roadmap.

Install

Requires Python 3.10+ and uv.

uvx mcp-server-celery

Until the first PyPI release, run it from GitHub:

uvx --from git+https://github.com/taltal-beep/mcp-server-celery mcp-server-celery

Configuration

All configuration is through environment variables.

Variable Default Purpose
CELERY_BROKER_URL amqp://guest:guest@localhost:5672// Broker to inspect.
CELERY_RESULT_BACKEND — Result backend (used by task_status, coming in the next release).
CELERY_APP — Import path of your app, e.g. proj.celery:app. Lets the server see your task_queues and routes. CELERY_BROKER_URL still overrides the app's broker if both are set.
CELERY_INSPECT_TIMEOUT 1.0 Seconds to wait for worker replies. Raise it for large or slow clusters.

CELERY_APP has to be importable, so run the server from your project's directory and environment:

uv run --with mcp-server-celery mcp-server-celery

Connect it

Claude Code

claude mcp add celery -e CELERY_BROKER_URL=redis://localhost:6379/0 -- uvx mcp-server-celery

Cursor

In .cursor/mcp.json:

{
  "mcpServers": {
    "celery": {
      "command": "uvx",
      "args": ["mcp-server-celery"],
      "env": { "CELERY_BROKER_URL": "redis://localhost:6379/0" }
    }
  }
}

Claude Desktop

In claude_desktop_config.json, use the same command, args and env block as Cursor, under mcpServers.

Example

Ask the agent "why are my email tasks not running?" and it can call queue_depths:

{
  "broker": "amqp://app:****@rabbit:5672//",
  "queues": [
    { "queue": "celery", "exists": true, "messages": 0, "consumers": 2, "workers_consuming": ["w1@web", "w2@web"] },
    { "queue": "emails", "exists": true, "messages": 1843, "consumers": 0, "workers_consuming": [] }
  ]
}

emails has a backlog and no worker consumes it: the workers were started without -Q emails.

Notes on the data

  • Redis has no notion of consumers, so consumers is null; use workers_consuming, which comes from the workers themselves. Redis also deletes a queue's key once it is empty, so a drained queue shows "messages": 0, "exists": null.
  • RabbitMQ checks use a passive declare, so the server never creates a queue. A queue that doesn't exist shows "exists": false.
  • Workers that are too busy to answer within CELERY_INSPECT_TIMEOUT don't appear in list_workers. If a worker you expect is missing, try a larger timeout argument before assuming it's dead.

Safety

  • Every tool is annotated readOnlyHint: true. Write actions (revoke, retry, purge) will only be available behind an explicit opt-in flag.
  • URL credentials and password/secret/token fields are masked in all output and error messages.

Roadmap

v0.1 — list_workers, queue_depths ✅

v1 — active_tasks, reserved_tasks, scheduled_tasks, task_status(task_id), diagnose_stuck

v2 — summarize_failures: groups recent failures by task name and exception type. Celery keeps no failure history by default, so this needs an event listener.

Development

uv sync
uv run pytest tests/unit
uv run ruff check . && uv run ruff format --check .

Integration tests start a real worker and need a broker:

CELERY_BROKER_URL=redis://localhost:6379/0 uv run pytest tests/integration -m integration

CI runs them against Redis and RabbitMQ on every push.

License

MIT

Metadata

Release files for mcp-server-celery 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-celery 0.1.0
File Size Uploaded
mcp_server_celery-0.1.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-celery 0.1.0
File Interpreter ABI Platform
mcp_server_celery-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / mcp_server_celery-0.1.0.tar.gz

Download URL mcp_server_celery-0.1.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1ad6317cc184a6180594522315c95ab321c6121fda851c3c362935068027d5c2
BLAKE2b-256 checksum
How to use checksums
f1d0e7112ef772748b3951d31210a99035af5adcb83dfe6c34d08106f7f22e27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / mcp_server_celery-0.1.0-py3-none-any.whl

Download URL mcp_server_celery-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08b3a8fe9c40160faad3c5ebc5977afd51fd4b549c4e3cb921095ff2ab9b8cb2
BLAKE2b-256 checksum
How to use checksums
13287c0d0eaab38201ef60237290e3e55302e58b0a19ac2105861da1bafc06b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page