bunqueue logo

bunqueue

Community
egeominotti

⚡ High-performance job queue for Bun. SQLite by default, PostgreSQL multi-broker when you scale. DLQ, cron, SQLite S3 backups, and native MCP. No Redis.

Publisheregeominotti
Repositorybunqueue
LanguageTypeScript
Forks
18
Stars
570
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    bunqueue exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    570 stars and 18 forks from the linked repository.


Quickstart

bash
bun add bunqueue
typescript
import { Bunqueue } from 'bunqueue/client';

const app = new Bunqueue('emails', {
  embedded: true,
  dataPath: './data/emails.db', // omit to run in-memory (lost on restart)
  processor: async (job) => {
    console.log(`Sending to ${job.data.to}`);
    return { sent: true };
  },
});

await app.add('send', { to: 'alice@example.com' });

That's it. Queue + Worker in one object, persisted to a single SQLite file. No Redis, no config, no setup. msgpackr is the only runtime dependency; cron, SQLite, S3, HTTP and WebSocket use Bun's built-ins.

Not on Bun? Run the server, connect from anywhere

The queue also runs as a standalone server. Memory is the zero-configuration default; SQLite is the zero-infrastructure persistent option:

bash
# in-memory without --data-path; pass it to persist jobs to SQLite
bunx bunqueue start --data-path ./data/bunq.db   # TCP :6789, HTTP :6790

# or, with no runtime at all (the volume persists /app/data):
docker run -d -p 6789:6789 -p 6790:6790 \
  -v bunqueue-data:/app/data \
  egeominotti/bunqueue:latest

For multiple active brokers, the repository includes a topology pinned to PostgreSQL 18.6:

bash
POSTGRES_PASSWORD='replace-me' \
  BUNQUEUE_POSTGRES_URL='postgres://bunqueue:replace-me@postgres:5432/bunqueue' \
  docker compose -f docker-compose.postgres.yml up --build -d

It starts two brokers against one database/namespace. PostgreSQL is server-only; embedded mode keeps using memory/SQLite. Supply both Compose values when the password changes, percent-encoding reserved characters in the URL only. MySQL is not supported. CI validates PostgreSQL 15, 16, 17, and the pinned/recommended 18.6 release. See the storage guide.

Docker images

All four images run the same bunqueue server with the same queue features, protocols, and persistence options. The difference is the Linux base and the tools available inside the container.

Starting with 2.9.5, completed releases publish to both Docker Hub (egeominotti/bunqueue) and GHCR (ghcr.io/egeominotti/bunqueue), with matching version, latest, and variant tags. Build references are kept on GHCR only. Each image supports linux/amd64 and linux/arm64; Docker selects the matching architecture automatically. You choose the distribution, not the CPU tag. Pin a version or digest for reproducible deployments. Confirm a tag exists with docker buildx imagetools inspect egeominotti/bunqueue:<tag> before using it.

Choose a Linux distribution with the same tags on either registry:

VariantVersion tagMoving tagRuntime base
Alpine (default)2.9.5-alpinealpine, latestAlpine 3.22, musl
Debian2.9.5-debiandebianDebian 13
Debian slim2.9.5-slimslimDebian 13 slim
Distroless2.9.5-distrolessdistrolessDebian 13, no shell or package manager

Which variant should I use?

  • Alpine is the default for a compact deployment. It uses musl and includes a shell and the apk package manager. Choose it when you do not need Debian tooling or glibc compatibility for additional software.
  • Debian uses glibc and the standard Debian base, with a shell and apt. Choose it when familiar Debian tools and a fuller base matter more than image size. Additional troubleshooting tools may still need to be installed.
  • Debian slim keeps glibc, a shell, and apt in a reduced Debian base. Choose it when you want Debian compatibility with fewer bundled utilities.
  • Distroless contains the compiled server and its required runtime libraries, without a shell or package manager. Choose it when you operate through logs, health checks, and external debugging tools; docker exec ... sh is unavailable.

The distribution does not select a faster queue engine or unlock extra features. All images run as a non-root user; having a package manager does not grant that user permission to install packages at runtime.

Try a specific variant by changing only the image tag:

bash
docker run -d --name bunqueue --restart unless-stopped \
  -p 127.0.0.1:6789:6789 -p 127.0.0.1:6790:6790 \
  -v bunqueue-data:/app/data \
  egeominotti/bunqueue:2.9.5-alpine

curl --fail http://127.0.0.1:6790/health

This example exposes the APIs only on your machine. Replace 2.9.5-alpine with 2.9.5-debian, 2.9.5-slim, or 2.9.5-distroless to choose another base. Moving tags such as alpine follow newer releases; version tags identify a release, while a digest pins the exact image even across base-image rebuilds.

Every variant supports both architectures, runs as UID/GID 1001:1001, and stores SQLite data in /app/data. Unsuffixed tags such as 2.9.5 stay on Alpine. Production images contain the compiled server and required system libraries; development dependencies and a separate Bun installation stay out of the image. The built-in health check uses /app/bunqueue healthcheck, including on distroless. See the deployment guide for custom probes.

Standalone executables and network clients

Prefer a standalone executable? GitHub releases include the Bun runtime, so no Bun or Node.js installation is needed. From 2.9.5, the eight downloads are:

SystemArchitectureArchive
Linux (glibc)x64bunqueue-linux-x64.tar.gz
Linux (glibc)arm64bunqueue-linux-arm64.tar.gz
Linux (musl / Alpine)x64bunqueue-linux-x64-musl.tar.gz
Linux (musl / Alpine)arm64bunqueue-linux-arm64-musl.tar.gz
macOSx64 / Intelbunqueue-darwin-x64.tar.gz
macOSarm64 / Apple Siliconbunqueue-darwin-arm64.tar.gz
Windowsx64bunqueue-windows-x64.zip
Windowsarm64bunqueue-windows-arm64.zip

Extract the archive for your operating system and architecture, and verify it against the release's SHA256SUMS. See the installation guide.

Then produce and process from the language you already use:

bash
npm install bunqueue-client    # Node.js ≥ 20, Deno ≥ 2, Bun, Cloudflare Workers
typescript
import { Queue, Worker } from 'bunqueue-client';

const queue = new Queue('emails'); // localhost:6789 by default
await queue.add('welcome', { to: 'user@example.com' });

new Worker('emails', async (job) => ({ sent: true }), { concurrency: 10 });

Python, PHP, Go, Rust and Elixir clients speak the same protocol — see One Queue, Any Language.

Only the server and embedded mode are Bun-only (bun >= 1.4.0, bun.sh); producers and workers can run anywhere.

Quick Start guide →

Why bunqueue?

LibraryRequiresAI-native
BullMQRedisNo
AgendaMongoDBNo
pg-bossPostgreSQLNo
bunqueueNothing (memory/SQLite) · PostgreSQL optionalYes
  • Zero external infrastructure by default — memory by default; one SQLite file when local persistence is configured
  • PostgreSQL 15–18 multi-broker mode — PostgreSQL 18.6 is recommended; database-authoritative claims, fenced leases, shared limits, cron, workers, job-state/lifecycle metrics, and failover state (tested three-broker Docker example)
  • BullMQ and BullMQ Pro-compatible API — Queue, Worker, QueueEvents, FlowProducer, plus QueuePro/WorkerPro aliases, fair job groups, native processor batches, cooperative cancellation, and Observable results; migrating takes minutes
  • MCP server included — 73 tools; AI agents get full queue control out of the box
  • Everything server-side — retries with backoff, priorities, cron, rate limits, dead letter queue
  • Measured, operation-specific performance — 729K jobs/sec internal in-memory batch push, 186K jobs/sec public on-disk Embedded addBulk, and 159K jobs/sec TCP PUSHB; methodology and distributions

Great for: embedded and single-server deployments, PostgreSQL-backed broker fleets, AI agents that need a scheduler, edge/serverless spooling, and teams that don't want to operate Redis.

Not ideal for: multi-region consensus or deployments that require MySQL as the queue store. If you already run Redis and BullMQ works for you, keep it.

When to choose bunqueue →

Two Modes

EmbeddedServer (TCP)
How it worksQueue runs inside your processStandalone server, clients connect via TCP
Setupbun add bunqueuedocker run or bunqueue start
Performance186K jobs/sec on-disk addBulk; 729K internal in-memory batchSQLite: 159K TCP PUSHB; 17K jobs/sec worker drain
Best forSingle-process apps, CLIs, serverlessMultiple workers, separate producer/consumer
ScalingSame process onlyMultiple clients; multiple brokers with PostgreSQL 15–18

Embedded

Everything in your process. Without a data path the queue is in-memory: pass dataPath (or set BUNQUEUE_DATA_PATH) to persist jobs.

typescript
import { Queue, Worker } from 'bunqueue/client';

const queue = new Queue('emails', { embedded: true, dataPath: './data/app.db' });

const worker = new Worker(
  'emails',
  async (job) => {
    return { sent: true };
  },
  { embedded: true }
);

await queue.add('welcome', { to: 'user@example.com' });

Server (TCP)

bash
docker run -d -p 6789:6789 -p 6790:6790 \
  -v bunqueue-data:/app/data \
  egeominotti/bunqueue:latest
typescript
import { Queue, Worker } from 'bunqueue/client';

const queue = new Queue('tasks', { connection: { host: 'localhost', port: 6789 } });

const worker = new Worker(
  'tasks',
  async (job) => {
    return { done: true };
  },
  { connection: { host: 'localhost', port: 6789 } }
);

await queue.add('process', { data: 'hello' });

Running the server → · Deployment guide →

BullMQ Pro-compatible groups and batches

The Bun client exposes Pro-style aliases backed by the same native queue and worker implementations. No separate runtime or license is required:

typescript
import { QueuePro, WorkerPro } from 'bunqueue/client';

const queue = new QueuePro('webhooks', { embedded: true, dataPath: './data/app.db' });

await queue.add('deliver', payload, {
  group: { id: 'tenant-a', priority: 1, maxSize: 10_000 },
});

const worker = new WorkerPro(
  'webhooks',
  async (job, { signal } = { signal: new AbortController().signal }) => {
    const batch = job.getBatch?.() ?? [job];
    return await deliver(batch, signal);
  },
  {
    embedded: true,
    batch: { size: 100, minSize: 10, timeout: 250, groupAffinity: true },
    group: { concurrency: 2, limit: { max: 20, duration: 1000 } },
  }
);

Groups support atomic maxSize admission, priority within a group, pause and resume, manual rate limits, per-group concurrency/rate defaults, pending-job queries, and fair round-robin claims. Native batches support minimum size, timeout, group affinity, and selective job.setAsFailed(error). Processor timeouts and explicit cancellation abort the second-argument AbortSignal; Promise handlers remain cooperative, while structural Observable handlers are unsubscribed. These contracts are identical with SQLite and PostgreSQL 15–18. BullMQ Pro telemetry and NestJS integration are intentionally not included.

Job Groups guide → · Worker options →

One Queue, Any Language (SDKs)

The server does all the heavy lifting. Official client SDKs share the protocol-conformant core Queue, Worker, and Flow surface, so producers and workers can live anywhere in your stack — add a job from TypeScript, process it from Python. Language-specific capabilities are tracked in the SDK guide.

Where your code runsInstall
Node.js ≥ 20, Deno ≥ 2, Bun, Cloudflare Workersnpm install bunqueue-client
Python ≥ 3.9pip install bunqueue-client
PHP ≥ 8.1composer require bunqueue/client
Go ≥ 1.26.5go get github.com/egeominotti/bunqueue/sdk/go
Rust ≥ 1.85cargo add bunqueue-client
Elixir ≥ 1.15Hex coming soon — today: use sdk/elixir as a path dependency
typescript
// Node.js / Deno / Cloudflare Workers
import { Queue, Worker } from 'bunqueue-client';

const queue = new Queue('emails', { host: 'localhost', port: 6789 });
await queue.add('welcome', { to: 'user@example.com' });

new Worker('emails', async (job) => ({ sent: true }), { concurrency: 10 });
python
# Python
from bunqueue import Queue, Worker

queue = Queue("emails", host="localhost", port=6789)
queue.add("welcome", {"to": "user@example.com"})

Worker("emails", lambda job: {"sent": True}, concurrency=10).run()

Every SDK is certified against the same public wire protocol and conformance suite.

Atomic flows, in every SDK

Every official FlowProducer resolves all job IDs and reciprocal dependency edges locally, then sends one PUSHF command. The broker validates the complete graph and commits it atomically, so a worker cannot observe a leaf from a partially-created flow.

typescript
import { FlowProducer } from 'bunqueue-client';

const flows = new FlowProducer({ host: 'localhost', port: 6789 });
const root = await flows.add({
  name: 'publish-release',
  queueName: 'release',
  data: { version: 'candidate-42' },
  children: [
    { name: 'unit-tests', queueName: 'checks', data: { suite: 'unit' } },
    { name: 'sdk-tests', queueName: 'checks', data: { suite: 'sdk' } },
  ],
});

console.log(
  root.job.id,
  root.children?.map(({ job }) => job.id)
);
await flows.close();

The repository records the contracts and the test strategy beside each implementation:

SDKRuntime invariantsGenerated testsMutation engine
TypeScriptcontractfast-checknone¹
PythoncontractHypothesismutmut
PHPcontractErisInfection
GocontractRapidGremlins
Rustcontractproptestcargo-mutants
ElixircontractStreamDataMuex

¹ The TypeScript SDK has no mutation engine. StrykerJS was removed because its dependency graph produced every advisory the weekly audit had to answer for, none of it reachable from the published client; the planners keep their fast-check coverage.

Property campaigns run in the ordinary SDK gate with deterministic replay seeds. Mutation campaigns run separately against the pure planners and snapshot validators. Contributors can reproduce the complete isolated SDK gate with bun run test:sandbox:sdk; language-specific commands live in each SDK README and AGENTS.md.

SDK guide (all six languages) →

Simple Mode

Bunqueue bundles Queue + Worker + routes + middleware + cron in one object:

typescript
import { Bunqueue } from 'bunqueue/client';

const app = new Bunqueue('notifications', {
  embedded: true,
  routes: {
    'send-email': async (job) => ({ sent: true }),
    'send-sms': async (job) => ({ sent: true }),
  },
  concurrency: 10,
  retry: { maxAttempts: 5, strategy: 'jitter' },
  circuitBreaker: { threshold: 5, resetTimeout: 30000 },
});

// Onion middleware around every job
app.use(async (job, next) => {
  const start = Date.now();
  const result = await next();
  console.log(`${job.name}: ${Date.now() - start}ms`);
  return result;
});

await app.cron('daily-report', '0 9 * * *', { type: 'summary' });
await app.add('send-email', { to: 'alice@example.com' });

app.on('completed', (job, result) => console.log(result));
await app.close();

Also included: batch processing, event triggers (job A completes → create job B), job TTL, priority aging, deduplication, per-group rate limiting, DLQ with auto-retry, graceful cancellation via AbortController.

Simple Mode reference →

Workflow Engine

Multi-step orchestration with saga compensation, branching, parallel steps and human-in-the-loop signals — built on bunqueue, no new infrastructure:

typescript
import { Workflow, Engine } from 'bunqueue/workflow';

const orderFlow = new Workflow('order-pipeline')
  .step(
    'reserve-stock',
    async () => {
      await inventory.reserve();
      return { reserved: true };
    },
    {
      compensate: async () => await inventory.release(), // auto-rollback on failure
    }
  )
  .step(
    'charge',
    async () => {
      return { txId: await payments.charge() };
    },
    {
      compensate: async () => await payments.refund(),
    }
  )
  .waitFor('manager-approval', { timeout: 86_400_000 }) // human-in-the-loop
  .step('confirm', async (ctx) => {
    return { txId: (ctx.steps['charge'] as { txId: string }).txId };
  });

const engine = new Engine({ embedded: true });
engine.register(orderFlow);
const run = await engine.start('order-pipeline', { orderId: 'ORD-1' });
await engine.signal(run.id, 'manager-approval', { approved: true });
bunqueueTemporalInngestTrigger.dev
InfrastructureNone (embedded)PostgreSQL + 7 servicesCloud-onlyRedis + PostgreSQL
Saga compensationBuilt-inManualManualManual
Human-in-the-loop.waitFor()Signals APIstep.waitForEvent()Waitpoint tokens
Self-hostedZero-configComplexNoComplex
PricingFree (MIT)Free / Cloud $$Per-executionFree tier, then $50/mo+

Also included: nested workflows, doUntil/doWhile loops, forEach over dynamic lists, schema validation (Zod, ArkType, Valibot or any .parse()), step timeouts, typed events, SQLite-persisted execution state.

Workflow Engine guide →

Built for AI Agents (MCP Server)

bunqueue ships a native MCP server: 73 tools, 5 resources, 3 prompts. Agents schedule cron jobs, push and process jobs, retry failures, set rate limits, and read stats — no glue code. HTTP handlers let an agent register a URL and have an embedded worker call it for every job.

bash
bun add bunqueue @modelcontextprotocol/sdk   # the MCP SDK is an optional peer
claude mcp add bunqueue -- bunx --package=bunqueue bunqueue-mcp
json
// Claude Desktop / Cursor / Windsurf
{
  "mcpServers": {
    "bunqueue": {
      "command": "bunx",
      "args": ["--package=bunqueue", "bunqueue-mcp"]
    }
  }
}

Then just ask: "Schedule a cleanup job every day at 3 AM" · "Show me all failed jobs and retry them" · "Set rate limit to 50/sec on api-calls".

MCP guide →

Dashboard

A web dashboard that fully drives your server — queues, jobs, DLQ, cron, webhooks, workers, live activity, SQLite inspector and an AI copilot. Open source, currently in beta:

bash
bunx bunqueue-dashboard

https://github.com/user-attachments/assets/e8a8d38e-b4a6-4dc8-8360-876c0f24d116

Live demo · User guide · GitHub

Performance

Native Ryzen 9 9950X3D, Bun 1.3.14; medians from repeated fresh processes:

WorkloadModeMedianPersistence
Internal batched push, 1M jobsEmbedded729,395 jobs/secIn-memory, no dataPath
Public sustained addBulk, 50K cellEmbedded186,384 jobs/secOn-disk buffered SQLite
PUSHB, fresh 50K sampleTCP158,779 jobs/secOn-disk buffered SQLite
No-work worker drain, concurrency 50TCP17,256 jobs/secFull pull/process/ACK
Linear Workflow EngineEmbedded / TCP2,700 / 3,187 workflows/secWorkflow SQLite + 3 queue nodes

These operations do different work; the internal in-memory result is not an SQLite or public-API claim. Run bun run bench, bun run bench:tcp, or bun run bench:workflow on your hardware. Benchmark methodology → · full engineering report

Documentation

bunqueue.dev →

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "bunqueue": {
      "command": "bun",
      "args": [
        "bunqueue",
        "start",
        "--data-path",
        "{{config.DATA_PATH}}"
      ]
    }
  }
}

Use bunqueue MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once bunqueue is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add bunqueue as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the bunqueue MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "bunqueue": {
      "command": "npx",
      "args": [
        "-y",
        "bunqueue"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the bunqueue MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the bunqueue MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use bunqueue to help me with this task?
bunqueue
Sure. I read it.
Here is what I found using bunqueue.

Option 2: Add an MCP server URL

Use this when bunqueue is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for bunqueue.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the bunqueue connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the bunqueue tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the bunqueue tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use bunqueue to help me with this task?
bunqueue
Sure. I read it.
Here is what I found using bunqueue.

Frequently asked questions

What is the bunqueue MCP server used for?

bunqueue is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use bunqueue MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use bunqueue with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use bunqueue MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With bunqueue connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect bunqueue MCP to TypingMind?

bunqueue can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does bunqueue MCP provide in TypingMind?

bunqueue exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use bunqueue MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If bunqueue requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇