celery-flower-mcp

celery-flower-mcp

This MCP server provides AI assistants with full control over Celery task queues by exposing all Celery Flower REST API endpoints as tools. It enables monitoring workers, managing tasks, inspecting queues, and controlling worker pools in real-time through natural language.

Category
访问服务器

README

🌸 celery-flower-mcp

<div align="center">

CI codecov PyPI Python 3.14+ MCP Ruff uv License: MIT

Give your AI assistant full control over Celery — monitor workers, manage tasks, inspect queues.

Features · Quick Start · Configuration · Tools · Development · Contributing

</div>


What is this?

celery-flower-mcp is a Model Context Protocol server that exposes the full Celery Flower REST API as MCP tools. Point it at your Flower instance and your AI assistant (Claude, Cursor, Windsurf, etc.) can:

  • Monitor workers, tasks, and queues in real time
  • Control worker pools — grow, shrink, autoscale, restart, shut down
  • Manage tasks — apply, revoke, abort, set timeouts and rate limits
  • Inspect queues — check depths, add/remove consumers

All 21 Flower API endpoints are covered.

Features

  • Full API coverage — every Flower REST endpoint exposed as an MCP tool
  • Dependency injection via dishka — clean, testable architecture
  • Pydantic Settings — typed configuration with .env file support
  • Async throughout — built on httpx + FastMCP
  • 65 tests — 49 unit tests (99% coverage) + 16 integration tests against real Flower
  • Strict typing — mypy strict mode, fully annotated

Quick Start

Install via uvx

FLOWER_URL=http://localhost:5555 uvx celery-flower-mcp

Install from source

git clone https://github.com/Darius1223/celery-flower-mcp
cd celery-flower-mcp
uv sync
uv run python -m source.main

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "celery-flower": {
      "command": "uvx",
      "args": ["celery-flower-mcp"],
      "env": {
        "FLOWER_URL": "http://localhost:5555"
      }
    }
  }
}

Configuration

Configuration is read from environment variables or a .env file in the project root. Copy .env.example to get started:

cp .env.example .env
Variable Default Description
FLOWER_URL http://localhost:5555 Base URL of your Flower instance
FLOWER_USERNAME Basic auth username
FLOWER_PASSWORD Basic auth password
FLOWER_API_TOKEN Bearer token (takes priority over basic auth)

Available Tools

Workers (8 tools)

Tool Description
list_workers List all workers — optionally filter by name, refresh live stats, or get status only
shutdown_worker Gracefully shut down a worker
restart_worker_pool Restart a worker's process pool
grow_worker_pool Add N processes to a worker's pool
shrink_worker_pool Remove N processes from a worker's pool
autoscale_worker_pool Configure autoscale min/max bounds
add_queue_consumer Make a worker start consuming from a queue
cancel_queue_consumer Make a worker stop consuming from a queue

Tasks (11 tools)

Tool Description
list_tasks List tasks with filters: state, worker, name, date range, search, pagination
list_task_types List all registered task types across workers
get_task_info Get full details for a task by UUID
get_task_result Retrieve a task's result (with optional timeout)
apply_task Execute a task synchronously and wait for the result
async_apply_task Dispatch a task asynchronously, returns task UUID
send_task Send a task by name — no registration required on worker side
abort_task Abort a running task
revoke_task Revoke a task; optionally terminate with a signal
set_task_timeout Set soft and/or hard time limits for a task on a worker
set_task_rate_limit Set rate limit for a task on a worker (e.g. 100/m)

Queues & Health (2 tools)

Tool Description
get_queue_lengths Get the current depth of all configured queues
healthcheck Check whether the Flower instance is reachable and healthy

Architecture

source/
├── main.py        # FastMCP server entry point + dishka container wiring
├── settings.py    # Pydantic Settings — typed config from env / .env
├── client.py      # Async HTTP client wrapping Flower REST API
├── providers.py   # dishka Provider — manages FlowerClient lifecycle
└── tools/
    ├── workers.py # 8 worker management tools
    ├── tasks.py   # 11 task management tools
    └── queues.py  # 2 queue / health tools

dishka manages the FlowerClient lifecycle: created once at startup, closed cleanly on shutdown via an async generator provider.

Development

make fmt        # auto-format with ruff
make lint       # lint with ruff
make typecheck  # type-check with mypy (strict)
make test       # run 49 unit tests
make cov        # unit tests + coverage report
make all        # fmt + lint + typecheck

Testing

The test suite is split into two layers:

Unit tests (tests/) — fast, no external dependencies, use pytest-httpx to mock HTTP calls:

make test
# or
uv run pytest tests/ -m "not integration"

Integration tests (tests/integration/) — run against a real Flower instance backed by Redis and a live Celery worker, all managed by Docker Compose:

make integration

This command:

  1. Builds and starts the Docker Compose stack (docker-compose.test.yml) — Redis → Celery worker → Flower
  2. Waits for Flower's /healthcheck endpoint to return OK
  3. Runs the 16 integration tests against http://localhost:5555
  4. Tears down the stack when done

The stack is defined in docker-compose.test.yml. The worker and Flower images are built from tests/integration/Dockerfile.worker and tests/integration/Dockerfile.flower.

To start the stack manually for exploratory testing:

docker compose -f docker-compose.test.yml up -d --build
# run tests, explore, etc.
make integration-down   # stop + remove volumes

Integration tests use pytest.mark.asyncio(loop_scope="session") so all tests share one event loop — this avoids RuntimeError: Event loop is closed when httpx transports are cleaned up across test boundaries on Python 3.14.

See CONTRIBUTING.md for details on adding new tools or submitting a PR.

Changelog

See CHANGELOG.md.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选