Describe the bug
Custom agents defined in ~/.copilot/agents/ with mcp-servers declared in their YAML frontmatter do NOT receive MCP tool connections when invoked as sub-agents (via the task tool) or as the primary agent via --prompt mode. The agent only receives basic tools (view, skill, report_intent) instead of the MCP server tools declared in its profile.
Affected version
1.0.23
Steps to reproduce the behavior
Steps to reproduce
-
Configure MCP servers globally in ~/.copilot/mcp-config.json:
{
"mcpServers": {
"my-mcp-server": {
"type": "http",
"url": "https://example.com/mcp",
"tools": ["*"]
}
}
}
-
Create a custom agent in ~/.copilot/agents/my-agent.agent.md:
---
name: my-agent
description: Agent that uses MCP tools
tools:
- "my-mcp-server/*"
mcp-servers:
my-mcp-server:
type: 'http'
url: 'https://example.com/mcp'
tools: ["*"]
---
Agent prompt here.
-
In the interactive CLI session, MCP tools work perfectly — the main agent can call my-mcp-server tools without issues.
-
Invoke the custom agent as a sub-agent via the task tool:
Use my-agent to perform a task that requires my-mcp-server tools
-
Result: The custom agent reports it only has access to view, skill, and report_intent. None of the MCP server tools declared in its mcp-servers frontmatter are available.
-
Also fails with --prompt mode:
copilot --agent=my-agent --prompt "List your available tools" --allow-all
Same result — no MCP tools available.
Expected behavior
Expected behavior
When a custom agent declares mcp-servers in its YAML frontmatter, those MCP connections should be established and the tools should be available to the agent, regardless of whether the agent runs as:
- A sub-agent via the
task tool
- The primary agent via
--agent + --prompt
- The primary agent in interactive mode
The Custom agents configuration docs confirm that mcp-servers is a supported YAML frontmatter property. The tools property is documented to control tool access including from MCP servers.
Additional context
Actual behavior
- Interactive session (main agent): ✅ MCP tools from
mcp-config.json work
- Sub-agent via
task tool: ❌ Only view, skill, report_intent available
- Primary agent via
--prompt: ❌ Only skill, report_intent available
- Primary agent via
--agent + --prompt: ❌ Same — no MCP tools
Impact
This prevents custom agents from being used for any workflow that depends on MCP server tools (e.g., Teams, Mail, Calendar, database, or any external API). The workaround is to have the main agent execute the MCP calls directly instead of delegating to the custom agent — which defeats the purpose of agent specialization.
Environment
- OS: Windows 11
- Copilot CLI: v1.0.23
- MCP server type: HTTP (Streamable HTTP)
- Agent location:
~/.copilot/agents/
- MCP config location:
~/.copilot/mcp-config.json
Describe the bug
Custom agents defined in
~/.copilot/agents/withmcp-serversdeclared in their YAML frontmatter do NOT receive MCP tool connections when invoked as sub-agents (via thetasktool) or as the primary agent via--promptmode. The agent only receives basic tools (view,skill,report_intent) instead of the MCP server tools declared in its profile.Affected version
1.0.23
Steps to reproduce the behavior
Steps to reproduce
Configure MCP servers globally in
~/.copilot/mcp-config.json:{ "mcpServers": { "my-mcp-server": { "type": "http", "url": "https://example.com/mcp", "tools": ["*"] } } }Create a custom agent in
~/.copilot/agents/my-agent.agent.md:In the interactive CLI session, MCP tools work perfectly — the main agent can call
my-mcp-servertools without issues.Invoke the custom agent as a sub-agent via the
tasktool:Result: The custom agent reports it only has access to
view,skill, andreport_intent. None of the MCP server tools declared in itsmcp-serversfrontmatter are available.Also fails with
--promptmode:copilot --agent=my-agent --prompt "List your available tools" --allow-allSame result — no MCP tools available.
Expected behavior
Expected behavior
When a custom agent declares
mcp-serversin its YAML frontmatter, those MCP connections should be established and the tools should be available to the agent, regardless of whether the agent runs as:tasktool--agent+--promptThe Custom agents configuration docs confirm that
mcp-serversis a supported YAML frontmatter property. Thetoolsproperty is documented to control tool access including from MCP servers.Additional context
Actual behavior
mcp-config.jsonworktasktool: ❌ Onlyview,skill,report_intentavailable--prompt: ❌ Onlyskill,report_intentavailable--agent+--prompt: ❌ Same — no MCP toolsImpact
This prevents custom agents from being used for any workflow that depends on MCP server tools (e.g., Teams, Mail, Calendar, database, or any external API). The workaround is to have the main agent execute the MCP calls directly instead of delegating to the custom agent — which defeats the purpose of agent specialization.
Environment
~/.copilot/agents/~/.copilot/mcp-config.json