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
To verify your code, add the running project as an MCP server for GitHub Copilot in Visual Studio Code:
130
-
131
-
1. Press <kbd>F1</kbd>. In the command palette, search for and run **MCP: Add Server**.
132
-
133
-
1. Choose **HTTP (Server-Sent Events)** for the transport type.
134
-
135
-
1. Enter the URL of the MCP endpoint you copied in the previous step.
138
+
The project template includes a `.vscode/mcp.json` file that already defines a `local-mcp-function` server pointing to your local MCP endpoint. Use this configuration to verify your code with GitHub Copilot in Visual Studio Code:
136
139
137
-
1. Use the generated **Server ID** and select **Workspace** to save the MCP server connection to your Workspace settings.
140
+
1.Open the `.vscode/mcp.json` file and select the **Start**button above the `local-mcp-function` configuration.
138
141
139
-
1. Open the command palette and run **MCP: List Servers** and verify that the server you added is listed and running.
142
+
1.In the Copilot **Chat** window, make sure that the **Agent** mode is selected, select the **Configure tools** icon, and verify that `MCP Server:local-mcp-function`is enabled in the chat.
140
143
141
-
1. In Copilot chat, select **Agent** mode and run this prompt:
Copy file name to clipboardExpand all lines: articles/azure-functions/scenario-mcp-apps.md
+8-17Lines changed: 8 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ This article supports version 2 of the Python programming model for Azure Functi
52
52
::: zone pivot="programming-language-csharp,programming-language-python,programming-language-typescript"
53
53
+[Node.js](https://nodejs.org/) (required to build the MCP Apps UI)
54
54
55
-
+[Visual Studio Code Insiders](https://code.visualstudio.com/insiders) with these extensions:
55
+
+[Visual Studio Code](https://code.visualstudio.com/) with these extensions:
56
56
57
57
+[Azure Functions extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions). This extension requires [Azure Functions Core Tools](functions-run-local.md) and attempts to install it when not available.
@@ -63,9 +63,6 @@ This article supports version 2 of the Python programming model for Azure Functi
63
63
64
64
+ An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
65
65
66
-
> [!IMPORTANT]
67
-
> MCP Apps require [Visual Studio Code Insiders](https://code.visualstudio.com/insiders). The stable release of VS Code doesn't yet support rendering MCP App UI resources.
68
-
69
66
## Initialize the project
70
67
71
68
Use the Azure Developer CLI to create an Azure Functions code project from a template.
@@ -166,19 +163,13 @@ The MCP Apps weather tool includes a frontend application that you must build be
166
163
167
164
## Verify by using GitHub Copilot
168
165
169
-
To verify your code, add the running project as an MCP server for GitHub Copilot in Visual Studio Code:
170
-
171
-
1. Press <kbd>F1</kbd>. In the command palette, search for and run **MCP: Add Server**.
172
-
173
-
1. Choose **HTTP (Server-Sent Events)** for the transport type.
166
+
The project template includes a `.vscode/mcp.json` file that already defines a `local-mcp-function` server pointing to your local MCP endpoint. Use this configuration to verify your code with GitHub Copilot in Visual Studio Code:
174
167
175
-
1. Enter the URL of the MCP endpoint you copied in the previous step.
168
+
1. Open the `.vscode/mcp.json` file and select the **Start** button above the `local-mcp-function` configuration.
176
169
177
-
1. Use the generated **Server ID** and select **Workspace** to save the MCP server connection to your Workspace settings.
170
+
1. In the Copilot **Chat** window, make sure that the **Agent** mode is selected, select the **Configure tools** icon, and verify that `MCP Server:local-mcp-function` is enabled in the chat.
178
171
179
-
1. Open the command palette and run **MCP: List Servers** and verify that the server you added is listed and running.
180
-
181
-
1. In Copilot chat, select **Agent** mode and run this prompt:
172
+
1. Run this prompt:
182
173
183
174
```copilot-prompt
184
175
What's the weather in Seattle?
@@ -207,13 +198,13 @@ The `ToolMetadata` constant declares a `ui.resourceUri` that tells the MCP host
207
198
You can view the complete project template in the [Azure Functions .NET MCP Server](https://github.com/Azure-Samples/remote-mcp-functions-dotnet) GitHub repository.
208
199
::: zone-end
209
200
::: zone pivot="programming-language-python"
210
-
The function code for the MCP Apps weather tool is defined in the `src/function_app.py` file. The `metadata` parameter on `@app.mcp_tool()` adds UI metadata to the tool, and `@app.mcp_resource_trigger()` serves the HTML widget:
201
+
The function code for the MCP Apps weather tool is defined in the `src/function_app.py` file. The `metadata` parameter on `@app.mcp_tool()` adds UI metadata to the tool:
The `TOOL_METADATA` constant declares a `ui.resourceUri` that tells the MCP host to fetch the interactive UI from `ui://weather/index.html` after the tool runs. The `@app.mcp_resource_trigger()` method serves the HTML widget. The `get_weather_widget` function serves the bundled HTML file at that URI using `@app.mcp_resource_trigger()`:
215
206
216
-
The `TOOL_METADATA` constant declares a `ui.resourceUri` that tells the MCP host to fetch the interactive UI from `ui://weather/index.html` after the tool runs. The `get_weather_widget` function serves the bundled HTML file at that URI using `@app.mcp_resource_trigger()`.
You can view the complete project template in the [Azure Functions Python MCP Server](https://github.com/Azure-Samples/remote-mcp-functions-python) GitHub repository.
Copy file name to clipboardExpand all lines: includes/functions-mcp-connect-remote.md
+6-22Lines changed: 6 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,17 @@ ms.date: 02/20/2026
6
6
ms.author: glenga
7
7
---
8
8
9
-
Your MCP server is now running in Azure. When you access the tools, you need to include a system key in your request. This key provides a degree of access control for clients accessing your remote MCP server. After you get this key, you can connect GitHub Copilot to your remote server.
9
+
Your MCP server is now running in Azure. The project template includes a `remote-mcp-function` entry in `.vscode/mcp.json` that's already configured to connect to your remote server. When you start this server, VS Code prompts you for the function app name and system key needed to access the remote MCP endpoint.
10
10
11
-
1. Run this script that uses `azd` and the Azure CLI to print out both the MCP server URL and the system key (`mcp_extension`) required to access the tools:
11
+
1. Run this script that uses `azd` and the Azure CLI to print out both the function app name and the system key (`mcp_extension`) required to access the tools:
12
12
13
13
### [Linux/macOS](#tab/linux)
14
14
15
15
```bash
16
16
eval$(azd env get-values --output dotenv)
17
17
MCP_EXTENSION_KEY=$(az functionapp keys list --resource-group $AZURE_RESOURCE_GROUP \
Write-Host "MCP Server URL: https://$SERVICE_API_NAME.azurewebsites.net/runtime/webhooks/mcp"
33
+
Write-Host "Function app name: $SERVICE_API_NAME"
34
34
Write-Host "MCP Server key: $MCP_EXTENSION_KEY"
35
35
```
36
36
37
37
---
38
38
39
-
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette, search for and run the command`MCP: Open Workspace Folder MCP Configuraton`, which opens the `mcp.json` configuration file.
40
-
41
-
1. In the `mcp.json` configuration, find the named MCP server you added earlier, change the `url` value to your remote MCP server URL, and add a `headers.x-functions-key` element, which contains your copied MCP server access key, as in this example:
Copy file name to clipboardExpand all lines: includes/functions-mcp-deploy-azure.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,12 @@ This project is configured to use `azd` to deploy this project to a new function
10
10
11
11
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette. Search for and run the command `Azure Developer CLI (azd): Package, Provision and Deploy (up)`. Then, sign in by using your Azure account.
12
12
13
-
1. When prompted, provide these required deployment parameters:
13
+
1. When prompted, select these required deployment parameters:
14
14
15
15
| Parameter | Description |
16
16
| ---- | ---- |
17
-
|_Azure subscription_| Subscription in which your resources are created.|
18
-
|_Azure location_| Azure region in which to create the resource group that contains the new Azure resources. Only regions that currently support the Flex Consumption plan are shown.|
17
+
|_Azure subscription_| Subscription in which your resources are created. |
18
+
|_Azure location_| Azure region in which to create the resource group that contains the new Azure resources. Only regions that currently support the Flex Consumption plan are shown. |
19
+
|_vnetEnabled_|`False` to skip creating virtual network resources, which simplifies the deployment. |
19
20
20
21
After the command completes successfully, you see links to the resources you created.
Copy file name to clipboardExpand all lines: includes/functions-mcp-run-locally.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,19 @@ ms.date: 02/20/2026
6
6
ms.author: glenga
7
7
---
8
8
9
-
Visual Studio Code integrates with [Azure Functions Core tools](../articles/azure-functions/functions-run-local.md) to let you run this project on your local development computer by using the Azurite emulator.
9
+
::: zone pivot="programming-language-csharp"
10
10
11
-
1. To start the function locally, press <kbd>F5</kbd> or the **Run and Debug** icon in the left-hand side Activity bar. The **Terminal** panel displays the output from Core Tools. Your app starts in the **Terminal** panel, and you can see the name of the functions that are running locally.
11
+
In a terminal window, start the Functions host:
12
12
13
-
1. Make a note of the local MCP server endpoint (like `http://localhost:7071/runtime/webhooks/mcp`), which you use to configure GitHub Copilot in Visual Studio Code.
13
+
```console
14
+
func start
15
+
```
16
+
17
+
::: zone-end
18
+
::: zone pivot="programming-language-java,programming-language-python,programming-language-typescript"
19
+
20
+
Visual Studio Code integrates with [Azure Functions Core tools](../articles/azure-functions/functions-run-local.md) to let you run this project on your local development computer. To start your Functions app locally, press <kbd>F5</kbd> or select the **Run and Debug** icon in the left-hand side Activity bar.
21
+
22
+
::: zone-end
23
+
24
+
The **Terminal** panel displays the output from Core Tools. Your app starts in the **Terminal** panel, and you can see the names of the functions running locally.
0 commit comments