# bunqueue v2.5.1

Fixes 3 bugs and ships 2 additions. MCP error handling: All 66 tool handlers now wrapped with withErrorHandler that catches backend exceptions and returns structured { error: "message" } responses with isError: true instead of raw stack…

Canonical: https://bunqueue.dev/blog/bunqueue-v2-5-1/

---

<!-- Generated from changelog.md by docs/scripts/generate-release-posts.ts. Edit the changelog and regenerate. -->

Fixes 3 bugs and ships 2 additions. MCP error handling: All 66 tool handlers now wrapped with withErrorHandler that catches backend exceptions and returns structured { error: "message" } responses with isError: true instead of raw stack…

![](https://github.com/egeominotti.png?size=64) [egeominotti](https://github.com/egeominotti)

#### To install bunqueue v2.5.1

```bash title="bun"
bun add bunqueue@2.5.1
```

```bash title="npm"
npm install bunqueue@2.5.1
```

#### To upgrade bunqueue

```bash
bun add bunqueue@latest
```

## What's new

- `src/mcp/tools/withErrorHandler.ts`, Reusable error boundary for MCP tool handlers
- 39 new MCP backend tests (75 total), webhooks, worker management, monitoring, batch operations, heartbeat, progress, full lifecycle

## Bugfixes

- **MCP error handling**: All 66 tool handlers now wrapped with `withErrorHandler` that catches backend exceptions and returns structured `{ error: "message" }` responses with `isError: true` instead of raw stack traces
- **MCP TCP connection**: `createBackend()` is now async and properly awaits TCP connection. Previously used fire-and-forget (`void backend.connect()`) which silently swallowed connection failures
- **MCP not-found responses**: `bunqueue_get_job`, `bunqueue_get_job_by_custom_id`, `bunqueue_get_progress`, and `bunqueue_get_cron` now return `isError: true` when resource is not found

## Thanks to 1 contributor!

- [@egeominotti](https://github.com/egeominotti)

---

[← bunqueue v2.5.0](https://bunqueue.dev/blog/bunqueue-v2-5-0/) · [Release on GitHub](https://github.com/egeominotti/bunqueue/releases/tag/v2.5.1) · [Commits since v2.5.0](https://github.com/egeominotti/bunqueue/compare/v2.5.0...v2.5.1) · [Full changelog](https://bunqueue.dev/changelog/) · [All posts](https://bunqueue.dev/blog/)
