Repository navigation
Installed plugin custom agent cancels its own HTTP MCP calls while default agent succeeds #5237
Description
Summary
An HTTP MCP server packaged with an installed Copilot plugin is discovered and its tool can be selected, but the connection is immediately cancelled whenever the plugin's custom agent is active. The same MCP tool succeeds from the default agent in the same repository project session and from a general chat.
This is a controlled custom-agent/default-agent difference, not a general MCP endpoint outage or malformed plugin configuration.
Environment
- GitHub Copilot app on Windows 11
- Copilot CLI
1.0.100 - Installed plugin version:
0.6.0 - Custom agent is manually selected and has:
target: github-copilotdisable-model-invocation: trueuser-invocable: true
- Plugin MCP declaration:
{
"mcpServers": {
"microsoft-learn": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
}
}
}The installed .mcp.json is byte-identical to the source declaration.
Steps to reproduce
- Install a plugin that contains both a custom agent and the HTTP MCP declaration above.
- Create a repository project session.
- Select the plugin custom agent.
- Ask the agent to invoke
microsoft-learn.microsoft_docs_searchonce. - Observe that the tool is discovered and a tool execution starts, but it completes almost immediately with a cancelled connection.
- Create another project session for the same repository without selecting the custom agent.
- Invoke the same tool and query using the default agent.
Actual behavior
Two independent fresh sessions with the plugin custom agent selected reproduced:
MCP server 'microsoft-learn': MCP server "microsoft-learn" connection was cancelled
Observed execution timings:
Custom-agent session A, attempt 1: 20:12:37.554Z -> 20:12:37.604Z, failed (50 ms)
Custom-agent session A, attempt 2: 20:16:53.996Z -> 20:16:54.059Z, failed (63 ms)
Custom-agent session B: 20:24:45.594Z -> 20:24:45.660Z, failed (66 ms)
The tool request is emitted correctly. Cancellation occurs during host execution after tool.execution_start.
Controlled comparison
The same microsoft-learn.microsoft_docs_search tool and endpoint succeed when the custom agent is not selected:
Default-agent project session in the same repository:
20:27:31.533Z -> 20:27:34.017Z, success
General chat:
20:24:40.107Z -> 20:24:43.164Z, success
The project session, repository, branch, installed plugin state, MCP endpoint, and query type were held constant for the project-session comparison. The controlled difference was custom-agent selection.
Expected behavior
A plugin custom agent should be able to execute tools from the MCP server packaged by that same installed plugin. Selecting the custom agent should not cancel an otherwise healthy MCP connection.
Impact
The custom agent can route to the MCP tool, but cannot execute it. This prevents the plugin from using its declared grounding capability, while the default agent can use the same server successfully.
Additional context
- No OAuth is involved in this MCP server.
- No repository, plugin, or Copilot configuration mutation occurred during the tests.
- The failure reproduced after creating a second clean custom-agent session.
- Related but distinct from Allow external custom agents (installed from plugins) to access globally configured MCP servers #1756: that issue concerns inheritance of globally configured MCP servers. Here, the MCP server is packaged with the installed plugin, its tool is discoverable, and execution is cancelled only under the plugin custom agent.
- Related but distinct from Selecting a custom agent disables deferred MCP tool loading from the second model call (all MCP tools loaded into context) #5195: this is not deferred-tool context loading or token growth. The selected tool starts execution and is immediately cancelled.
Full session identifiers and sanitized event excerpts can be provided privately if needed for host-side tracing.
Activity