Announcement of Model Context Protocol Support in Azure AI Foundry Agent Service (Preview)
I finally took notice of the news that the AI Foundry Agent Service has become an MCP client.
`
Generative AI agents have value only when they can 'take action'
Querying systems of record, triggering workflows, and searching for specialized knowledge—to do these things, one previously had to manually prepare Azure Functions, manage OpenAPI specifications, or write custom plugins for each backend.
The economics that MCP changes
Model Context Protocol (MCP) is an open, JSON-RPC-based protocol originally proposed by Anthropic.
Once a 'server' exposes tools (functions) or resources (context), they can be automatically discovered and called by any compliant 'client' (agent execution environment).
In short, it is like the USB-C of AI integration.
Foundry Agent Service becomes an MCP client
With today's preview, Foundry Agent Service now officially supports being an MCP client.
Whether self-hosted or SaaS, if you bring any remote MCP server, Azure AI Foundry will import its capabilities in seconds, maintain updates, and route calls through an enterprise-grade envelope.
What is the Model Context Protocol (MCP)?
MCP is an open standard that allows developers, organizations, and service providers to host services and APIs on an
MCP server and easily expose and connect them to MCP-compatible clients (such as Foundry Agent Service).
Foundry Agent Service supporting MCP offers the following benefits:
Easily integrate services and APIs
Connect to Foundry Agent Service without custom functions, whether for internal services or external provider APIs.Enhance enterprise capabilities
Grant agents enterprise features such as Foundry Agent Service's 'Bring Your Own thread storage'.
Code sample
The following sample shows the flow from adding an MCP server as a tool in Azure AI Foundry to creating a thread and retrieving execution results.
However, please note the following, as I also got stuck on this
I recommend verifying this by deploying a new instance using supported setups like the Basic Agent setup, rather than using something you built yourself.

Step 1: Import the necessary packages
import time
import json
from azure.ai.agents.models import MessageTextContent, ListSortOrder
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredentialStep 2: Create an AI Project Client and generate an Azure AI Foundry agent

project_client = AIProjectClient(
endpoint=PROJECT_ENDPOINT,
credential=DefaultAzureCredential()
)
with project_client:
agent = project_client.agents.create_agent(
model=MODEL_DEPLOYMENT_NAME,
name="my-mcp-agent",
instructions="You are a helpful assistant. Use the tools provided to answer the user's questions. Be sure to cite your sources.",
tools=[
{
"type": "mcp",
"server_label": <name of your choice for the mcp server>,
"server_url": <url of the remote MCP server>,
"require_approval": "never"
}
],
tool_resources=None
)
print(f"Created agent, agent ID: {agent.id}")
Step 3: Create a thread, message, and run
You can map to a specific MCP server by specifying the server_label.
thread = project_client.agents.threads.create()
print(f"Created thread, thread ID: {thread.id}")
message = project_client.agents.messages.create(
thread_id=thread.id,
role="user",
content="<a question for your MCP server>",
)
print(f"Created message, message ID: {message.id}")
run = project_client.agents.runs.create(
thread_id=thread.id,
agent_id=agent.id
)
Step 4: Run the run and retrieve the message
# ステータスが queued または in_progress の間ポーリング
while run.status in ["queued", "in_progress", "requires_action"]:
time.sleep(1)
run = project_client.agents.runs.get(
thread_id=thread.id,
run_id=run.id
)
print(f"Run status: {run.status}")
if run.status == "failed":
print(f"Run error: {run.last_error}")
run_steps = project_client.agents.run_steps.list(
thread_id=thread.id,
run_id=run.id
)
for step in run_steps:
print(f"Run step: {step.id}, status: {step.status}, type: {step.type}")
if step.type == "tool_calls":
print("Tool call details:")
for tool_call in step.step_details.tool_calls:
print(json.dumps(tool_call.as_dict(), indent=2))
messages = project_client.agents.messages.list(
thread_id=thread.id,
order=ListSortOrder.ASCENDING
)
for data_point in messages:
last_message_content = data_point.content[-1]
if isinstance(last_message_content, MessageTextContent):
print(f"{data_point.role}: {last_message_content.text.value}")
Step 5: Cleanup
project_client.agents.delete_agent(agent.id)
print(f"Deleted agent, agent ID: {agent.id}")On the AI Foundry Portal side
Once created, it can also be used in the Agent Playground!

Thread logs

Within MCP

Important Considerations
When connecting to non-Microsoft services, the terms of use are governed by the agreement between the user and the service provider.
Connecting to non-Microsoft services may result in some data (such as prompt content) being sent to that service or returned to the app from that service. Usage fees, etc., are the user's responsibility.
The remote MCP server connected via this MCP tool is built by a third party and has not been tested or verified by Microsoft. Microsoft assumes no responsibility for the use of these servers.
We recommend using servers hosted by trusted service providers themselves and avoiding the use of proxies.
You can pass custom headers such as authentication keys or schemas. Please scrutinize shared data and obtain audit logs as necessary.
Please also be mindful of non-Microsoft data retention and storage policies.
Notes
Please have an existing MCP server endpoint ready.
The current MCP tool only supports require_approval as 'never'. Please thoroughly vet the MCP servers you add.
Supported regions: westus, westus2, uaenorth, southindia, switzerlandnorth
Custom headers for MCP tools are only valid for the current run and are not saved.
Announcement at Microsoft Build 2025
At Build 2025, Satya Nadella emphasized an "open-by-design" AI ecosystem and announced a partnership with Anthropic to standardize the
Model Context Protocol (MCP) across Windows 11, GitHub, Copilot Studio, and Azure AI Foundry.
This MCP preview support in the Foundry Agent Service is the next step in that journey.
You can "connect once, integrate anywhere" any MCP server to a cloud-hosted agent, requiring no custom code at all.
Get started with Azure AI Foundry today
Start using Azure AI Foundry
See the documentation for feature details
