Using Custom Agents
Custom agents allow you to “specialize” GitHub Copilot through simple file-based configuration. Each agent is a.agent.md file that defines a specific AI persona or specialized mode for particular workflows and tools.
What are Custom Agents?
Custom agents are specialized GitHub Copilot agents that integrate with MCP (Model Context Protocol) servers to provide enhanced capabilities for specific workflows. They can be used in:- Copilot Coding Agent (CCA) - Assign to issues for automated development
- VS Code - Activate in chat sessions alongside built-in agents
- Copilot CLI - Coming soon
Custom agents differ from instructions and skills:
- Agents define AI personas with specific tools and behaviors
- Instructions provide coding standards that apply to file patterns
- Skills are self-contained capabilities with bundled resources
Installing Custom Agents
There are multiple ways to install custom agents:- One-Click Install
- Manual Download
- MCP Server
Browse the Agents Catalog and click the install button:
- VS Code: Click the VS Code install badge
- VS Code Insiders: Click the VS Code Insiders install badge
Agent File Structure
Every agent file follows this structure:Frontmatter Field Requirements
Frontmatter Field Requirements
- description (required): Wrapped in single quotes, describes the agent’s purpose
- name (required): Human-readable name (e.g., “Debug Mode” not “debug-mode”)
- tools (recommended): Array of tool names the agent can use
- model (strongly recommended): Specific AI model to use
- File naming: Use lowercase with hyphens (e.g.,
debug-mode.agent.md)
Activating Agents
Once installed, agents can be activated in different environments:- VS Code
- Copilot Coding Agent (CCA)
- CLI (Coming Soon)
- Open the GitHub Copilot chat panel
- Type
@to see available agents - Select your custom agent from the list
- Start chatting with the specialized agent
MCP Server Integration
Many custom agents require MCP servers to function:Check Agent Requirements
Review the agent’s documentation to see which MCP servers it needs. For example, the Context7 agent requires the Context7 MCP server.
Install Required MCP Servers
Click the MCP server install badges in the agent documentation, or manually configure in your VS Code settings:
Popular Agent Examples
Here are some commonly used agents from the repository:Creating Your Own Agents
Want to create custom agents for your team? See the Custom Agent File Guidelines in the repository. Key requirements:- Use
.agent.mdfile extension - Include required frontmatter fields
- Follow lowercase-with-hyphens naming convention
- Specify the
modelfield for consistent behavior - List
toolsthe agent needs
Best Practices
Choosing the Right Agent
Choosing the Right Agent
- Use specialized agents for domain-specific tasks (e.g., security, performance)
- Use general agents for everyday coding
- Switch agents based on the current task context
- Combine agents with instructions for maximum effectiveness
Agent Organization
Agent Organization
- Store agents in
.github/copilot/for repository-wide availability - Name agents clearly to indicate their purpose
- Document agent requirements (MCP servers, environment variables)
- Share successful agents with your team via pull requests
Troubleshooting
Troubleshooting
Agent not appearing:
- Check the file is in
.github/copilot/ - Verify frontmatter is valid YAML
- Reload VS Code window
- Verify required MCP servers are configured
- Check the
toolsfield matches available capabilities - Review agent instructions for clarity
Related Resources
- Browse All Agents
- Agent Skills - Self-contained capabilities
- Custom Instructions - Coding standards
- Contributing Guide