Skip to content

agentPlugins: expand PLUGIN_ROOT in Agent Plugin MCP servers - #338995

Merged
Paul (pwang347) merged 4 commits into
mainfrom
pwang/agent-plugin-mcp-plugin-root
Sep 30, 2026
Merged

Paul (pwang347) merged 4 commits into
mainfrom
pwang/agent-plugin-mcp-plugin-root

Conversation

@pwang347

@pwang347 Paul (pwang347) commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • expand ${PLUGIN_ROOT} in Agent Plugins v1 stdio arguments, environment values, and working directories
  • expose PLUGIN_ROOT in local MCP server environments
  • resolve ./ commands and the default working directory against the plugin root
  • preserve ${PLUGIN_DATA} and other runtime placeholders while leaving command and remote fields literal
  • document the Agent Plugin MCP path behavior

Follow-up to #338967.

Reproduction

Agent Plugins v1 MCP definitions currently leave ${PLUGIN_ROOT} unresolved in portable stdio arguments, environment values, and working directories. MCP servers that reference plugin-bundled resources through those fields therefore fail in the Local harness.

Validation

  • npm run eslint -- src/vs/platform/agentPlugins/common/pluginParsers.ts src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts — passed
  • npm run transpile-client — passed
  • ./scripts/test.sh --run src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/agentPluginFormatDetection.test.ts — 106 passing
  • npm run typecheck-client — passed
  • FFMPEG_PATH=/opt/homebrew/opt/ffmpeg-full/bin/ffmpeg FFPROBE_PATH=/opt/homebrew/opt/ffmpeg-full/bin/ffprobe node test/scenario/out/runScenario.js .build/vscode-playwright-mcp/pr-338995-plugin-root-evidence.cjs --dev — 4 steps passed on macOS arm64 using VS Code 1.141.0 Dev

Evidence

The captioned dev-build run opens an Agent Plugin mcp.json, discovers its MCP server, launches it with resolved argument/cwd/environment values, and confirms the server is running.

annotated.mp4

Copilot AI balanced review requested due to automatic review settings September 30, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The interpolation exceeds Agent Plugins v1 field semantics and lacks required working-directory containment validation.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds ${PLUGIN_ROOT} handling for Agent Plugin MCP definitions and local server environments.

Changes:

  • Configures Agent Plugins to interpolate PLUGIN_ROOT.
  • Updates parser coverage for interpolation and placeholder preservation.
  • Documents the new MCP behavior.
File Description
pluginParsers.ts Enables Agent Plugin MCP root interpolation.
pluginParsers.test.ts Tests MCP field and environment expansion.
AGENTS_PLUGINS.md Documents MCP interpolation behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: f5f73df3 Current: 195ae70f

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverPluginsLoadingMore/Light
Before After
before after

2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

@pwang347
Paul (pwang347) marked this pull request as ready for review September 30, 2026 22:57
@pwang347
Paul (pwang347) enabled auto-merge (squash) September 30, 2026 22:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants