Skip to main content
Glama
BullMQ Failed Job Inspector

BullMQ Failed Job Inspector

README.md
# BullMQ Failed Job Inspector

<!-- mcp-name: io.github.nsunny2772/dlq-recovery-mcp -->

Inspect retained BullMQ failures through a read-only MCP tool. The server runs locally and needs Python 3.12 or later, uv, and access to your Redis instance.

## Run from this repository

From the repository root, configure your Redis URL and BullMQ queue in a local `.env` file.

```bash
cp .env.example .env
uv sync --locked
```

For an MCP client that starts the server over stdio, set its command to `uv` and its arguments to `["--directory", "/absolute/path/to/dlq-recovery-mcp", "run", "--locked", "dlq-recovery-mcp", "--transport", "stdio"]`. Use the absolute path to your clone.

## Set up an MCP client over stdio from PyPI

Once the package is published to PyPI, add this entry to an MCP client that accepts an `mcpServers` configuration. Replace the Redis URL and queue name with your own values.

```json
{
  "mcpServers": {
    "bullmq": {
      "command": "uvx",
      "args": ["dlq-recovery-mcp", "--transport", "stdio"],
      "env": {
        "DLQ_REDIS_URL": "redis://127.0.0.1:6379/0",
        "DLQ_BULLMQ_QUEUE": "payments"
      }
    }
  }
}
```

## Run a local Streamable HTTP server

```bash
uv run --locked dlq-recovery-mcp --transport streamable-http
```

Point your MCP client or MCP Inspector at `http://127.0.0.1:8080/mcp` using Streamable HTTP. After the PyPI release, you can also run `uvx dlq-recovery-mcp --transport streamable-http` with the Redis and queue settings supplied through your environment.

## List failed jobs

Call `list_failed_jobs` with `{}` for the latest 20 retained failures, or use `limit` and `offset` to select a page. Use the returned `next_offset` to request the next page. A null value means there is no next page. Queue changes between calls can shift offset-based pages.

If the queue uses a custom prefix, set `DLQ_BULLMQ_PREFIX`. The default is `bull`.

The tool reads the configured BullMQ queue's Redis failed index and job metadata. It returns the job ID, name, failure reason, attempts made, and Unix timestamps in milliseconds. Payloads and stack traces are excluded. Only failures still retained in the configured queue's failed state are visible.

## Redis read behavior

The server shares one async Redis client with a pool of up to 16 connections and closes it at shutdown. Configure the Redis URL and queue before startup. Each failed-job listing has a five-second deadline, with up to two retries for transient connection errors or timeouts. Retries use short randomized backoff. Redis access failures return a tool error. Successful reads may return an empty page.

## Redis credentials and queue access

For authenticated Redis, set these variables on the MCP server.

| Variable | Value |
| --- | --- |
| `DLQ_REDIS_URL` | Redis address and database, for example `redis://127.0.0.1:6379/0` |
| `DLQ_REDIS_USERNAME` | Redis ACL username. Omit for password-only authentication. |
| `DLQ_REDIS_PASSWORD` | Redis password in its original form. |

Supply the password through your environment or secret manager. Redis URL credentials in the form `redis://USERNAME:PERCENT_ENCODED_PASSWORD@HOST:PORT/0` also work. Choose one credential format per server. For local Redis without authentication, omit the credential variables. Use your MCP client's local environment or secret settings when supplying credentials.

On Redis 7 or newer, a Redis administrator can create a new read-only account for the `payments` queue under the default `bull` prefix. For example, pass these arguments to an authenticated administrative `redis-cli` invocation. Supply the password rule from your secret manager.

```bash
redis-cli ACL SETUSER dlq-inspector on "$DLQ_REDIS_ACL_PASSWORD_RULE" \
  '%R~bull:payments:*' +zrevrange +hmget
```

The password rule begins with `>` followed by the account password. Match the read pattern to the configured queue and prefix. Add `+select` if the client must select a nondefault Redis database.

## Build the package

Run `uv build` from the repository root to produce a wheel and source distribution in `dist/`.

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

With a single tool there is no possibility of confusion between tools; its purpose (listing retained failed jobs) is unambiguous.

Naming Consistency5/5

The lone name follows a clear verb_noun snake_case convention (list_failed_jobs), so consistency within the set is trivially satisfied.

Tool Count3/5

A one-tool surface is thin even for a narrow inspector; an 'inspect' domain reasonably implies at least listing plus detail/retry/remove operations.

Completeness2/5

Only a list operation exists: no way to fetch a single failed job's payload/stacktrace, retry it, or remove it, which leaves agents at a dead end after listing.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues