Custom agents cannot use deferred MCP tools even when declared in mcpServers/tools frontmatter
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
- Configure a Notion MCP server in the project (verified working via
/mcpandListMcpResourcesToolin the parent session).
- 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.
```
- Spawn the agent via the
Tasktool.
- The agent never calls
mcp__notion__notion-search. It proceeds directly toRead/Globcalls and later reports it was "unable to access Notion documentation."
What I Tried
- Adding
mcpServers: notionto frontmatter — no effect - Adding
mcp__notion__notion-searchandmcp__notion__notion-fetchexplicitly totools:— no effect - Adding
ToolSearchtotools:and instructing the agent to callToolSearchwith+notionfirst — 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
ListMcpResourcesToolandToolSearch— 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
- Hard-inject MCP tools declared via
mcpServersinto the subagent's tool inventory (not deferred). - Fail loudly if
mcpServersdeclares a server that isn't configured, rather than silently proceeding without those tools. - 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
This issue has 13 comments on GitHub. Read the full discussion on GitHub ↗