-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Agent Plugin's MCP does not expand env variables #302579
Copy link
Copy link
Closed
Labels
agent-pluginsbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersverifiedVerification succeededVerification succeeded
Milestone
Description
How are we supposed to ship a local MCP server that requires env variables to work? The plugin loads fine in copilot CLI.
- Copilot Chat Extension Version: 0.39.2
- VS Code Version: 1.111.0
- OS Version: macOS 26.3
- Feature (e.g. agent/edit/ask mode): Does not matter
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): Does not matter
- Logs: No
Steps to Reproduce:
Create an agent plugin, and set the .mcp.json to something like this;
{
"mcpServers": {
"enterprise-github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"-e",
"GITHUB_HOST",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${ENTERPRISE_GITHUB_TOKEN}",
"GITHUB_HOST": "https://enterprise.github.example.com"
},
"tools": ["*"]
}
}
}
The MCP server does load but throws 401. Works fine in copilot CLI.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agent-pluginsbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersverifiedVerification succeededVerification succeeded