Domain 6 of 6 · Chapter 2 of 4

Configure MCP servers

Unlock the complete study guide.

Bundled into the existing Developing in Agentic AI Systems premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • Three configuration surfaces, and which agent reads each
  • Declaring a server: a launched process or an independent endpoint
  • Porting an editor entry to repository settings
  • What a cloud agent session can reach, and what it cannot
  • Autonomy makes the tools list a security control
  • Proving a cloud agent's MCP server started
  • In the editor: from a definition to a running server
  • In the editor: shipping a server definition safely
  • Tools, resources and prompts: three ways the editor uses a server
  • Fleet governance: restricting the catalog does not restrict the source
  • Fleet governance: which named servers may run
  • Fleet governance: which value applies when policy sources overlap
  • Fleet governance: confirming what a device actually enforces

Which MCP control does what, and where it lives

GoalControlWhere it is setWhat it does not do
Give cloud agent and code review a serverAn entry in the `mcpServers` objectRepository Settings > Copilot > MCP serversReach a developer's editor, which reads its own file
Share a server with one project's teamAn entry under the top-level `servers` objectThe editor file at workspace scope: `.vscode/mcp.json`, committedApply to agent sessions running on GitHub
Keep a personal server across projectsThe editor file at user-profile scopeMCP: Open User ConfigurationTravel to colleagues through source control
Give one custom agent its own serverMCP servers declared in the profileThat custom agent profileOverride repository MCP settings, which are processed later
Bound what an autonomous session may callThe `tools` field on each server entryRepository MCP settingsChange the credential the server authenticates with
Read data outside the current repositoryCOPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKENAgents secret, organization or repository levelWiden what the built-in read-only token can reach
Offer a curated catalog of serversMcpGalleryServiceUrlVS Code enterprise policyStop a server added from another source
Restrict where servers may come fromChatMCPVS Code enterprise policyChoose which catalog is displayed
Permit only named serversallowedMcpServersCopilot managed settings, or VS Code enterprise policy (the Copilot managed value wins where both set it)Close other sources that can grant access
Remove one server from a broad approved setdeniedMcpServersCopilot managed settings, or VS Code enterprise policy (the Copilot managed value wins where both set it)Grant anything — deny entries only block
Make the enterprise-managed allowlist the only grantallowManagedMcpServersOnlyCopilot managed settingsAdd a server to that allowlist
Establish what a laptop actually enforcesDeveloper: Policy DiagnosticsRun in the affected VS Code instanceChange any value — it only reports

Decision tree

Should the server belong to onecustom agent only?That custom agent profile: servers forthat agent; repository settings apply lateryesnoMust an autonomous cloud agent or codereview session use the server?Repository Settings > Copilot > MCP servers:an mcpServers entry, with a tools allowlistyesnoShould everyone who opens this projectget the server with the clone?Editor file, workspace scope: .vscode/mcp.json,committed, secrets kept out (or declared indevcontainer.json customizations.vscode.mcp)yesnoEditor file, user-profile scope: followsone developer across every workspaceA gate, not a place to declare: policy decides which servers a managed device may install or run.Copilot managed settings: allowedMcpServers, deniedMcpServers, allowManagedMcpServersOnlyVS Code enterprise policy: ChatMCP (source) and McpGalleryServiceUrl (catalog)The allow and deny lists can also arrive as VS Code enterprise policy;where both set the same list, the Copilot managed value applies.In the editor: trust and enable the server,restart after changes, then read its output log.In a cloud agent session: check theStart MCP Servers step in the session log.

Cheat sheet

  • Configure shared repository MCP servers in Copilot MCP settings
  • Supply a launch command and argument array for a local MCP server
  • Allowlist MCP tools before granting an autonomous cloud agent access
  • Expose required capabilities as tools for cloud-agent MCP integrations
  • Repository MCP settings override custom-agent and built-in MCP configuration
  • Adapt interactive editor MCP inputs before reusing configuration in the cloud
  • Validate MCP startup by inspecting the tools discovered in the session logs
  • The built-in GitHub MCP token is read-only and limited to the current repository
  • Use the dedicated GitHub MCP token secret to read additional repositories
  • Do not assume an editor's interactive OAuth MCP connection works in cloud agent
  • Choose the entry by transport: stdio launches, Streamable HTTP reaches an endpoint
  • Choose workspace or user-profile MCP configuration to match sharing scope
  • Use the editor's servers map rather than the cloud repository JSON wrapper
  • Keep sensitive MCP values out of shared VS Code configuration
  • Review server trust separately from approving an individual tool call
  • Disable an MCP server without changing the team's shared definition
  • Restart the MCP server after configuration changes to rediscover tools
  • Put dev-container MCP definitions under customizations.vscode.mcp
  • Point VS Code at a private registry with McpGalleryServiceUrl
  • Discover registry servers through the MCP filter in the Extensions view
  • Configure source restriction as well as the registry URL
  • Use Policy Diagnostics to inspect the effective managed configuration
  • Use allowedMcpServers to restrict which servers can be installed or run
  • A managed MCP deny entry wins over an allow entry
  • Match remote and local MCP servers with the appropriate allowlist identity
  • Require the enterprise-managed allowlist to be the source of MCP grants
  • Copilot managed MCP lists replace the equivalent VS Code enterprise-policy list
  • Resolve overlapping managed MCP settings per key rather than replacing the entire configuration
  • Verify client support before treating an MCP managed setting as enforced
  • Choose MCP resources for context, prompts for templates, and tools for execution
  • Sandbox local stdio MCP processes with host-supported access rules
  • Inspect the selected MCP server's output when validating its editor connection

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. https://docs.github.com/en/copilot/how-tos/use-copilot-agents/cloud-agent/extend-cloud-agent-with-mcp
  2. https://code.visualstudio.com/docs/enterprise/ai-settings