Skip to content

fix(plugins): discover MCP servers from mcp.json at plugin root - #2713

Open
aaronpowell wants to merge 2 commits into
mainfrom
aaronpowell-shiny-couscous
Open

fix(plugins): discover MCP servers from mcp.json at plugin root#2713
aaronpowell wants to merge 2 commits into
mainfrom
aaronpowell-shiny-couscous

Conversation

@aaronpowell

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, workflow, or canvas extension file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, workflow, or canvas extension with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.
  • I am targeting the main branch for this pull request.

Description

Plugins that ship an MCP server were losing that server during publish. The root cause wasn't the copy step in materialize-plugins.mjs, it was where the config was declared: plugins pointed at their MCP file with extensions["com.github.awesome-copilot"].mcpServers": "./.mcp.json", and that whole namespace is stripped when the served manifest is emitted. Nothing carried the MCP declaration through to the marketplace branch, so contributors had to keep re-adding the pointer and it still didn't survive.

The Agent Plugins v1.0.0 spec already solves this: MCP servers are discovered from a fixed mcp.json at the plugin root (§6.1), and §7.2.1 explicitly says MCP config "MUST NOT be declared inline in plugin.json or loaded from any alternative core path." Since that file lives at the plugin root it is committed and rsynced as-is, so it needs no materialization at all. This PR moves us onto that model and drops the pointer entirely.

Changes:

  • Renamed plugins/awesome-copilot/.mcp.json and plugins/context-matic/.mcp.json to mcp.json, adding the required mcp.schema.json $schema and the explicit type field (stdio and streamable-http respectively), which the old files were missing.
  • Removed the mcpServers pointer from plugins/awesome-copilot/plugin.json.
  • generate-website-data.mjs now reads mcp.json off disk instead of following the manifest field, so the website keeps listing MCP items.
  • validate-plugins.mjs gains validateMcpConfig, which rejects a legacy .mcp.json, a wrong or missing $schema, extra top-level fields (the spec's mcpServers object is closed), unknown transport types, and servers missing command/url. It also rejects mcpServers appearing anywhere in plugin.json.

Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • New canvas extension.
  • Update to existing instruction, prompt, agent, plugin, skill, workflow, or canvas extension.
  • Other (please specify):

Additional Notes

Worth a careful look: this is a breaking change for any in-flight plugin PR that declares mcpServers in its manifest. Validation now fails loudly with a message pointing at mcp.json, which seemed better than silently ignoring the field and shipping a plugin with no MCP server, but it is a behaviour change either way.

The context-matic server had no type field, so I inferred streamable-http from its url. Please confirm that is the intended transport rather than the deprecated sse.

Validation run locally: npm run plugin:validate and npm run build pass, a materialize/clean round trip is clean, and node --test eng/validate-plugins.test.mjs eng/materialize-plugins.test.mjs passes with 5 new tests covering the mcp.json rules. Docs updated in AGENTS.md, both plugin READMEs, the validate-plugins workflow message, and the create-canvas-extension skill.


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

…gin root

MCP config was declared via an extensions.com.github.awesome-copilot.mcpServers
pointer to a .mcp.json file. That namespace is stripped from the served manifest,
so nothing carried the MCP declaration through materialization.

Per Agent Plugins v1.0.0 the fixed location is mcp.json at the plugin root, which
already ships as-is. Drop the pointer, rename both .mcp.json files, and validate
mcp.json (schema, closed top-level fields, server transport variants).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 19, 2026 05:40
@github-actions github-actions Bot added plugin PR touches plugins workflow PR touches workflow automation labels Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 12 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 0
ℹ️ Info 0

✅ No matching risk patterns were detected in changed files.

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🟡 Contributor Reputation Check: MEDIUM risk

Check Risk
Profile MEDIUM
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk label Aug 19, 2026

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.

Pull request overview

Moves MCP server configuration to spec-compliant root-level mcp.json files and updates discovery, validation, and documentation.

Changes:

  • Migrates two MCP configurations to the Agent Plugins schema.
  • Updates website discovery and plugin validation.
  • Aligns contributor guidance and CI messaging.
Show a summary per file
File Description
plugins/context-matic/README.md Updates MCP configuration path.
plugins/context-matic/mcp.json Adds schema and transport type.
plugins/awesome-copilot/README.md Updates MCP configuration link.
plugins/awesome-copilot/plugin.json Removes legacy MCP pointer.
plugins/awesome-copilot/mcp.json Adds the MCP schema declaration.
eng/validate-plugins.test.mjs Adds MCP validation tests.
eng/validate-plugins.mjs Adds root MCP configuration validation.
eng/generate-website-data.mjs Discovers MCP servers from mcp.json.
AGENTS.md Documents the new MCP convention.
.github/workflows/validate-plugins.yml Updates CI guidance.
.github/skills/create-canvas-extension/SKILL.md Updates plugin-generation guidance.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread eng/validate-plugins.mjs
Comment thread eng/validate-plugins.mjs Outdated
Replace the hand-rolled MCP checks with Ajv validation against the
canonical Agent Plugins v1.0.0 MCP schema, so non-spec configs (empty
command/url, non-string args, reserved PLUGIN_ROOT/PLUGIN_DATA env keys,
invalid cwd, unknown server fields) are rejected. Per-server errors are
re-derived from the matching discriminated branch to avoid unhelpful
oneOf output.

Also reject a top-level extensions.mcpServers placement, which slipped
through because the manifest schema allows arbitrary object-valued
extension keys.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 764c5bb4-2811-4dc1-b61d-56c4a5597cc9
Copilot AI review requested due to automatic review settings August 19, 2026 05:55

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.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

eng/validate-plugins.mjs:232

  • A valid JSON value of null makes this dereference throw before the top-level-object check, terminating the entire plugin validation instead of returning the intended mcp.json must contain a top-level object error. Guard the parse-error sentinel before reading it.
  if (parsed.parseError) {
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread eng/validate-plugins.mjs
Comment on lines +263 to +265
if (composition?.mcpServers !== undefined) {
errors.push(`extensions["${AWESOME_COPILOT_NAMESPACE}"].mcpServers is not supported; declare MCP servers in mcp.json at the plugin root`);
}
Comment on lines +113 to +115
export function validateAgentPluginMcpConfig(config) {
if (validateMcp(config)) {
return [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk plugin PR touches plugins workflow PR touches workflow automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants