Skip to content

Installed plugin custom agent cancels its own HTTP MCP calls while default agent succeeds #5237

Open

Description

@JGruszczyk

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-copilot
    • disable-model-invocation: true
    • user-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

  1. Install a plugin that contains both a custom agent and the HTTP MCP declaration above.
  2. Create a repository project session.
  3. Select the plugin custom agent.
  4. Ask the agent to invoke microsoft-learn.microsoft_docs_search once.
  5. Observe that the tool is discovered and a tool execution starts, but it completes almost immediately with a cancelled connection.
  6. Create another project session for the same repository without selecting the custom agent.
  7. 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

Full session identifiers and sanitized event excerpts can be provided privately if needed for host-side tracing.

Activity

  1. added
    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents
    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry
    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents
    and removed on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions