GitHub Copilot custom agents can now connect to external tools via MCP (Model Context Protocol) servers. This guide demonstrates building a Rails debugging agent that automatically fetches production errors from Honeybadger, analyzes stack traces, investigates codebases, and creates pull requests with fixes and tests. The setup involves creating a Markdown agent profile with YAML configuration, connecting to an MCP server via Docker, and configuring repository secrets. The article covers both organization-wide and repository-specific agent configurations, testing strategies, and important security considerations around prompt injection attacks when agents have access to private data in public repositories.
Table of contents
What is a Copilot custom agent?How to create a Copilot agent for Rails debuggingAbout honeybadger-mcp-serverConfiguring the agentSetting up the agent in your GitHub organizationTesting Copilot AI agentsConfiguring an agent in a single repositoryGitHub Copilot securityFixing errors with Copilot custom agentsSort: