Skip to content

.NET: Integrate MCP-listed skill discovery - #9217

Merged
SergeyMenshykh merged 3 commits into
feature-mcp-skills-nextfrom
sergeymenshykh-apply-latest-stash
Oct 12, 2026
Merged

SergeyMenshykh merged 3 commits into
feature-mcp-skills-nextfrom
sergeymenshykh-apply-latest-stash

Conversation

@SergeyMenshykh

@SergeyMenshykh SergeyMenshykh commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation & Context

Enable skills/list discovery for MCP servers advertising the Skills extension, while preserving legacy discovery for older servers.

Description & Review Guide

  • What are the major changes? Add capability-based discovery, validate skill metadata and resource manifests, and update the sample, docs, and tests.
  • What is the impact of these changes? No public API changes. Listed skills load content lazily and restrict resource reads to their manifests. Supports one complete result with static resource lists, not the full extension. Legacy index/archive discovery is unchanged.
  • What do you want reviewers to focus on? Discovery selection, validation, and backward compatibility.

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

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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

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.

🟡 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/list discovery 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.

@github-actions github-actions Bot 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.

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

@github-code-quality

github-code-quality Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit cb17cdc in the sergeymenshykh-apply... branch remains at 85%, unchanged from commit fd52de7 in the feature-mcp-skills-n... branch.

Show a line coverage summary of the most impacted files.
File feature-mcp-skills-n... fd52de7 sergeymenshykh-apply... cb17cdc +/-
/home/runner/wo...ewChatClient.cs 67% 0% -67%
/home/runner/wo...toryProvider.cs 95% 31% -64%
/home/runner/wo...SessionStore.cs 100% 53% -47%
/home/runner/wo...moryProvider.cs 84% 74% -10%
/home/runner/wo...tateBagValue.cs 93% 89% -4%
/home/runner/wo...CopilotAgent.cs 72% 76% +4%
/home/runner/wo...SkillsSource.cs 69% 100% +31%
/home/runner/wo...pListedSkill.cs 0% 95% +95%
/home/runner/wo...SkillsLoader.cs 0% 100% +100%
/home/runner/wo...killResource.cs 0% 100% +100%

Updated October 12, 2026 09:30 UTC

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

This branch was previously deployed

2 inactive deployments
github-app-auth — cb17cdc6 Deployed Oct 12, 2026 by SergeyMenshykh via add_label #24973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants