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
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).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/deploy-visual-studio-code.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,36 +21,36 @@ To use the deployment pane:
21
21
22
22
- Select the show deployment pane button on the upper right corner as shown in the following screenshot:
23
23
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.":::
25
25
26
26
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.
27
27
28
28
- 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**.
29
29
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.":::
31
31
32
32
The deployment pane appears as shown in the following screenshot:
33
33
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.":::
35
35
36
36
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.
37
37
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.
38
38
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.":::
40
40
41
41
1. Select your desired action - **Deploy**, **Validate**, or **What-if**.
42
42
43
43
-**Deploy**: deploys to Azure, and the result including the defined output are shown in the deployment pane.
44
44
45
45
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.
46
46
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.":::
48
48
49
49
-**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.
50
50
51
51
The following screenshot shows an example of a validation failure.
52
52
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.":::
54
54
55
55
-**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)
56
56
@@ -64,35 +64,35 @@ There are three ways you can find the command from an open Bicep file in Visual
64
64
65
65
- Right-click the Bicep file name from the Explorer pane instead of the one under **OPEN EDITORS**:
66
66
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.":::
68
68
69
69
- Right-click anywhere inside a Bicep file, and then select **Deploy Bicep File**.
70
70
71
71
- Select **Command Palette** from the **View** menu, and then select **Bicep: Deploy Bicep File**.
72
72
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.":::
74
74
75
75
After you select the command, follow the wizard to enter the values:
76
76
77
77
1. If you're not signed in, follow the instructions provided in the prompt to complete the sign-in process.
78
78
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.":::
1. Select a parameters file or **None** to enter values for parameters:
86
86
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.":::
88
88
89
89
1. If you choose **None**, enter the values for parameters:
90
90
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.":::
92
92
93
93
After you enter the values, you have the option to create a parameters file from values used in this deployment:
94
94
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.":::
96
96
97
97
If you select **Yes**, a parameters file named _<Bicep-file-name>.parameters.json_ is created in the same folder.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/deploy-what-if.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.custom:
15
15
16
16
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.
17
17
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.
19
19
20
20
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.
0 commit comments