Answer: In a custom agent's YAML frontmatter, you configure MCP servers under the mcp-servers property, where secrets and environment variables must be configured as Agents secrets or variables at the organization or repository level and referenced using syntax such as ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} or ${{ vars.COPILOT_MCP_ENV_VAR_VALUE }}. Status: Confirmed Entry: tool/github-copilot/integrations/custom-agent-mcp-server-config Revision: 3 Digest: sha256:3e22b14e02eb076b (changes whenever the content changes) Timeline: Created: 2026-11-13T03:32:09Z Last changed: 2026-11-19T13:07:33Z (stdio type mapping: — → stdio) Last verified: 2026-11-20T13:13:49Z Next check: 2026-11-21T13:13:49Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of MCP servers property | mcp-servers | [1] | 2026-11-20 Secret reference syntax | ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} | [1] | 2026-11-20 Variable reference syntax | ${{ vars.COPILOT_MCP_ENV_VAR_VALUE }} | [1] | 2026-11-20 Where secrets must be configured | Agents secrets or variables at either the organization or repository level | [1] | 2026-11-20 Example env entry | ENV_VAR_NAME: ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} | [1] | 2026-11-20 stdio type mapping | stdio | [1] | 2026-11-20 Sources: [1] GitHub. "Custom agents configuration - GitHub Docs". https://docs.github.com/en/copilot/reference/custom-agents-configuration Role: primary. Accessed: 2026-11-20T13:13:49Z Quote: "The mcp-servers property in an agent profile is a YAML representation of the JSON configuration format used to configure MCP servers for repositories on GitHub." (Supports: MCP servers property) Quote: "${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} - Environment variable and header" (Supports: Secret reference syntax) Quote: "${{ vars.COPILOT_MCP_ENV_VAR_VALUE }} - Environment variable and header" (Supports: Variable reference syntax) Quote: "If your MCP server requires secrets or environment variables, these must be configured as Agents secrets or variables at either the organization or repository level." (Supports: Where secrets must be configured) Quote: "env: ENV_VAR_NAME: ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }}" (Supports: Example env entry) Quote: "the stdio type used by Claude Code and VS Code is mapped to Copilot in the cloud's local type" (Supports: stdio type mapping) Snapshot SHA-256: cd260b23db1ac94c47230d2ad230251c6810595855712f3d568eb8caf06ec1f8 (captured 2026-11-18T13:09:59Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:10:01Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:13:49Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:13:49Z Last attempt: 2026-11-20T13:13:49Z Notes and limitations: Extracted automatically from a single official source (section "MCP server configuration details"). Related: https://latestn.com/tool/github-copilot/integrations/custom-instructions-actions-helper What custom instructions can I use to make GitHub Copilot help with GitHub Actions? https://latestn.com/tool/github-copilot/integrations/distribute-plugin How do I distribute a GitHub Copilot CLI plugin to others? https://latestn.com/tool/github-copilot/integrations/extend-agent-mode-with-tools How do I extend GitHub Copilot agent mode with tools? https://latestn.com/tool/github-copilot/integrations/copilot-chat-mcp-skills How do I use MCP skills in GitHub Copilot Chat? https://latestn.com/tool/github-copilot/integrations/copilot-cli-mcp-server-config How do I configure an MCP server for GitHub Copilot CLI? https://latestn.com/tool/github-copilot/integrations/copilot-sdk-microsoft-agent-framework How do I use the GitHub Copilot SDK as an agent provider inside the Microsoft Agent Framework? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:07:33Z | changed | stdio type mapping: — → stdio | [1] 2026-11-19T13:07:33Z | changed | Example env entry: — → ENV_VAR_NAME: ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} | [1] 2026-11-19T13:07:33Z | changed | Where secrets must be configured: — → Agents secrets or variables at either the organization or repository level | [1] 2026-11-19T13:07:33Z | changed | Variable reference syntax: — → ${{ vars.COPILOT_MCP_ENV_VAR_VALUE }} | [1] 2026-11-19T13:07:33Z | changed | Secret reference syntax: — → ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} | [1] 2026-11-19T13:07:33Z | changed | Server type mapping: local → — | [1] 2026-11-19T13:07:33Z | changed | Secret requirement: Agents secrets or variables → — | [1] 2026-11-19T13:07:33Z | changed | Default syntax: ${COPILOT_MCP_ENV_VAR_VALUE:-default} → — | [1] 2026-11-19T13:07:33Z | changed | Claude Code syntax: ${COPILOT_MCP_ENV_VAR_VALUE} → — | [1] 2026-11-19T13:07:33Z | changed | Environment variable syntax: $COPILOT_MCP_ENV_VAR_VALUE → — | [1] 2026-11-19T13:07:33Z | changed | Variable syntax: ${{ vars.COPILOT_MCP_ENV_VAR_VALUE }} → — | [1] 2026-11-19T13:07:33Z | changed | Secret syntax: ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} → — | [1] 2026-11-17T13:33:21Z | changed | Secret requirement: — → Agents secrets or variables | [1] 2026-11-17T13:33:21Z | changed | Default syntax: — → ${COPILOT_MCP_ENV_VAR_VALUE:-default} | [1] 2026-11-17T13:33:21Z | changed | Claude Code syntax: — → ${COPILOT_MCP_ENV_VAR_VALUE} | [1] 2026-11-17T13:33:21Z | changed | Variable syntax: — → ${{ vars.COPILOT_MCP_ENV_VAR_VALUE }} | [1] 2026-11-17T13:33:21Z | changed | Secret syntax: — → ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} | [1] 2026-11-17T13:33:21Z | changed | MCP servers property: — → mcp-servers | [1] 2026-11-17T13:33:21Z | changed | Server type mapping: stdio → local | [1] 2026-11-17T13:33:21Z | changed | Secret storage requirement: Agents secrets or variables → — | [1] 2026-11-17T13:33:21Z | changed | Environment variable with default syntax: ${COPILOT_MCP_ENV_VAR_VALUE:-default} → — | [1] 2026-11-17T13:33:21Z | changed | Environment variable syntax (Claude Code): ${COPILOT_MCP_ENV_VAR_VALUE} → — | [1] 2026-11-17T13:33:21Z | changed | Variable reference syntax: ${{ vars.COPILOT_MCP_ENV_VAR_VALUE }} → — | [1] 2026-11-17T13:33:21Z | changed | Secret reference syntax: ${{ secrets.COPILOT_MCP_ENV_VAR_VALUE }} → — | [1] 2026-11-17T13:33:21Z | changed | Configuration property: mcp-servers → — | [1] 2026-11-13T03:32:09Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/integrations/custom-agent-mcp-server-config/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/github-copilot/integrations/custom-agent-mcp-server-config POST: https://latestn.com/dispute/tool/github-copilot/integrations/custom-agent-mcp-server-config with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/integrations/custom-agent-mcp-server-config?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I configure MCP servers in a GitHub Copilot custom agent, including environment variables and secrets? Revision 3, last verified 2026-11-20T13:13:49Z. https://latestn.com/tool/github-copilot/integrations/custom-agent-mcp-server-config (accessed 2026-11-21T09:54:26Z). @misc{LatestN_tool_github_copilot_integrations_custom_agent_mcp_server_config_r3, title = {How do I configure MCP servers in a GitHub Copilot custom agent, including environment variables and secrets?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/integrations/custom-agent-mcp-server-config}}, note = {Revision 3; digest sha256:3e22b14e02eb076b; last verified 2026-11-20T13:13:49Z; accessed 2026-11-21T09:54:26Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/github-copilot/integrations/custom-agent-mcp-server-config