Skip to content

Conversation

jozkee
Copy link
Member

@jozkee jozkee commented Jul 30, 2025

Contributes to #6492; addresses 1. and 2.

Microsoft Reviewers: Open in CodeFlow

@jozkee jozkee requested a review from a team as a code owner July 30, 2025 03:05
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Jul 30, 2025
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 abstraction for remote MCP (Model Context Protocol) servers, providing types to represent hosted MCP server tools and their associated content types. The changes introduce new classes for configuring and interacting with remote MCP servers through AI services.

  • Introduces HostedMcpServerTool class for representing remote MCP server configurations
  • Adds content types for MCP tool calls and results (HostedMcpServerToolCallContent, HostedMcpServerToolResultContent)
  • Implements approval mode configuration for MCP server tool calls

Reviewed Changes

Copilot reviewed 9 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Libraries/Microsoft.Extensions.AI.Abstractions/Tools/HostedMcpServerTool.cs Main abstraction class for configuring hosted MCP servers with URL, approval modes, and headers
src/Libraries/Microsoft.Extensions.AI.Abstractions/HostedMcpServerToolApprovalMode.cs Approval mode configuration class with Always/Never predefined modes and custom tool-specific rules
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/HostedMcpServerToolCallContent.cs Content type representing MCP tool call requests with call ID, tool name, and arguments
src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/HostedMcpServerToolResultContent.cs Content type representing MCP tool call results with output and error information
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Tools/HostedMcpServerToolTests.cs Unit tests for HostedMcpServerTool functionality
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/HostedMcpServerToolApprovalModeTests.cs Unit tests for approval mode configuration
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/HostedMcpServerToolCallContentTests.cs Unit tests for tool call content type
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/HostedMcpServerToolResultContentTests.cs Unit tests for tool result content type
test/Libraries/Microsoft.Extensions.AI.OpenAI.Tests/OpenAIResponseClientIntegrationTests.cs Integration tests demonstrating MCP server usage with OpenAI client

@jozkee jozkee marked this pull request as draft August 4, 2025 03:45
@jozkee jozkee marked this pull request as ready for review August 16, 2025 04:47
@jozkee jozkee requested a review from rogerbarreto August 18, 2025 15:24
@jozkee
Copy link
Member Author

jozkee commented Aug 19, 2025

This should be ready for another round.

@jozkee jozkee requested a review from stephentoub September 4, 2025 23:32
@stephentoub stephentoub force-pushed the mcp_tool branch 2 times, most recently from 6ea1e5c to ca83310 Compare September 8, 2025 03:38
@jozkee jozkee merged commit a4db9d8 into dotnet:main Sep 8, 2025
6 checks passed
@jozkee
Copy link
Member Author

jozkee commented Sep 8, 2025

Thanks, @stephentoub.

@jozkee jozkee deleted the mcp_tool branch September 9, 2025 14:52
joperezr pushed a commit that referenced this pull request Sep 9, 2025
* Simpfliy Responses streaming handling

* Add abstraction for remote MCP servers

* Update MCP support to accomodate responses and approvals

---------

Co-authored-by: Stephen Toub <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants