mcp-longjobs is a persistence and resumable-operation implementation for MCP servers, designed to solve the problem that long-running tasks and large file transfers tend to fail on existing clients.
Purpose
MCP servers often encounter three types of problems when performing real work: long tool calls time out (clients typically limit each call to 10–60 seconds), failures cannot be repaired (the model can only blindly retry or give up), and large files lack a transfer specification (base64 embedded in JSON has 33% overhead and is subject to message size limits, while bare URLs have no conventions for chunking, resumption, and integrity verification). The 2026-07-28 MCP specification added asynchronous execution capability via Tasks, but no clients currently support it, and the specification requires servers to reject tasks for clients that have not opted in. Therefore every long-running server needs a fallback that works on current clients, and mcp-longjobs is designed precisely for this.
Main capabilities
- Immediate return: tool calls such as crawl-site immediately return a taskId and polling instructions, avoiding timeouts.
- Real-time progress: polling durable_task_get can retrieve progress information such as { "status": "working", "progress": { "message": "Crawled /pricing", "fraction": 0.4 } }.
- Mid-task input: a task can pause in the input_required state, and after the model responds via durable_task_respond, the task continues from where it was interrupted.
- Persistent handle: after a client crashes or in a new session, calling durable_task_get with the same taskId can still resume, because state is stored in the storage layer rather than in the connection.
- Cooperative cancellation: durable_task_cancel aborts work at the next checkpoint.
- Structured failures: failures are returned as data, including code, retryable, recoveryHint, and partial.cursor, explaining the cause of the error, whether it can be retried, alternative approaches, and the parts that already succeeded, so the model can repair in a single round trip.
- File transfer: the model sees only metadata (handle, size, sha256, progress) and does not transfer bytes; small and medium payloads can be transferred in chunks via tool calls, while large files are recommended for out-of-band transfer (a TUS endpoint is planned), with integrity verified by the model.
Usage
This repository provides packages exported via subpaths. The specific installation commands, stdio configuration examples, and API details are given in the official documentation and are not fully provided in this material. The material mentions that once published to npm, the same server can be run with the single command npx mcp-longjobs. Example usage: point the client at this server (stdio), then ask it to "generate a report about EV batteries with 3 sections"; the model will start the task, poll durable_task_get, and retrieve the result. If the client is terminated midway and then restarted, requesting with the same taskId will resume it.
Design Philosophy
- Bytes do not pass through the model: the model only handles metadata, chunked tool calls are used for small to medium payloads, and large files go through an out-of-band channel.
- The model is a commander, not a porter: facade tool results come with instructions (such as "call durable_task_get with this id" or "resume from offset N"), so any capable model can drive the protocol without host-side support.
- Failures are repairable data: every failure carries code, retryable, recoveryHint, and partial.cursor.
- Lifecycle vocabulary is consistent with the specification: working / input_required / completed / failed / cancelled, making it easy for future native adapters to integrate seamlessly.
Applicable Scenarios
Suitable for MCP servers that need to execute long-running tasks (crawling, builds, batch processing, etc.) or transfer large files, especially on clients that currently do not support Tasks and need stable, resumable, cancellable asynchronous operations.
Limitations
The material does not provide specific details such as pricing, supported client lists, default storage backend configuration, the release date of the TUS endpoint, npm publication status, or complete installation commands; these contents are not yet provided. The project welcomes contributions, especially storage backends (SQLite/Redis), native ext-tasks adapters, and the TUS endpoint. For larger changes, it is recommended to open an issue for discussion first.