Skip to content

Commit 8191724

Browse files
committed
merge conflict fix
2 parents 08a379a + 9f7ad2f commit 8191724

File tree

659 files changed

+4105
-2219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

659 files changed

+4105
-2219
lines changed

articles/ai-foundry/agents/faq.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
manager: nitinme
88
ms.service: azure-ai-agent-service
99
ms.topic: faq
10-
ms.date: 01/15/2025
10+
ms.date: 06/30/2025
1111
ms.author: aahi
1212
author: aahill
1313
title: Azure AI Foundry Agent Service frequently asked questions

articles/ai-foundry/agents/how-to/tools/azure-ai-search-samples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 04/11/2025
9+
ms.date: 06/30/2025
1010
author: aahill
1111
ms.author: aahi
1212
ms.custom: azure-ai-agents

articles/ai-foundry/agents/how-to/tools/azure-ai-search.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: azure-ai-agent-service
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 04/11/2025
9+
ms.date: 06/30/2025
1010
author: aahill
1111
ms.author: aahi
1212
ms.custom: azure-ai-agents

articles/ai-foundry/agents/how-to/tools/code-interpreter-samples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Find code samples to enable code interpreter for Azure AI Agents.
55
author: aahill
66
ms.author: aahi
77
manager: nitinme
8-
ms.date: 04/09/2025
8+
ms.date: 06/30/2025
99
ms.service: azure-ai-agent-service
1010
ms.topic: how-to
1111
ms.custom:

articles/ai-foundry/agents/how-to/tools/code-interpreter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 12/11/2024
9+
ms.date: 06/30/2025
1010
author: aahill
1111
ms.author: aahi
1212
ms.custom: azure-ai-agents

articles/ai-foundry/agents/how-to/tools/function-calling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 01/30/2025
9+
ms.date: 06/30/2025
1010
author: aahill
1111
ms.author: aahi
1212
zone_pivot_groups: selection-function-calling
@@ -18,7 +18,7 @@ ms.custom: azure-ai-agents
1818
Azure AI Agents supports function calling, which allows you to describe the structure of functions to an agent and then return the functions that need to be called along with their arguments.
1919

2020
> [!NOTE]
21-
> Runs expire ten minutes after creation. Be sure to submit your tool outputs before the expiration.
21+
> Runs expire 10 minutes after creation. Be sure to submit your tool outputs before the expiration.
2222
2323
### Usage support
2424

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: 'MCP tool code samples'
3+
titleSuffix: Azure AI Foundry
4+
description: Find code samples to connect Foundry Agent service with MCP.
5+
services: cognitive-services
6+
manager: nitinme
7+
ms.service: azure-ai-agent-service
8+
ms.topic: how-to
9+
ms.date: 06/26/2025
10+
author: aahill
11+
ms.author: aahi
12+
zone_pivot_groups: selection-mcp-code
13+
ms.custom: azure-ai-agents-code
14+
---
15+
16+
# How to use the Model Context Protocol (MCP) tool
17+
18+
Use this article to find step-by-step instructions and code samples for connecting Foundry Agent service with MCP.
19+
20+
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api#api-call-information) to set the right values for the environment variables `AGENT_TOKEN`, `AZURE_AI_FOUNDRY_PROJECT_ENDPOINT` and `API_VERSION`.
21+
22+
23+
## Create an Agent with the MCP tool enabled
24+
25+
To make the MCP tool available to your agent, initialize a tool with the server endpoint, server label and more
26+
```bash
27+
curl --request POST \
28+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=$API_VERSION \
29+
-H "Authorization: Bearer $AGENT_TOKEN" \
30+
-H "Content-Type: application/json" \
31+
-d "{
32+
"instructions": "You are a customer support chatbot. Use the tools provided and your knowledge base to best respond to customer queries.",
33+
"tools": [
34+
{
35+
"type": "mcp",
36+
"server_label": "<unique name for your MCP server>",
37+
"server_url": "<your MCP server url>",
38+
"require_approval": "never",
39+
}
40+
],
41+
"name": "my-assistant",
42+
"model": "gpt-4o",
43+
}"
44+
```
45+
46+
## Create a thread
47+
48+
```bash
49+
curl --request POST \
50+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=$API_VERSION \
51+
-H "Authorization: Bearer $AGENT_TOKEN" \
52+
-H "Content-Type: application/json" \
53+
-d ''
54+
```
55+
56+
## Add a user question to the thread
57+
58+
```bash
59+
curl --request POST \
60+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
61+
-H "Authorization: Bearer $AGENT_TOKEN" \
62+
-H "Content-Type: application/json" \
63+
-d '{
64+
"role": "user",
65+
"content": "<user input related to the MCP server you connect>"
66+
}'
67+
```
68+
69+
## Create a run and check the output
70+
71+
Create a run to pass headers for the tool and observe that the model uses the Grounding with Bing Search tool to provide a response to the user's question.
72+
73+
```bash
74+
curl --request POST \
75+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=$API_VERSION \
76+
-H "Authorization: Bearer $AGENT_TOKEN" \
77+
-H "Content-Type: application/json" \
78+
-d '{
79+
"assistant_id": "<agent_id>",
80+
"tool_resources": {
81+
"mcp": [
82+
{
83+
"server_label": "<the same unique name you provided during agent creation>",
84+
"headers": {
85+
"Authorization": "Bearer <token>",
86+
}
87+
}
88+
]
89+
},
90+
}'
91+
```
92+
## Retrieve the status of the run
93+
94+
```bash
95+
curl --request GET \
96+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=$API_VERSION \
97+
-H "Authorization: Bearer $AGENT_TOKEN"
98+
```
99+
100+
## Retrieve the agent response
101+
102+
```bash
103+
curl --request GET \
104+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
105+
-H "Authorization: Bearer $AGENT_TOKEN"
106+
```
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: 'How to connect to Model Context Protocol Server Endpoint in Azure AI Foundry Agent Service'
3+
titleSuffix: Azure AI Foundry
4+
description: Learn how to add MCP to Foundry Agent service.
5+
services: cognitive-services
6+
manager: nitinme
7+
ms.service: azure-ai-agent-service
8+
ms.topic: how-to
9+
ms.date: 06/17/2025
10+
author: aahill
11+
ms.author: aahi
12+
ms.custom: references_regions
13+
---
14+
# Connect to Model Context Protocol (MCP) Servers (Preview)
15+
You can extend the capabilities of your Foundry Agent by connecting it to tools hosted on remote Model Context Protocol (MCP) servers (bring your own MCP server endpoint). These servers are maintained by developers and organizations and expose tools that can be accessed by MCP-compatible clients, such as the Foundry Agent service.
16+
17+
[Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) is an open standard that defines how applications provide tools and contextual data to large language models (LLMs). It enables consistent, scalable integration of external tools into model workflows.
18+
19+
> [!IMPORTANT]
20+
> * Your use of connected non-Microsoft services is subject to the terms between you and the service provider. By connecting to a non-Microsoft service, some of your data, such as prompt content, is passed to the non-Microsoft service, and/or your application might receive data from the non-Microsoft service. You are responsible for your use (and any charges associated with your use) of non-Microsoft services and data.
21+
> * The remote MCP servers you decide to use with this MCP tool were created by third parties, not Microsoft, and have not been tested or verified by Microsoft. Microsoft has no responsibility to you or others in relation to your use of any remote MCP servers. We recommend carefully reviewing and tracking what MCP servers you add to Foundry Agent service and relying on servers hosted by trusted service providers themselves rather than proxies. This MCP tool also allows you to pass custom headers such as authentication keys or schema as might be needed by a remote MCP server. We recommend reviewing all data being shared with remote MCP servers and optionally logging it for auditing purposes. Be cognizant of non-Microsoft practices for retention and location of data.
22+
23+
## How it works
24+
You can bring multiple remote MCP servers to Foundry Agent service by adding them as tools. For each tool, you need to provide a unique `server_label` within the same agent and `server_url` that points to the remote MCP server. The MCP tool supports custom headers, allowing you to connect to these servers using the authentication scheme they require or passing other headers required by the MCP server. You can only specify headers by including in `tool_resources` at each run such as API keys, OAuth access tokens, or other credentials directly in your request. The most commonly used header is the authorization header. For more information on using MCP, see:
25+
* [Security best practices](https://modelcontextprotocol.io/specification/draft/basic/security_best_practices)
26+
* [Understanding and mitigating security risks in MCP implementations](https://techcommunity.microsoft.com/blog/microsoft-security-blog/understanding-and-mitigating-security-risks-in-mcp-implementations/4404667)
27+
28+
> [!Note]
29+
> * You need to bring a remote MCP server (an existing MCP server endpoint)
30+
> * With current MCP tool in Foundry Agent, explicit approval is not supported (only `never` is accepted for `require_approval` parameter). Please review carefully what MCP server(s) you added to Foundry Agent service. We recommend reviewing all data being shared with remote MCP servers and optionally logging it for auditing purposes.
31+
> * Supported regions: `westus`, `westus2`, `uaenorth`, `southindia` and `switzerlandnorth`
32+
> * The MCP tool supports custom headers for a specific run, allowing you to pass headers as needed by MCP server, such as authentication schema. Headers you pass in will only be available for the current run and will not be persisted.
33+
34+
## Usage support
35+
36+
|Azure AI foundry support | Python SDK | C# SDK | JavaScript SDK | REST API |Basic agent setup | Standard agent setup |
37+
|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|---------:|
38+
| - | - | - | - | ✔️ | ✔️ | ✔️ |
39+
40+
## Setup
41+
1. Create an Azure AI Foundry Agent by following the steps in the [quickstart](../../quickstart.md).
42+
43+
1. Find the remote MCP server you want to connect to, such as GitHub MCP Server. Create or update a Foundry Agent with a `mcp` tool with the following information:
44+
1. `server_url`: the url of the MCP server, for example, `https://api.githubcopilot.com/mcp/`
45+
2. `server_label`: a unique identifier of this MCP server to the agent, for example, `github`
46+
3. `require_approval`: only `never` is supported right now
47+
48+
1. Create a run and pass additional information about the `mcp` tool in `tool_resources` with headers
49+
1. `tool_label`: use the identifier you provided during create/update agent
50+
2. `headers`: pass a set of headers required by the MCP server
51+
52+
## Next steps
53+
54+
* [How to use the MCP tool](./model-context-protocol-samples.md)

articles/ai-foundry/agents/how-to/tools/openapi-spec.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 03/12/2025
9+
ms.date: 06/30/2025
1010
author: aahill
1111
ms.author: aahi
1212
ms.custom: azure-ai-agents
@@ -67,7 +67,7 @@ With API key authentication, you can authenticate your OpenAPI spec using variou
6767

6868
1. Create a `custom keys` connection to store your API key.
6969

70-
1. Go to the [Azure AI Foundry portal](https://ai.azure.com/?cid=learnDocs) and select the AI Project. Click **connected resources**.
70+
1. Go to the [Azure AI Foundry portal](https://ai.azure.com/?cid=learnDocs) and select the AI Project. Select **connected resources**.
7171
:::image type="content" source="../../media\tools\bing\project-settings-button.png" alt-text="A screenshot of the settings button for an AI project." lightbox="../../media\tools\bing\project-settings-button.png":::
7272

7373
1. Select **+ new connection** in the settings page.
@@ -124,4 +124,4 @@ To set up authenticating with Managed Identity:
124124

125125
1. Click **Finish**.
126126

127-
1. Once the setup is done, you can continue by using the tool through the Foundry Portal, SDK, or REST API. Use the tabs at the top of this article to see code samples.
127+
1. Once the setup is done, you can continue by using the tool through the Azure AI Foundry portal, SDK, or REST API. Use the tabs at the top of this article to see code samples.

articles/ai-foundry/agents/how-to/tools/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ To streamline workflows with your AI agent with capabilities to take actions. Th
3232

3333
- **Azure Logic Apps**: Low-code / no-code solution to add a workflow to your AI Agent
3434
- **OpenAPI Spec tool**: Bring an existing OpenAPI specification of a service API you want to add to your AI agent, with no or minor changes.
35+
- **MCP tool**: Bring an existing Model Context Protocol (MCP) endpoint that you want to add to your AI agent.
3536
- **Function calling**: Write your own custom, stateless functions to define the expected behaviors.
3637
- **Azure Functions**: Write and manage your own custom, stateful functions.
3738

@@ -75,6 +76,7 @@ The Foundry Agent Service provides the following built-in tools. You can use the
7576
|[Function calling](function-calling.md) |Describe the structure of functions you create to an agent and have them be called when appropriate during the agent's interactions with users. |
7677
|[Grounding with Bing Search](bing-grounding.md) | Enable your agent to use Grounding with Bing Search to access and return information from the internet. |
7778
| [Grounding with Bing Custom Search (preview)](bing-custom-search.md) | Enhance your Agent response with selected web domains |
79+
| [Model Context Protocol (preview)](./model-context-protocol.md) | Give the agent access to tools hosted on an existing MCP endpoint |
7880
| [Microsoft Fabric (preview)](fabric.md) | Integrate your agent with the [Microsoft Fabric data agent](https://go.microsoft.com/fwlink/?linkid=2312815) to unlock powerful data analysis capabilities. |
7981
| [OpenAPI 3.0 Specified tool ](openapi-spec.md) | Connect your Azure AI Agent to external APIs using functions with an OpenAPI 3.0 specification. |
8082

0 commit comments

Comments
 (0)