[BUG] "mcpServers" yaml frontmatter in Subagent.md don't work when launching with `--agent` cli command
Resolved 💬 3 comments Opened Feb 25, 2026 by Etern213 Closed Mar 25, 2026
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?
"mcpServers" yaml frontmatter in Subagent.md don't work when launching with --agent cli command
What Should Happen?
"mcpServers" yaml frontmatter in Subagent.md should work properly when launching with --agent cli command
Error Messages/Logs
Steps to Reproduce
- Remove a mcp server from project config(.mcp.json)
- Add this mcp server to subagent.md frontmatter like below
---
name: my-new-subagent
description: ***
tools: ***
model: inherit
color: yellow
mcpServers:
- my-mcp-server:
type: "stdio"
command: "python"
args: []
---
- Lanch new session with cli args
--agent my-new-subagent, and ask claude to do something with mcp tools. - It appears that claude doesn't get tools in mcp properly
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.55
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗