Repository navigation
.NET: Integrate MCP-listed skill discovery - #9217
Conversation
Use skills/list when the MCP server advertises the Skills extension, validate listed frontmatter and resource manifests, and retain index-based discovery for older servers. Update the sample and cover discovery selection, content access, and compatibility behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ee12ecd8-5dd7-4960-98af-5b2161bb33b5
There was a problem hiding this comment.
🟡 Changes recommended
Required manifest integrity verification, pagination, identity handling, and specification-compliant sample fields are missing.
2 open findings
What changed in this PR
Adds capability-based MCP skill discovery while retaining legacy index fallback.
Changes:
- Adds
skills/listdiscovery and validation. - Adds comprehensive discovery/resource tests.
- Updates the MCP sample and documentation.
| File | Description |
|---|---|
AgentMcpListedSkillsTests.cs |
Tests listed-skill behavior. |
InMemoryMcpServer.cs |
Supports server option configuration. |
AgentMcpSkillsSourceTests.cs |
Tests legacy resource compatibility. |
AgentMcpSkillsDiscoverySelectionTests.cs |
Tests capability-based selection. |
McpListedSkillsLoader.cs |
Implements skills/list discovery. |
AgentSkillsProviderBuilderMcpExtensions.cs |
Documents discovery behavior. |
AgentMcpSkillsSource.cs |
Selects listed or legacy discovery. |
AgentSkills/README.md |
Updates sample summary. |
Agent_Step06_McpBasedSkills/README.md |
Documents the updated sample. |
Agent_Step06_McpBasedSkills/Program.cs |
Implements a listed-skills server sample. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 573235293d8e
Model: gpt-5.6-sol
Overview
The change cleanly selects skills/list from the exact advertised capability, validates metadata and resource manifests, confines reads to the held manifest, and preserves the legacy path when the extension is absent. The added tests cover selection, malformed responses, URI confinement, cancellation, origin binding, and lazy reads. Residual risk remains because a server-controlled complete manifest has no retention limits, and the new early return bypasses the archive directory cleanup contract.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (1 high, 1 medium) across 2 files. Details are attached to the affected lines below.
Affected areas: dotnet/src/Microsoft.Agents.AI.Mcp/Skills/AgentMcpSkillsSource.cs, dotnet/src/Microsoft.Agents.AI.Mcp/Skills/Listed/McpListedSkillsLoader.cs
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall line coverage in commit cb17cdc in the Show a line coverage summary of the most impacted files.
Updated |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ee12ecd8-5dd7-4960-98af-5b2161bb33b5
Preserve JsonException for deserialization failures, document loader exceptions, and update validation tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ee12ecd8-5dd7-4960-98af-5b2161bb33b5

Motivation & Context
Enable
skills/listdiscovery for MCP servers advertising the Skills extension, while preserving legacy discovery for older servers.Description & Review Guide
Validated: 432 MCP unit tests, sample build, formatting, and sample MCP discovery/resource reads. The broader .NET suite was not run.
Related Issue
Related to #8772; follows #9198.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.