stackdoctor
Diagnose Python backend incidents by correlating Postgres, Celery, Redis, and logs via a read-only MCP server.
$3
Works with the AI Agents you already use
stackdoctor
Example session with this skill installed
My Celery jobs are stuck and nothing is getting processed. What's wrong?
- Read your context and instructions
- Compiled the stackdoctor
Your Celery worker isn't running. Nothing is wrong with the jobs, the broker, or the database.
At 23:11:43 the worker logged a "Warm shutdown (MainProcess)". No worker has responded to a ping since then. The celery queue now has
40 messages waiting: 20 at priority 0 and 20 at priority 6. That count hasn't changed in the last ~3 minutes, so nothing is consuming it.
A warm shutdown is a graceful stop, not a crash. Something told the worker to exit: a Ctrl+C, a SIGTERM from a process manager or Docker restart, or a deploy that stopped the old worker without starting a new one.
The rest of the stack is healthy
| System | Finding |
|---|---|
| Redis | ~2.7% of maxmemory, no evictions, no rejected connections |
| Postgres | No long-running queries, no blocking locks |
| Failed tasks | None among the 46 stored results |
| Unacked messages | Zero, so no work was lost. All 40 jobs are still in the queue |
Fix
Start the worker again
celery -A your_app worker -l info
Or restart it through whatever manages it (systemd, supervisor, docker compose up -d worker). The backlog will start draining immediately. If the worker keeps stopping, check what sent the signal around 23:11 (your process manager's logs or docker events).
Connects securely to your tools. The creator never sees your data.
About this skill
Production incidents in Python stacks often involve a guessing game between Postgres locks, Celery backlogs, and Redis memory pressure. This skill teaches your agent to use stackdoctor, a free, open-source, read-only MCP server, to correlate your whole backend without risking data integrity.
What it does
- Multi-source correlation combines data from Postgres, Celery, Redis, and logs into a single unified timeline.
- Incident diagnosis identifies blocked queries, queue backlogs, missing workers, and memory pressure.
- Hypothesis generation suggests possible cause-and-effect chains based on event timing, with low/medium/high confidence levels.
- Deep-dive inspection provides specific tools to drill into active locks, task tracebacks, and Redis keys.
How it works
- Trigger
diagnoseby passing the observed symptom, such as an API timeout or stuck worker queue. - Review the snapshot containing findings, timestamped events, and possible causes across configured services.
- Verify hypotheses using area-specific tools like
blocking_locks()ortask_details(task_id)to confirm the root cause. - Recommend fixes based on verified evidence like specific PIDs, queue names, or log lines, for the developer to approve.
Frameworks & tools
Designed for Python backends using Postgres, Redis, and Celery. It integrates via the Model Context Protocol (MCP); install the server with uvx stackdoctor. Source: github.com/lepri89/stackdoctor
Why this beats prompting it yourself
Manual correlation across four different tools and logs is slow and error-prone during high-pressure incidents. This skill makes the agent check everything at once and line events up by timestamp, so you don't miss a database lock while focused on a Celery worker.
Use cases
- Debug why Celery jobs are queued but not being consumed by workers.
- Identify the query holding a lock that is timing out API requests.
- Investigate Redis memory pressure causing evictions or connection drops.
- Correlate log error spikes with database problems.
Known limitations
Strictly read-only: it cannot apply fixes, restart services, or modify data. It only checks the services you configure through environment variables. Causes are suggested from timing and must be verified before acting.
Requires uv and MCP-compatible host. Read-only by design. Only supports Postgres, Redis, Celery, and standard/Docker logs. Cannot perform writes or service restarts.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 25 days ago
Requires
Permissions
Network: connects read-only to your own Postgres and Redis. Environment variables: reads your connection URLs (DATABASE_URL, REDIS_URL, etc.). Read files: reads the log files you configure. Terminal: runs the server via uvx. It never writes, deletes or restarts anything.