Learning resourcesReviewed · GitHub

Invoking custom agents

This GitHub guide helps developers use specialized agents in Copilot CLI, but it leaves complete agent creation and initial CLI setup unexplained. It covers built-in agents, three invocation methods, profile locations and precedence, and basic MCP server configuration.

Researched 15 Nov 2026

In short.

This GitHub guide helps developers select and invoke specialized Copilot CLI agents, but it assumes access to the CLI and leaves complete profile creation to linked documentation. It explains four built-in agents, user-to-enterprise profile scopes, filename precedence, interactive and command-line invocation, and basic MCP setup. Skills receive only a brief introduction. Prices, installation requirements, licensing and behavior in a particular CLI version are not established, and nothing was executed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at the exact supplied address, including default agents, custom profiles and invocation, scope and filename precedence, the skills introduction, MCP setup and the steering reference. Linked pages are excluded. The selected text contains no explicit pricing, licence, release version or publication date. No CLI command, agent, skill, MCP connection or linked-page behavior was executed or assessed in operation.

The overview

Identity

Invoking custom agents is a GitHub Docs how-to about extending Copilot CLI through custom agents, skills and MCP servers. The resource is documentation, with commands and configuration locations, rather than a downloadable agent profile.

The original source address is [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-cli/use-copilot-cli/invoke-custom-agents].

Practical assessment

The guide is useful as a reference for developers who already use Copilot CLI and want a specialist agent or an additional integration. Its strongest details are the invocation commands, profile locations and precedence rules.

It does not supply a complete custom-agent profile, skill-creation procedure or MCP server configuration example. Those subjects are delegated to linked pages, so this page alone is insufficient for every setup step.

Who it is for

Individual developers can use user-level agents across projects or repository-level agents for a particular codebase. Teams can use organization-level profiles, while enterprises can place profiles in a designated organization's .github-private repository.

Beginners get concrete commands for choosing an existing agent. Experienced developers get scope and precedence details for managing shared profiles, although the page leaves profile syntax and enterprise preparation to other documentation.

Documented capabilities

The page describes four default agents. Explore handles quick codebase questions without adding to the main context. Task executes commands such as tests and builds, with brief success summaries and full failure output. General-purpose handles complex work in a separate context. Code-review is described as focusing on genuine issues and minimizing noise; its review accuracy is not measured here.

Custom profiles specify expertise, permitted tools and response instructions. Skills can contain instructions, scripts and resources. MCP servers add capabilities, and the preconfigured GitHub MCP server can interact with GitHub resources, including merging pull requests.

Using it

Requirements

The instructions assume access to Copilot CLI. Installation steps, supported operating systems, runtime dependencies, authentication, subscription eligibility and minimum CLI version are not specified.

Creating a profile requires placing a Markdown file in the appropriate location. Organization and enterprise profiles use designated repositories. The page does not explain repository access requirements, MCP authentication, permission scopes or approval behavior.

How it works

An agent profile tells Copilot what specialist role to adopt, which tools it may use and how to respond. The CLI model may delegate work to a subsidiary process using a custom agent, or handle the work directly. Delegation is described as a model choice, not a guaranteed outcome.

Profiles can exist at user, repository, organization and enterprise levels. When filenames conflict, user profiles override repository profiles, repository profiles override organization profiles, and organization profiles override enterprise profiles. This makes the filename relevant when diagnosing which definition applies.

Setup and invocation

User profiles belong in ~/.copilot/agents; repository profiles belong in .github/agents. Organization profiles use /agents in the organization's .github or .github-private repository. Enterprise profiles use /agents in a .github-private repository belonging to an organization designated in enterprise settings.

Select an available agent with /agent, name it directly in a prompt, or specify it with the --agent command-line option. The page says Copilot can infer the intended agent from a prompt naming it.

To add an MCP server, enter /mcp add, fill in the server details using Tab between fields, and save with Ctrl+S. Configuration is stored by default in ~/.copilot/mcp-config.json; COPILOT_HOME can change its directory. Required server fields and the complete JSON schema are not provided here.

Example

For an available agent named refactor-agent, the page gives this command: copilot --agent=refactor-agent --prompt "Refactor this code block".

The interactive alternative is /agent, or a prompt such as "Use the refactoring agent to refactor this code block". The page supplies neither the example agent's profile nor resulting code, so the example demonstrates invocation syntax only.

Assessment & evidence

Limitations

Nothing was executed. Agent discovery, prompt-based selection, profile precedence, delegation and MCP configuration are documented behaviors whose operation was not independently assessed.

The page includes no benchmarks, command results or evidence of improved code quality. It also does not explain context limits, tool-restriction enforcement or recovery from configuration failures.

Choosing an approach

Based on the documented roles, a custom agent is a plausible fit for recurring specialist instructions or coding conventions. A skill can package a task's instructions with scripts and resources. An MCP server can supply additional integration capabilities.

Profile scope also affects fit: user-level profiles suit personal conventions across projects, while repository-level profiles suit project-specific guidance. The documented filename precedence means a personal profile can take priority over shared definitions.

Alternatives

The included Explore, Task, General-purpose and Code-review agents may already cover the intended work, avoiding the need to author a profile. The main agent can also handle tasks directly.

Skills and MCP servers provide other extension approaches described on this page. Other coding assistants and comparative performance are outside the available evidence.

Evidence

The evidence consists of the complete GitHub Docs page titled Invoking custom agents, supplied as selected-page.txt from [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-cli/use-copilot-cli/invoke-custom-agents]. It supports documentation-based descriptions, not observed execution results.

Links to agent creation, skills, enterprise preparation, MCP configuration and agent steering identify further reading. Their contents are outside this report's evidence.

Access & freshness

Costs

The page provides no prices, subscription requirements, usage allowances or billing details for agents, skills or MCP connections. Cost is unknown; inclusion of default agents and a preconfigured GitHub MCP server does not establish free usage.

Charges associated with separately configured MCP services are also unknown.

Licensing and reuse

The supplied page states no licence or redistribution terms for its text and provides no reusable agent-profile file with accompanying terms. Redistribution rights are not established by this evidence.

Licensing for separately obtained profiles, skills and MCP servers must be determined from their own materials; this page supplies no applicable terms.

Freshness and version

The supplied copy was captured on 15 November 2026 at 08:20:13 UTC. This is a capture timestamp, not a publication or update date.

The page specifies no Copilot CLI release or compatibility range. Whether its instructions match a particular installed version is unknown.

Suggested next steps

For an existing Copilot CLI installation, inspect available agents with /agent and identify whether an included agent covers the task. Before adding a profile, choose its intended scope and check for filename conflicts.

Consult the linked creation documentation for complete profile syntax, and the linked skills or MCP guides for those extensions. Establish access requirements, permissions and costs from the relevant documentation before relying on the setup.

Evidence for this report

selected-page.txtselected · checked 2026-11-15