Skip to content

.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found - #3856

Merged
Roger Barreto (rogerbarreto) merged 3 commits into
microsoft:mainfrom
rogerbarreto:issues/3195-hosted-mcp-fix
Feb 19, 2026
Merged

.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found#3856
Roger Barreto (rogerbarreto) merged 3 commits into
microsoft:mainfrom
rogerbarreto:issues/3195-hosted-mcp-fix

Conversation

@rogerbarreto

Copy link
Copy Markdown
Member

CopilotAI review requested due to automatic review settings February 11, 2026 16:56
@markwallace-microsoftMark Wallace (markwallace-microsoft) added the .NET Usage: [Issues, PRs], Target: .Net label Feb 11, 2026
@rogerbarretoRoger Barreto (rogerbarreto) changed the title Update packages.Net: Fix 404 Error - Update packages to latest versionFeb 11, 2026
@github-actionsgithub-actionsBot changed the title .Net: Fix 404 Error - Update packages to latest version.NET: Update packagesFeb 11, 2026
@rogerbarretoRoger Barreto (rogerbarreto) changed the title .NET: Update packages.NET: Fixes AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not foundFeb 11, 2026

CopilotAI 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

Updates the AgentWithHostedMCP .NET sample to align with newer Azure AI Agent Server / Azure OpenAI packages and the current Microsoft.Extensions.AI.OpenAI integration approach, addressing the reported hosted MCP chat failure.

Changes:

  • Bumps Azure.AI.AgentServer.AgentFramework and Azure.AI.OpenAI package versions.
  • Moves the sample to Microsoft.Extensions.AI.OpenAI10.3.0 and adjusts the agent creation pipeline to convert the Responses client into an IChatClient.
  • Improves the sample HTTP request file formatting by adding the standard blank line between headers and JSON bodies.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
dotnet/samples/HostedAgents/AgentWithHostedMCP/run-requests.httpAdds blank lines between headers and bodies to ensure HTTP client tooling parses requests correctly.
dotnet/samples/HostedAgents/AgentWithHostedMCP/Program.csUpdates the Responses client flow to AsIChatClient() before creating the agent; removes an unused/now-unneeded using.
dotnet/samples/HostedAgents/AgentWithHostedMCP/AgentWithHostedMCP.csprojUpdates package versions and removes now-unneeded OpenAI-specific Agent Framework package reference in favor of Microsoft.Extensions.AI.OpenAI 10.3.0.

Comment threaddotnet/samples/HostedAgents/AgentWithHostedMCP/Program.cs
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Feb 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NETUsage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Python: .NET: AgentWithHostedMCP chat fails: ErrorHTTP 404 (: 404) Resource not found

6 participants

@rogerbarreto@SergeyMenshykh@peibekwe@westey-m@markwallace-microsoft