You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-foundry/how-to/develop/vs-code-agents-mcp.md
+25-23Lines changed: 25 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Work with Azure AI Foundry Agent Service and MCP Server tools in Visual Studio Code
2
+
title: Work with Azure AI Foundry Agent Service and MCP Server Tools in Visual Studio Code
3
3
titleSuffix: Azure AI Foundry
4
4
description: Use this article to learn how to use MCP server tools with Azure AI Foundry Agent Service directly in VS Code.
5
5
manager: mcleans
@@ -16,7 +16,7 @@ author: ms-johnalex
16
16
17
17
# Work with Azure AI Foundry Agent Service and MCP server tools in Visual Studio Code (preview)
18
18
19
-
In this article, you learn how to add and use the [Model Context Protocol (MCP)](/azure/ai-foundry/agents/how-to/tools/model-context-protocol)tool with Azure AI agents by using the [Azure AI Foundry for Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.vscode-ai-foundry).
19
+
In this article, you learn how to add and use [Model Context Protocol (MCP)](/azure/ai-foundry/agents/how-to/tools/model-context-protocol)tools with Azure AI agents by using the [Azure AI Foundry for Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.vscode-ai-foundry).
20
20
21
21
After you [build an agent in Azure AI Foundry Agent Service](./vs-code-agents.md) by using this Visual Studio Code (VS Code) extension, you can add MCP tools to your agent.
22
22
@@ -39,7 +39,7 @@ To create an Azure AI agent, follow the steps in [Create and edit Azure AI agent
39
39
40
40
After you create your agent, you can add tools to it, including MCP tools. For more information about available tools, see [Tools for Azure AI agents](/azure/ai-foundry/agents/how-to/tools/overview).
41
41
42
-
You can bring multiple remote MCP servers by adding them as tools. For each tool, you need to provide a unique `Server Label` value within the same agent and a `Server URL` value that points to the remote MCP server.
42
+
You can bring multiple remote MCP servers by adding them as tools. For each tool, you need to provide a unique **Server Label** value within the same agent and a **Server URL** value that points to the remote MCP server.
43
43
44
44
> [!WARNING]
45
45
> The remote MCP servers that you use with the MCP tool in this article are not from Microsoft. Microsoft doesn't test or verify these servers. For details, see [Considerations for using non-Microsoft services and servers](/azure/ai-foundry/agents/how-to/tools/model-context-protocol?branch=pr-en-us-6966#considerations-for-using-non-microsoft-services-and-servers).
@@ -48,7 +48,7 @@ To add an existing MCP server tool to your AI agent, follow these steps:
48
48
49
49
1. In the designer, in the upper-right corner of the **TOOL** section, select the **Add tool** button. In the dropdown list, select the **MCP Server** tool.
50
50
51
-
1. Find the remote MCP server that you want to connect to, such as the GitHub MCP server. Create or update an Azure AI Foundry agent with an MCP tool by the following information:
51
+
1. Find the remote MCP server that you want to connect to, such as the GitHub MCP server. Create or update an Azure AI Foundry agent with an MCP tool by using the following information:
52
52
53
53
1.**Server URL**: The URL of the MCP server; for example, `https://gitmcp.io/Azure/azure-rest-api-specs`.
54
54
@@ -78,7 +78,7 @@ After you add an MCP tool, you can create an agent directly on Azure AI Foundry
78
78
79
79
Selecting the deployed agent opens the **AGENT PERFERENCES** pane in a view-only mode. You can:
80
80
81
-
- Select the **Edit Agent** button to view the agent designer and YAML definition of the agent for editing.
81
+
- Select the **Edit Agent** button to view the agent designer and the YAML definition of the agent for editing.
82
82
- Select the **Open Code File** button to create a sample code file that uses the agent.
83
83
- Select the **Open Playground** button to open **Agent Playground**.
84
84
@@ -96,24 +96,24 @@ Selecting the deployed agent opens the **AGENT PERFERENCES** pane in a view-only
96
96
97
97
### Interact with agents by using the MCP server tool in the agent playground
98
98
99
-
1. Right-click your deployed agent that has an **MCP Server** tool and select the **Open Playground** option. This action starts a thread with your agent and lets you send messages.
99
+
1. Right-click your deployed agent that has an **MCP Server** tool and then select the **Open Playground** option. This action starts a thread with your agent and lets you send messages.
100
100
101
-
1.After the **Agent Playground** pane appears, enter a prompt such as **Give me an example for creating a container app** and send it.
101
+
1.In the **Agent Playground** pane, enter a prompt such as **Give me an example for creating a container app** and send it.
102
102
103
-
1. Select the authentication mode for the MCP server tool. Choose the appropriate authentication method and proceed.
103
+
1. Select the authentication method for the MCP server tool and proceed.
104
104
105
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-tool-authentication.png" alt-text="Screenshot of the MCP server tool authentication prompt in the Agents Playground." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-tool-authentication.png":::
106
-
1. Select the approval preference for the MCP server tool. Choose the appropriate approval preference and proceed.
105
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-tool-authentication.png" alt-text="Screenshot of the MCP server tool's authentication prompt in the agent playground." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-tool-authentication.png":::
106
+
1. Select the approval preference for the MCP server tool and proceed.
107
107
108
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-tool-approval-preference.png" alt-text="Screenshot of the MCP server tool approval preference in the Agents Playground." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-tool-approval-preference.png":::
108
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-tool-approval-preference.png" alt-text="Screenshot of the MCP server tool's approval preference in the agent playground." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-tool-approval-preference.png":::
109
109
110
110
1. If you chose **Ask every time** for your approval preference, you need to approve or reject the tool call.
111
111
112
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-approve-tool.png" alt-text="Screenshot of the MCP server tool approval prompt in the Agents Playground." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-approve-tool.png":::
112
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-approve-tool.png" alt-text="Screenshot of the MCP server tool's approval prompt in the agent playground." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-approve-tool.png":::
113
113
114
-
1. The agent uses the model and the MCP server tools that you configured in the agent designer to retrieve the information. The source of the information is displayed in the **Agent Annotations** section.
114
+
1. The agent uses the model and the MCP server tools that you configured in the agent designer to retrieve the information. The source of the information appears in the **Agent Annotations** section.
115
115
116
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-tool-response.png" alt-text="Screenshot of the Agents Playground page with agent annotations highlighted in VS Code after using the MCP server tool." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-tool-response.png":::
116
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/mcp-tool-response.png" alt-text="Screenshot of the agent playground with agent annotations highlighted in Visual Studio Code after use of the MCP server tool." lightbox="../../media/how-to/get-started-projects-vs-code/mcp-tool-response.png":::
117
117
118
118
## Clean up resources
119
119
@@ -123,26 +123,28 @@ The Azure resources that you created in this article are billed to your Azure su
Delete the deployed agent in the [online AI Foundry portal](https://ai.azure.com/?cid=learnDocs). Select **Agents** from the navigation menu on the left, select your agent, then select the **Delete** button.
126
+
1. In the [Azure AI Foundry portal](https://ai.azure.com/?cid=learnDocs), on the left menu, select **Agents**.
127
127
128
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/delete-agent.png" alt-text="Screenshot of the AI Foundry portal with Agents from the navigation menu on the left and the Delete button highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/delete-agent.png":::
128
+
1. Select the agent that you want to delete, and then select **Delete**.
129
+
130
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/delete-agent.png" alt-text="Screenshot of the Azure AI Foundry portal with the Delete command for a selected agent." lightbox="../../media/how-to/get-started-projects-vs-code/delete-agent.png":::
129
131
130
132
### Delete your models
131
133
132
134
1. In VS Code, refresh the **Azure Resources** view. Expand the **Models** subsection to display the list of deployed models.
133
135
134
-
1. Right-click your deployed model to delete, and then select the **Delete** option.
135
-
136
-
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/delete-model.png" alt-text="Screenshot of the model context menu with the Delete option highlighted." lightbox="../../media/how-to/get-started-projects-vs-code/delete-model.png":::
136
+
1. Right-click the deployed model that you want to delete, and then select **Delete**.
137
137
138
-
### Delete your tools
138
+
:::image type="content" source="../../media/how-to/get-started-projects-vs-code/delete-model.png" alt-text="Screenshot of the shortcut menu with the Delete command for a selected model." lightbox="../../media/how-to/get-started-projects-vs-code/delete-model.png":::
139
139
140
-
Delete the connected tool with the following steps:
140
+
### Delete your connected tools
141
141
142
142
1. Open the Azure portal.
143
-
1. Select the Azure Resource Group that contains the tool.
143
+
144
+
1. Select the Azure resource group that contains the tool.
145
+
144
146
1. Select the **Delete** button.
145
147
146
148
## Related content
147
149
148
-
- Learn about the tools you can use with Azure AI agents, such as [file search](/azure/ai-services/agents/how-to/tools/file-search?tabs=python&pivots=overview), or [code interpreter](/azure/ai-services/agents/how-to/tools/code-interpreter?tabs=python&pivots=overview).
150
+
- Learn about the tools that you can use with Azure AI agents, such as [file search](/azure/ai-services/agents/how-to/tools/file-search?tabs=python&pivots=overview) or [code interpreter](/azure/ai-services/agents/how-to/tools/code-interpreter?tabs=python&pivots=overview).
0 commit comments