Custom agents cannot use deferred MCP tools even when declared in mcpServers/tools frontmatter

Resolved 💬 13 comments Opened Feb 12, 2026 by mtaube Closed May 23, 2026

Description

Custom agents defined in .claude/agents/ cannot access MCP tools at runtime, even when the MCP server is declared via mcpServers in the agent frontmatter and the specific tool names are listed in tools.

Reproduction Steps

  1. Configure a Notion MCP server in the project (verified working via /mcp and ListMcpResourcesTool in the parent session).
  1. Create a custom agent at .claude/agents/api-v2.md:

```yaml
---
name: api-v2
tools: Read, ToolSearch, mcp__notion__notion-search, mcp__notion__notion-fetch
mcpServers: notion
model: opus
---

# v2 API Builder Agent

## First Step: Load Standards from Notion

Your VERY FIRST tool call must be:

mcp__notion__notion-search(query: "API V2 Standards")

Do NOT skip this step.
```

  1. Spawn the agent via the Task tool.
  1. The agent never calls mcp__notion__notion-search. It proceeds directly to Read/Glob calls and later reports it was "unable to access Notion documentation."

What I Tried

  • Adding mcpServers: notion to frontmatter — no effect
  • Adding mcp__notion__notion-search and mcp__notion__notion-fetch explicitly to tools: — no effect
  • Adding ToolSearch to tools: and instructing the agent to call ToolSearch with +notion first — agent doesn't call it
  • Escalating prompt urgency ("VERY FIRST tool call", "CRITICAL", "Do NOT skip") — ignored by both Sonnet and Opus
  • Verifying the MCP server works in the parent session via ListMcpResourcesTool and ToolSearch — tools load and work correctly in the parent context

Expected Behavior

When a custom agent declares mcpServers: notion and lists MCP tools in tools:, those tools should be available and callable by the subagent at runtime — either pre-loaded or discoverable via ToolSearch.

Actual Behavior

The MCP tools appear to not be injected into the subagent's tool inventory at all. The agent never attempts to call them, suggesting they aren't present in its available tools, regardless of frontmatter declarations.

Suggested Improvements

  1. Hard-inject MCP tools declared via mcpServers into the subagent's tool inventory (not deferred).
  2. Fail loudly if mcpServers declares a server that isn't configured, rather than silently proceeding without those tools.
  3. Document whether/how deferred MCP tools can be made available to custom agents.

Environment

  • Claude Code CLI
  • macOS (Darwin 25.2.0)
  • Notion MCP server via @notionhq/notion-mcp-server

View original on GitHub ↗

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