Skip to content

Conversation

markwallace-microsoft
Copy link
Member

Motivation and Context

Description

Contribution Checklist

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new .NET sample demonstrating how to authenticate via OAuth 2.0 to access a protected Model Context Protocol (MCP) server and invoke its tools through Semantic Kernel.

  • Introduces a browser-based authorization code flow and SSE transport for MCP.
  • Includes detailed README for prerequisites, configuration, and running steps.
  • Registers the new sample in the solution and configures its project dependencies.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dotnet/samples/Demos/ModelContextProtocolPluginAuth/README.md Added comprehensive setup, OAuth flow explanation, and usage guide.
dotnet/samples/Demos/ModelContextProtocolPluginAuth/Program.cs Implemented OAuth 2.0 authorization code flow and MCP tool invocation.
dotnet/samples/Demos/ModelContextProtocolPluginAuth/ModelContextProtocolPluginAuth.csproj Configured project target framework and package references.
dotnet/SK-dotnet.slnx Added the new sample project to the solution.
Comments suppressed due to low confidence (3)

dotnet/samples/Demos/ModelContextProtocolPluginAuth/README.md:39

  • This line appears to be stray or incomplete; remove it or replace with the intended content.
 "..."

dotnet/samples/Demos/ModelContextProtocolPluginAuth/README.md:20

  • The project targets .NET 8.0 in the csproj but README lists .NET 9.0; update one of them to ensure consistency.
- .NET 9.0 or later

dotnet/samples/Demos/ModelContextProtocolPluginAuth/Program.cs:47

  • [nitpick] Casing inconsistency: consider using 'ProtectedMCPClient' to match the 'MCP' acronym and other sample naming conventions.
        ClientName = "ProtectedMcpClient",

@moonbox3 moonbox3 added .NET Issue or Pull requests regarding .NET code documentation labels Jul 9, 2025
@github-actions github-actions bot changed the title Sample using OAuth to access a protected MCP server .Net: Sample using OAuth to access a protected MCP server Jul 9, 2025
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Jul 9, 2025
Merged via the queue into microsoft:main with commit 5162de1 Jul 9, 2025
19 checks passed
@markwallace-microsoft markwallace-microsoft deleted the users/markwallace/mcp_auth_sample branch July 9, 2025 13:02
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
…12680)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants