In VS Code, a team's .vscode/mcp.json holds a remote MCP server needing sign-in and a local one using an ${input:...} key; why are both missing from Copilot-harness agent sessions?
answer
- two harnesses read MCP differently
- the Agent Host has its own config path
- interactive input is not forwarded
- authentication is a current limitation
- portable .mcp.json with mcpServers
basics
~10 sCopilot-harness sessions run on the Agent Host, which currently reaches only local MCP servers that need no authentication, and VS Code does not forward .vscode/mcp.json servers that need interactive input such as ${input:...} variables.
solid answer
~40 sA **Local** session runs in VS Code's extension host and uses every MCP server VS Code has configured, so both servers work there. A **Copilot** session runs on the **Agent Host**, which reads MCP configuration on its own terms. It natively reads the portable formats — workspace-root `.mcp.json` and `~/.copilot/mcp-config.json`, both with a top-level `mcpServers` object — and VS Code forwards servers from `.vscode/mcp.json` **except** those requiring interactive input such as `${input:...}`. On top of that, Copilot sessions can currently access only local MCP servers that do not require authentication, so the remote server needing sign-in is out too. Fixes: run that task in a Local session, or move the local server to `.mcp.json` without interactive input. `chat.mcp.autostart` will not help — it does not control Agent Host servers.
go deeper
Recall that MCP servers add tools to the agent and are configured in mcp.json files in the workspace or user profile.
Explain the difference between .vscode/mcp.json and the portable .mcp.json, and that Workspace Trust gates workspace servers.
Diagnose a harness-specific tool gap: forwarding rules for interactive input, the no-authentication limitation, autostart scope, the 128-tool ceiling.
Choose where a team's MCP configuration lives so it works across harnesses and Copilot tools without committing secrets.
## Two harnesses, two MCP paths VS Code's chat can run an agent session in different **harnesses**, chosen with the **Session Target** control. Two of them matter here: - **Local** runs in the VS Code **extension host** on your machine. It can use VS Code's built-in tools, extension tools, MCP servers and any model configured in VS Code. - **Copilot** runs on the **Agent Host**, the runtime shared with Copilot CLI. It owns sessions independently of the window, and it reads customizations — MCP configuration included — from harness-agnostic locations rather than from VS Code's own files. | | Local (extension host) | Copilot (Agent Host) | |---|---|---| | `.vscode/mcp.json` (`servers` object) | Read directly | Forwarded by VS Code, minus servers needing interactive input | | `.mcp.json` at workspace root (`mcpServers`) | Read | Read natively | | `~/.copilot/mcp-config.json` (`mcpServers`) | Read | Read natively | | Servers needing authentication | Supported | Currently not available | | `chat.mcp.autostart` | Controls the autostart pass | Does not control Agent Host servers | ## Why each server disappears 1. **The local server with `${input:api-key}`.** Input variables make VS Code prompt for a secret the first time the server starts and store it securely. The Agent Host has no such prompt, so VS Code does not forward servers that require interactive input. 2. **The remote server needing sign-in.** The Copilot harness's documented limitation is that sessions can currently access only local MCP servers that don't require authentication. In the Local harness both work, which is what makes the symptom confusing: same window, same `.vscode/mcp.json`, different tool list. ## Fixing it - **Pick the harness for the task.** If the work needs the authenticated remote server today, run it in a Local session. - **Move local servers to the portable format.** Put them in workspace-root `.mcp.json` (top-level `mcpServers`) without interactive input, so the Agent Host reads them natively and they keep working in other Copilot tools. VS Code's **MCP: Add Server** flow already offers `.mcp.json` and the **Copilot Global** file first and lists `.vscode/mcp.json` as a deprecated destination kept for compatibility. - **Keep secrets out of the file.** The docs warn against hardcoding API keys; supply the value through the server's environment rather than committing it. ## Other reasons agent tools go missing - **Workspace Trust.** Servers in `.vscode/mcp.json` and workspace-root `.mcp.json` inherit Workspace Trust. In restricted mode they do not start — and restricted mode disables agents altogether. - **Server trust and state.** Servers from other sources ask for a separate trust decision when they first start or their configuration changes; an untrusted, disabled or errored server contributes no tools. **MCP: List Servers** → **Show Output** shows its log. - **Tool availability.** In Local, **Configure Tools** in the chat input selects tools per request; for Copilot, the **Tools** tab of the Agent Customizations editor manages availability in the user profile. - **The 128-tool ceiling.** A request can have at most 128 tools enabled; deselect servers or enable virtual tools with `github.copilot.chat.virtualTools.threshold` (Experimental). - **A custom agent's `tools` list.** If the active custom agent names specific tools, an MCP server's tools appear only when listed — `github/*` includes all of a server named `github`. ## Checking what a session actually sees 1. Type `#` in the chat input to browse the tools, tool sets and context items the current session offers. 2. For a Copilot session, open the Agent Customizations editor's **Tools** tab: tools are grouped by source with enabled and total counts, and the read-only **Copilot** group lists the harness's built-in tools. 3. Run **MCP: List Servers** to see each server's state, start or stop it, and open its output log. Remember that client-side tools — those running in VS Code rather than in the Copilot runtime — are available to a Copilot session only while VS Code is connected to it. ## After the tools appear Availability is not approval. MCP tool calls still follow the session's permission level; **Chat: Manage Tool Approval** groups saved approvals by server and lets you pre-approve calls or their results. On macOS and Linux, a local stdio server can run with `"sandboxEnabled": true`, which restricts its file-system and network access and auto-approves its tool calls.
- A Copilot agent request in VS Code fails with "Cannot have more than 128 tools per request." What do you do?Reduce what is enabled: open the tools picker and deselect individual tools or whole MCP servers that the task does not need. Alternatively, set `github.copilot.chat.virtualTools.threshold` (Experimental) so VS Code groups large tool sets into virtual tools automatically.
- Does setting `chat.mcp.autostart` to `never` stop a Copilot session from starting its MCP servers?No. The setting only controls VS Code's own autostart pass when you submit a message. The Agent Host and Copilot SDK manage their MCP server processes independently, starting servers configured in `.mcp.json`, `~/.copilot/mcp-config.json` and forwarded `.vscode/mcp.json` entries.
- How does a custom agent get every tool from one MCP server without listing each tool?Add `<server name>/*` to the `tools` list in its `.agent.md` frontmatter — for example `'github/*'` for a server named `github`. Tools that are unavailable in the current session are ignored rather than failing the agent.
- The Copilot harness reads .vscode/mcp.json exactly as the Local harness does.
- Setting chat.mcp.autostart to never stops Agent Host sessions starting servers.
- Workspace Trust has nothing to do with whether workspace MCP servers start.
- Enabling an MCP server's tools auto-approves every call to them.
- Servers with ${input:...} variables are forwarded and prompt inside the Agent Host.