Learning Outcomes
- Configure the Foundry Connect MCP connection for Copilot inside VS Code.
- Understand why the CLI's environment variable does not reach the extension.
Copilot in VS Code
The VS Code extension loads MCP configuration from its own file and through a different loader than
the CLI. In particular it does not read the plugin's templated address, so the instance_host
variable that drives Copilot CLI never reaches it.
That means one extra step: write your real hostname out.
New here? Do Getting Started first.
Configure the connection
{
"servers": {
"foundry": {
"type": "http",
"url": "https://foundry.your-org.edu/mcp"
}
}
}
Replace the hostname with your own and keep the /mcp at the end. Unlike the CLI, there is no
variable to expand here: the address is literal, so a fork or a shared settings file carries whatever
instance it was written for.
Signing in
Sign-in follows the same OAuth flow as the CLI. Copilot follows the address Foundry Connect names when it refuses an unauthenticated request, so approving access once is enough.
To use a token instead, add it as a header alongside url, using an environment variable rather
than pasting the value:
{
"servers": {
"foundry": {
"type": "http",
"url": "https://foundry.your-org.edu/mcp",
"headers": { "X-Foundry-Connect-Token": "${env:FOUNDRY_TOKEN}" }
}
}
}
Check it worked
Open a Copilot chat and ask for something read-only, such as which pipelines you can see. If the assistant reports no such tool, the server did not load: restart VS Code, since MCP configuration is read at startup.
Less thoroughly verified than the CLI
The Copilot CLI instructions were measured end to end against a real instance. The VS Code extension loads MCP configuration through a different mechanism, and that path has had less testing. If something behaves differently from what is described here, please tell us.