Remote MCP tools not available as deferred tools in pipe mode (-p)

Resolved 💬 3 comments Opened Mar 22, 2026 by dandelin Closed Mar 26, 2026

Description

Remote MCP servers (Gmail, Slack, Notion, etc.) connected via claude.ai OAuth are not available in claude -p (pipe mode) sessions, even though claude mcp list shows them as ✓ Connected.

Environment

  • Claude Code version: 2.1.81
  • OS: Amazon Linux 2023 (EKS pod)
  • Auth: claude.ai enterprise (OAuth)

Steps to reproduce

  1. Verify MCP connection: claude mcp list shows claude.ai Gmail: ✓ Connected
  2. Interactive session: Gmail MCP tools work fine (ToolSearch finds them, calls succeed)
  3. Pipe mode: echo 'Call ToolSearch with query="gmail"' | claude -pNo matching deferred tools found

Expected behavior

Remote MCP tools should be available as deferred tools in -p mode, same as in interactive sessions.

Actual behavior

ToolSearch("gmail") returns "No matching deferred tools found" in -p mode. The model cannot discover or use any remote MCP tools.

Impact

All cron-based automation using claude -p with MCP tools (Gmail scan, Slack search, etc.) is broken. This was working on a previous pod (likely earlier Claude Code version).

Workaround

For Slack: using bot token API calls to pre-fetch data before passing to claude -p.
For Gmail: no workaround available without separate Google OAuth setup.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗