Skip to content

Commit a186582

Browse files
authored
Merge pull request #311160 from mumian/0127-mcp
Document Bicep MCP Server
2 parents 8f7f2c3 + 29049c3 commit a186582

24 files changed

Lines changed: 248 additions & 19 deletions

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2755,6 +2755,11 @@
27552755
"redirect_url": "/azure/azure-portal/azure-portal-supported-browsers-devices",
27562756
"redirect_document_id": false
27572757
},
2758+
{
2759+
"source_path_from_root": "/articles/azure-resource-manager/bicep/deploy-vscode.md",
2760+
"redirect_url": "/azure/azure-resource-manager/bicep/deploy-visual-studio-code",
2761+
"redirect_document_id": false
2762+
},
27582763
{
27592764
"source_path_from_root": "/articles/azure-resource-manager/management/control-plane-metrics.md",
27602765
"redirect_url": "/azure/azure-resource-manager/management/monitor-resource-manager",
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: Bicep MCP server
3+
description: Learn how to use Bicep MCP server to create Bicep files.
4+
ms.topic: how-to
5+
ms.date: 02/04/2026
6+
---
7+
8+
# Use Bicep MCP server
9+
10+
The Bicep MCP (Model Context Protocol) server provides AI agents with tools to help generate high-quality Bicep code. The current release exposes the following tools:
11+
12+
* **`decompile_arm_parameters_file`** - Converts ARM template parameter JSON files into Bicep parameters format (.bicepparam).
13+
* **`decompile_arm_template_file`** - Converts ARM template JSON files into Bicep syntax (.bicep).
14+
* **`format_bicep_file`** - Applies consistent formatting, including indentation, spacing, and line breaks, to Bicep files.
15+
* **`get_az_resource_type_schema`** - Gets the schema for a specific Azure resource type and API version.
16+
* **`get_bicep_best_practices`** - Returns Bicep coding best practices and guidelines.
17+
* **`get_bicep_file_diagnostics`** - Analyzes a Bicep file and returns all compilation diagnostics.
18+
* **`get_deployment_snapshot`** - Creates a snapshot from a .bicepparam file to preview resources and compare Bicep implementations.
19+
* **`get_file_references`** - Analyzes a Bicep file and returns a list of all referenced files, including modules, parameter files, and other dependencies.
20+
* **`list_avm_metadata`** - Lists metadata for all Azure Verified Modules (AVM).
21+
* **`list_az_resource_types_for_provider`** - Lists all Azure resource types for a specific provider, such as Microsoft.Storage.
22+
23+
Use the Bicep MCP server directly in [Visual Studio Code](#visual-studio-code). You can also run it locally with [MCP-compatible services](#integration-with-other-ai-services).
24+
25+
## Limitations
26+
27+
> [!NOTE]
28+
> You're responsible for reviewing all code generated by an LLM and **deploy at your own risk**.
29+
30+
These tools provide additional context to help the chosen model generate semantically and syntactically correct Bicep code. These tools aren't designed to deploy directly to Azure.
31+
32+
There's no way to definitively guarantee whether the agent orchestrator uses any particular Bicep tool. As a workaround, you can view the available Bicep tools and use specific prompting to guide the agent orchestrator to invoke a tool, such as "Create a Bicep file to do X using Bicep best practices."
33+
34+
## Visual Studio Code
35+
36+
The Bicep MCP server is available starting with Visual Studio Code Bicep extension version 0.40.2. For more information about installing, managing, and using Bicep MCP server from VS Code, see [Bicep MCP server](./visual-studio-code.md#bicep-mcp-server).
37+
38+
## Integration with other AI services
39+
40+
You can run the Azure Bicep MCP server locally for Claude Desktop and Code, OpenAI Codex CLI, and LMStudio where you can use it with various models.
41+
42+
By using [.NET 10.0 SDK](https://dotnet.microsoft.com/download/dotnet/10.0?WT.mc_id=MVP_323261), you can use `dnx` to get the latest version of the Bicep MCP server directly from the NuGet package without needing to build it yourself.
43+
44+
```
45+
dnx -y Azure.Bicep.McpServer
46+
```
47+
48+
The following JSON is an example of configuration for Visual Studio Code:
49+
50+
```json
51+
"Bicep": {
52+
"type": "stdio",
53+
"command": "dnx",
54+
"args": [
55+
"-y",
56+
"Azure.Bicep.McpServer"
57+
]
58+
}
59+
```
60+
61+
For more information, see [Configuration format](https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_configuration-format).
62+
63+
## Next steps
64+
65+
For a tutorial on how to apply the information in this article, see [Quickstart: Create Bicep files with Visual Studio Code and Bicep MCP server](./quickstart-create-bicep-use-visual-studio-code-model-context-protocol.md).

articles/azure-resource-manager/bicep/deploy-vscode.md renamed to articles/azure-resource-manager/bicep/deploy-visual-studio-code.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,36 @@ To use the deployment pane:
2121

2222
- Select the show deployment pane button on the upper right corner as shown in the following screenshot:
2323

24-
:::image type="content" source="./media/deploy-vscode/visual-studio-code-open-deployment-pane.png" alt-text="Screenshot of the open deployment pane button.":::
24+
:::image type="content" source="./media/deploy-visual-studio-code/visual-studio-code-open-deployment-pane.png" alt-text="Screenshot of the open deployment pane button.":::
2525

2626
By default, VS Code opens the deployment pane on the side. To open it in a new tab, hold <kbd>Alt</kbd> while selecting the button.
2727

2828
- Another way to open the deployment pane is through the command palette. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>, then select either **Show Deployment Pane** or **Show Deployment Pane to the Side**.
2929

30-
:::image type="content" source="./media/deploy-vscode/visual-studio-code-show-deployment-pane.png" alt-text="Screenshot of show deployment pane in command palette.":::
30+
:::image type="content" source="./media/deploy-visual-studio-code/visual-studio-code-show-deployment-pane.png" alt-text="Screenshot of show deployment pane in command palette.":::
3131

3232
The deployment pane appears as shown in the following screenshot:
3333

34-
:::image type="content" source="./media/deploy-vscode/visual-studio-code-deployment-pane.png" alt-text="Screenshot of initial deployment pane in Visual Studio Code.":::
34+
:::image type="content" source="./media/deploy-visual-studio-code/visual-studio-code-deployment-pane.png" alt-text="Screenshot of initial deployment pane in Visual Studio Code.":::
3535

3636
1. Select **Pick Scope** to define the deployment scope. After authentication, you're able to select the subscription and the resource group of your desired deployment.
3737
1. If the deployment pane was opened for a .bicep file, fill out your desired parameter values, or select **Pick JSON Parameters File** to select a JSON parameter file.
3838

39-
:::image type="content" source="./media/deploy-vscode/visual-studio-code-deployment-pane-pick-parameters-file.png" alt-text="Screenshot of picking parameters file in the deployment pane in Visual Studio Code.":::
39+
:::image type="content" source="./media/deploy-visual-studio-code/visual-studio-code-deployment-pane-pick-parameters-file.png" alt-text="Screenshot of picking parameters file in the deployment pane in Visual Studio Code.":::
4040

4141
1. Select your desired action - **Deploy**, **Validate**, or **What-if**.
4242

4343
- **Deploy**: deploys to Azure, and the result including the defined output are shown in the deployment pane.
4444

4545
The following screenshot shows a successful deployment. You can select the blue globe icon to view the deployment or individual resources in the Azure portal.
4646

47-
:::image type="content" source="./media/deploy-vscode/visual-studio-code-deployment-pane-successful-deployment.png" alt-text="Screenshot of deployment pane in Visual Studio Code.":::
47+
:::image type="content" source="./media/deploy-visual-studio-code/visual-studio-code-deployment-pane-successful-deployment.png" alt-text="Screenshot of deployment pane in Visual Studio Code.":::
4848

4949
- **Validate**: performs a runtime validation of the Bicep file against Azure, ensuring that the resources, parameters, and policies are correct in the actual deployment environment. Unlike a [linter](./linter.md), which only performs offline validation, this validation interacts with Azure to detect potential deployment issues.
5050

5151
The following screenshot shows an example of a validation failure.
5252

53-
:::image type="content" source="./media/deploy-vscode/visual-studio-code-deployment-pane-validation-error.png" alt-text="Screenshot of deployment pane validation error in Visual Studio Code.":::
53+
:::image type="content" source="./media/deploy-visual-studio-code/visual-studio-code-deployment-pane-validation-error.png" alt-text="Screenshot of deployment pane validation error in Visual Studio Code.":::
5454

5555
- **What-if**: executes a **What-If** analysis directly from the deployment pane. The pane displays the results, showing any planned changes. This performs the same function as the what-if command in Azure PowerShell and Azure CLI. For more information, see [Bicep deployment what-if operation](./deploy-what-if.md)
5656

@@ -64,35 +64,35 @@ There are three ways you can find the command from an open Bicep file in Visual
6464

6565
- Right-click the Bicep file name from the Explorer pane instead of the one under **OPEN EDITORS**:
6666

67-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-from-explorer.png" alt-text="Screenshot of Deploying Bicep File in the Context menu from the explorer pane.":::
67+
:::image type="content" source="./media/deploy-visual-studio-code/bicep-deploy-from-explorer.png" alt-text="Screenshot of Deploying Bicep File in the Context menu from the explorer pane.":::
6868

6969
- Right-click anywhere inside a Bicep file, and then select **Deploy Bicep File**.
7070

7171
- Select **Command Palette** from the **View** menu, and then select **Bicep: Deploy Bicep File**.
7272

73-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-from-command-palette.png" alt-text="Screenshot of Deploy Bicep File in the Context menu.":::
73+
:::image type="content" source="./media/deploy-visual-studio-code/bicep-deploy-from-command-palette.png" alt-text="Screenshot of Deploy Bicep File in the Context menu.":::
7474

7575
After you select the command, follow the wizard to enter the values:
7676

7777
1. If you're not signed in, follow the instructions provided in the prompt to complete the sign-in process.
7878

79-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-sign-in.png" alt-text="Screenshot of sign-in.":::
79+
:::image type="content" source="./media/deploy-visual-studio-code/bicep-deploy-sign-in.png" alt-text="Screenshot of sign-in.":::
8080

8181
[!INCLUDE [vscode authentication](../../../includes/resource-manager-vscode-authentication.md)]
8282

8383
1. Select or create a resource group.
8484

8585
1. Select a parameters file or **None** to enter values for parameters:
8686

87-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-select-parameter-file.png" alt-text="Screenshot of Select parameters file.":::
87+
:::image type="content" source="./media/deploy-visual-studio-code/bicep-deploy-select-parameter-file.png" alt-text="Screenshot of Select parameters file.":::
8888

8989
1. If you choose **None**, enter the values for parameters:
9090

91-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-enter-parameter-values.png" alt-text="Screenshot of Enter parameter values.":::
91+
:::image type="content" source="./media/deploy-visual-studio-code/bicep-deploy-enter-parameter-values.png" alt-text="Screenshot of Enter parameter values.":::
9292

9393
After you enter the values, you have the option to create a parameters file from values used in this deployment:
9494

95-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-create-parameter-file.png" alt-text="Screenshot of Create parameters file.":::
95+
:::image type="content" source="./media/deploy-visual-studio-code/bicep-deploy-create-parameter-file.png" alt-text="Screenshot of Create parameters file.":::
9696

9797
If you select **Yes**, a parameters file named _&lt;Bicep-file-name>.parameters.json_ is created in the same folder.
9898

articles/azure-resource-manager/bicep/deploy-what-if.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.custom:
1515

1616
Before deploying a Bicep file, you can preview the changes that will happen. Azure Resource Manager provides the what-if operation to let you see how resources will change if you deploy the Bicep file. The what-if operation doesn't make any changes to existing resources. Instead, it predicts the changes if the specified Bicep file is deployed.
1717

18-
You can use the what-if operation with [Visual Studio Code](./deploy-vscode.md#deployment-pane), Azure PowerShell, Azure CLI, or REST API operations. What-if is supported for resource group, subscription, management group, and tenant level deployments.
18+
You can use the what-if operation with [Visual Studio Code](./deploy-visual-studio-code.md#deployment-pane), Azure PowerShell, Azure CLI, or REST API operations. What-if is supported for resource group, subscription, management group, and tenant level deployments.
1919

2020
During What-If operations, the evaluation and expansion of `templateLink` aren't supported. As a result, any resources deployed using template links within nested deployments, including template spec references, won't be visible in the What-If operation results.
2121

articles/azure-resource-manager/bicep/media/deploy-vscode/bicep-deploy-create-parameter-file.png renamed to articles/azure-resource-manager/bicep/media/deploy-visual-studio-code/bicep-deploy-create-parameter-file.png

File renamed without changes.

articles/azure-resource-manager/bicep/media/deploy-vscode/bicep-deploy-enter-parameter-values.png renamed to articles/azure-resource-manager/bicep/media/deploy-visual-studio-code/bicep-deploy-enter-parameter-values.png

File renamed without changes.

articles/azure-resource-manager/bicep/media/deploy-vscode/bicep-deploy-from-command-palette.png renamed to articles/azure-resource-manager/bicep/media/deploy-visual-studio-code/bicep-deploy-from-command-palette.png

File renamed without changes.

articles/azure-resource-manager/bicep/media/deploy-vscode/bicep-deploy-from-explorer.png renamed to articles/azure-resource-manager/bicep/media/deploy-visual-studio-code/bicep-deploy-from-explorer.png

File renamed without changes.

articles/azure-resource-manager/bicep/media/deploy-vscode/bicep-deploy-select-parameter-file.png renamed to articles/azure-resource-manager/bicep/media/deploy-visual-studio-code/bicep-deploy-select-parameter-file.png

File renamed without changes.

articles/azure-resource-manager/bicep/media/deploy-vscode/bicep-deploy-sign-in.png renamed to articles/azure-resource-manager/bicep/media/deploy-visual-studio-code/bicep-deploy-sign-in.png

File renamed without changes.

0 commit comments

Comments
 (0)