claude-async
A fire-and-poll MCP server that lets Claude Code run long background jobs without hitting tool-call timeouts.
README
claude-async
A fire-and-poll MCP server that lets Claude Code run long background jobs without hitting the Claude app's tool-call timeout.
Requirements: Node.js 18+ (20+ recommended) and the claude CLI installed and authenticated.
License: MIT
The problem
The Claude desktop app caps how long any single MCP tool call can run — roughly 60s per call, with a ~4–5 minute transport ceiling. A long Claude Code task (a big refactor, a multi-step build) outlives that window, the call drops, and you lose the in-flight work and start over.
The fix
claude-async spawns Claude Code as a detached background process and hands back a jobId in milliseconds. You poll for results whenever you like.
- No single tool call lives long enough to time out.
- Jobs are detached, so they survive a bridge restart — reconnect with the same
jobId. - Output and exit status are written to disk per job, so nothing is lost.
Three tools: claude_start, claude_check, claude_jobs.
Set it up with Claude
Paste this prompt to Claude Code, or to Claude in the desktop app with this repo open. It stands the server up end to end and verifies it:
You're installing the `claude-async` MCP server from this repository. Work through
these steps in order and report the result of each. If any step fails, stop and show
me the exact error — do not continue.
1. Confirm prerequisites: `node -v` (must be 18+) and `claude --version` (the Claude
CLI must be installed and authenticated).
2. From the repo root, run `npm install`.
3. Verify the fire-and-poll plumbing without needing a live model:
`node claude-async-server.mjs --selftest`. It must report the detach → poll → exit
cycle passing.
4. Register the server with Claude Desktop by running `node register-desktop.mjs`.
(On Windows Store / MSIX installs this writes to the virtualized config path that
the in-app "Edit Config" button does NOT open — that mismatch is a known
silent-failure trap.) If you are not on Windows, add the config block from the
"Manual setup" section of the README instead.
5. Tell me to fully quit and relaunch Claude Desktop, then confirm `claude-async`
appears with status `running` under Settings → Connectors.
6. Smoke-test the round trip: call `claude_start` with the prompt "print hello world",
take the returned `jobId`, and poll `claude_check` until `status` is `completed`
and `exitCode` is 0. Show me the output.
Manual setup
If you'd rather not use the prompt above, or you're not on Windows:
-
Install dependencies:
npm install -
Verify the plumbing:
node claude-async-server.mjs --selftest -
Register the server by adding it to your Claude Desktop config file:
- Windows (Store / MSIX install):
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json(The in-app "Edit Config" button opens%APPDATA%\Claude\instead, which the Store build does not read. Edit the path above, or just runnode register-desktop.mjs.) - Windows (standard install):
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add:
- Windows (Store / MSIX install):
{
"mcpServers": {
"claude-async": {
"command": "node",
"args": ["/absolute/path/to/claude-async/claude-async-server.mjs"]
}
}
}
- Fully quit and relaunch Claude Desktop — closing the window is not enough. The
server should then show as
running.
Tools
| Tool | Input | Returns |
|---|---|---|
claude_start |
prompt (required), workFolder?, jobId?, model? |
jobId immediately; the job runs detached |
claude_check |
jobId (required), tailBytes? |
status, exitCode, and a tail of stdout/stderr |
claude_jobs |
— | every known job with its current status |
status is one of running | completed | failed | orphaned | unknown. completed is
reported only when the job exited with code 0; a non-zero exit is failed.
Field names are camelCase throughout — it's
jobId, notjob_id.
Configuration
Optional environment variables:
| Variable | Default | Purpose |
|---|---|---|
CLAUDE_CLI_PATH |
claude (on PATH) |
Path to the claude binary |
CLAUDE_ASYNC_JOB_DIR |
~/.claude-async-jobs |
Where per-job logs and exit codes are stored |
CLAUDE_ASYNC_DEFAULT_CWD |
$HOME |
Default working directory for jobs |
How it works
claude_start writes a small job record and spawns a detached worker
(job-runner.mjs) that runs the claude CLI, streaming stdout/stderr to that job's
log files and recording the exit code when it finishes. The parent returns the jobId
immediately and the worker is unref'd, so it keeps running even if the MCP bridge is
recycled. claude_check simply reads that job's status and log tail from disk — also
instant. Because state lives on disk rather than in the live connection, a dropped or
restarted bridge never costs you a running job.
Gotchas
- Server shows
runningbut tools don't respond: fully quit and relaunch the app; closing the window doesn't reload MCP servers. - Windows Store install, config edits ignored: you're editing the wrong file — see
the MSIX path under Manual setup, or run
register-desktop.mjs. - Very large
claude_startprompts fail on Windows (ENAMETOOLONG): the prompt is passed as a CLI argument, so keep it modest and have the job read large inputs from a file instead.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。