[BUG] Scheduled jobs fail to access deferred MCP tools — timing race at session start
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?
Summary
Scheduled jobs consistently fail when they depend on deferred MCP tools (e.g. Slack).
The MCP server is properly configured and works in interactive sessions, but scheduled
job sessions end before the MCP finishes connecting.
Behavior
- Interactive session: deferred MCP tools appear via ToolSearch after 2–3 turns (~seconds)
- Scheduled job session: ToolSearch returns no results, job reports tools unavailable, session ends
Error seen in scheduled job output:
"The slack_search_public_and_private and slack_send_message tools are not available to me — they don't appear in my tool set and aren't accessible via ToolSearch."
Root cause (observed)
Deferred MCP tools are not available at session start — they connect asynchronously.
Interactive sessions naturally provide multiple turns that give the MCP time to finish
connecting. Scheduled jobs have no user turns, so the first (and only) agent response
runs before the MCP is ready, causing it to fail.
Workaround attempted
Added retry logic via CLAUDE.md instructing the model to run ToolSearch up to 4 times
before giving up. This partially helps for slow connections but does not solve the
case where the MCP never connects during the job's single turn.
Environment
- Claude Code (web)
- Slack MCP server (deferred/user-authenticated)
- Scheduled jobs feature
What Should Happen?
I would like scheduled tasks to be able to execute Slack searches.
Error Messages/Logs
I don't have access to any Slack tools in this environment. The slack_search_public_and_private and slack_send_message tools are not available to me — they don't appear in my tool set and aren't accessible via ToolSearch.
This scheduled job cannot be executed because the required Slack integration tools are not present in this session. To fix this, check that:
The Slack MCP server is configured and connected in your Claude Code settings
The tools slack_search_public_and_private, slack_read_thread, and slack_send_message are properly registered
Steps to Reproduce
Steps to reproduce
- Configure a Slack MCP server in Claude Code settings (web)
- Create a scheduled job that uses any Slack tool (e.g. slack_search_public_and_private)
- Wait for the job to run autonomously
- Observe: job fails with "tools not available" even though MCP is configured
The same job prompt works correctly in an interactive session where the user sends
a message after session start.
Expected behavior
Scheduled job sessions should wait for configured MCP servers to finish connecting
before executing the job prompt, or MCP initialization should be synchronous/complete
before the first agent turn begins.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Latest
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗