[BUG] `claude mcp serve`: Bash run_in_background output is unreachable since TaskOutput was removed (2.1.277)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
2.1.277 removed the TaskOutput tool ("Claude reads a background task's output file with Read instead"). That works in an interactive session because the completion notification names the output file. Under claude mcp serve there is no conversation loop to receive that notification, and the Bash tool result itself does not name the file. An MCP client that calls Bash with run_in_background: true gets back only a task id and has no way to ever read the output.
The output file does exist on disk at /tmp/claude-<uid>/<cwd-slug>/<session-uuid>/tasks/<task-id>.output, but the session uuid is not exposed to the MCP client, so the path cannot be derived.
tools/list under mcp serve still advertises run_in_background on Bash and still lists TaskStop, so the flag looks usable but is a dead end.
What Should Happen?
One of:
- the
Bashresult for a background task includes the output file path (the same information the interactive notification carries), or run_in_backgroundis not offered onBashunderclaude mcp serve.
Error Messages/Logs
tools/call Bash {"command":"sleep 3; echo done-bg","run_in_background":true}
{"content":[{"type":"text","text":"{\"stdout\":\"\",\"stderr\":\"\",\"interrupted\":false,\"isImage\":false,\"noOutputExpected\":false,\"backgroundTaskId\":\"b025q92zk\"}"}]}
tools/list (2.1.291) returns 21 tools, no TaskOutput:
Agent, Bash, Read, Edit, Write, NotebookEdit, WebFetch, ReportFindings, WebSearch,
TaskStop, Skill, EnterWorktree, ExitWorktree, SendMessage, ListAgents, Workflow,
CronCreate, CronDelete, CronList, ScheduleWakeup, ToolSearch
Steps to Reproduce
- Start
claude mcp servefrom any MCP client over stdio (I used the PythonmcpSDK; any client works). initialize, thentools/callBashwith{"command":"sleep 3; echo done-bg","run_in_background":true}.- Observe the result above: a
backgroundTaskIdand nothing else. tools/list: there is noTaskOutput, and no other tool accepts the task id to read its output.
Claude Model
n/a (no model involved; claude mcp serve is used as a tool server)
Is this a regression?
Yes
Last Working Version
2.1.272 (last version I used that still exposed TaskOutput through mcp serve; the changelog says it was removed in 2.1.277)
Claude Code Version
2.1.291
Platform
CLI (claude mcp serve)
Operating System
Linux (Ubuntu, kernel 6.17)
Terminal/Shell
bash
Additional Information
Context: we proxy claude mcp serve running on remote lab machines over SSH into a local Claude Code, so the model and its credential stay local while tools execute remotely. Until 2.1.277 background work went through run_in_background + TaskOutput. We have worked around this by stripping run_in_background from the proxied Bash schema and using nohup ... > log & plus Read, but any direct consumer of claude mcp serve hits the same wall.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗