Forum Discussion

aayush7g's avatar
aayush7g
Copper Contributor
Jun 09, 2026

Unable to Connect Localhost MCP Server from Azure AI Foundry Hosted Agent (o4-mini)

I'm using the Azure AI Foundry Toolkit in VS Code and have configured an MCP server running on my local machine (localhost).

When I run my Azure AI Foundry-hosted agent (o4-mini), it fails to connect to the MCP server. Based on the error logs, it appears that the hosted agent cannot reach the localhost endpoint.

My understanding is that the MCP server is running correctly locally, but the hosted agent seems unable to access services running on my machine.

Has anyone successfully connected a locally hosted MCP server to an Azure AI Foundry-hosted agent while using the Foundry Toolkit in VS Code?

No RepliesBe the first to reply