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
Resolves multiple issues when calling azd extension tool (#203)
Resolves multiple issues when azd is invoked from MCP server
Adds additional command parameters for cwd, environment and learn to provide additional context and description to the calling agent/LLM .
Enables the agent/LLM to learn more about the best practices for azd usage and guidelines in additional to the limited tool description.
Returns the azd best practices guide when the learn parameter has been set.
Encourages the agent/LLM to run long running operations like provision, deploy, up and down in a terminal instead of within the tool so users get incremental feedback. Today the MCP protocol does not support incremental streaming response feedback that can be handled. At some point in the future when better streaming support is available, we can re-visit this implementation.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,11 @@
5
5
### Bugs Fixed
6
6
7
7
- Fixes Service Bus host name parameter description. https://github.com/Azure/azure-mcp/pull/209/
8
+
- Updates the usage patterns of Azure Developer CLI (azd) when invoked from MCP. https://github.com/Azure/azure-mcp/pull/203
9
+
10
+
### Features Added
11
+
12
+
### Other Changes
8
13
9
14
## 0.0.18 (2025-05-14)
10
15
@@ -18,6 +23,7 @@
18
23
19
24
- Added an opt-in timeout for browser-based authentication to handle cases where the process waits indefinitely if the user closes the browser. https://github.com/Azure/azure-mcp/pull/189
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -116,12 +116,13 @@ The Azure MCP Server provides tools for interacting with the following Azure ser
116
116
- Support for template discovery, template initialization, provisioning and deployment
117
117
- Cross-platform compatibility
118
118
119
+
Agents and models can discover and learn best practices and usage guidelines for the `azd` MCP tool. For more information, see [AZD Best Practices](https://github.com/Azure/azure-mcp/tree/main/src/Resources/azd-best-practices.txt).
120
+
119
121
### 🛡️ Azure Best Practices
120
122
- Get secure, production-grade Azure SDK best practices for effective code generation.
121
123
122
124
For detailed command documentation and examples, see [Azure MCP Commands](https://github.com/Azure/azure-mcp/blob/main/docs/azmcp-commands.md).
123
125
124
-
125
126
## 🔌 Getting Started
126
127
127
128
The Azure MCP Server requires Node.js to install and run the server. If you don't have it installed, follow the instructions [here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
@@ -32,36 +54,77 @@ public sealed class AzdCommand(ILogger<AzdCommand> logger, int processTimeoutSec
32
54
protectedoverridestringGetCommandName()=>"azd";
33
55
34
56
protectedoverridestringGetCommandDescription()=>
35
-
"Use this tool to always run all Azure Developer CLI (azd) commands. "+
36
-
"Most common activities will be helping users initialize projects, manage environments, provision and deploy infrastructure and apps to their Azure environment. "+
37
-
"If an azure.yaml file exists in the workspace, treat it as an existing azd project; otherwise, use init to create one. "+
38
-
"Always pass --cwd with the full workspace path, and use -e to specify the environment when required. Confirm with the user before performing destructive operations. "+
39
-
"After each command, suggest next steps if available, and ask before proceeding. On errors, prompt for missing info and retry. "+
40
-
"Be concise and contextual, using data from the user's environment and workspace to provide accurate, actionable responses. "+
41
-
"This tool can create, modify or delete resources in Azure. Always warn and confirm action with the user before performing destructive commands like 'up', 'down', 'provision' or 'deploy'.";
57
+
"""
58
+
Runs Azure Developer CLI (azd) commands.
59
+
Agents and LLM's must always run this tool with the 'learn' parameter and empty 'command' on first use to learn more about 'azd' best practices and usage patterns.
60
+
61
+
This tool supports the following:
62
+
- List, search and show templates to start your project
63
+
- Create and initialize new projects and templates
64
+
- Show and manage azd configuration
65
+
- Show and manage environments and values
66
+
- Provision Azure resources
67
+
- Deploy applications
68
+
- Bring the whole project up and online
69
+
- Bring the whole project down and deallocate all Azure resources
70
+
- Setup CI/CD pipelines
71
+
- Monitor Azure applications
72
+
- Show information about the project and its resources
73
+
- Show and manage extensions and extension sources
74
+
- Show and manage templates and template sources
75
+
76
+
If unsure about available commands or their parameters, run azd help or azd <group> --help in the command to discover them.
elseif(result.Output.Contains("no default response for prompt"))
246
356
{
247
357
contentResults.Add(
248
-
"The command requires user input. Prompt the user for the required information.\n"+
249
-
"- If missing Azure subscription use other tools to query and list available subscriptions for the user to select, then set the subscription ID (UUID) in the azd environment.\n"+
250
-
"- If missing Azure location, use other tools to query and list available locations for the user to select, then set the location name in the azd environment.\n"+
251
-
"- To set values in the azd environment use the command 'azd env set' command."
358
+
"""
359
+
The command requires user input. Prompt the user for the required information.
360
+
- If missing Azure subscription use other tools to query and list available subscriptions for the user to select, then set the subscription ID (UUID) in the azd environment.
361
+
- If missing Azure location, use other tools to query and list available locations for the user to select, then set the location name in the azd environment.
362
+
- To set values in the azd environment use the command 'azd env set' command."
- help: Get detailed help on available command and parameters (`azd help`, `azd <group> --help`)
23
+
- version: Check the CLI version
24
+
25
+
Required Parameters:
26
+
- cwd (string): Absolute path to the working directory. Required for all invocations.
27
+
- command (string): The azd CLI command to run without `azd` prefix
28
+
- environment (string, optional): To specify the environment to use for the command.
29
+
- learn (boolean, optional): Set to true to receive this usage guide.
30
+
31
+
Execution Guidelines:
32
+
- Never assume environment names, always prompt the user to supply an environment name that is then used in downstream commands such as `init`.
33
+
- If commands require a subscription or location, retrieve configuration defaults from the `config show` command.
34
+
- When configuration defaults do not exist, prompt the user to supply a value and leverage other tools to list subscription and locations for easy selection.
35
+
- Check for an `azure.yaml` file in the workspace to determine if the project is already initialized.
36
+
- Never make assumptions on command names or arguments - Call `help` command or `<command> --help` to contract proper commands.
37
+
- When an error occurs, always run help commands to ensure the command exists and is run with the expected parameters and then retry.
38
+
- Use `azd help` or `azd <command group> --help` to explore options and flags.
39
+
- Commands `provision`, `deploy`, `up` and `down are considered long running operations.
40
+
- For long running commands do not use this tool - instead always run them in a terminal so users can see incremental progress passing in the same.
41
+
- Other than long running commands, all other azd commands should be executed using the 'azmcp-extension-azd' tool.
42
+
- Suggest next steps when provided by previous command output.
43
+
- Always prompt the user to confirm before running commands that create, update, or delete Azure resources (e.g. `provision`, `deploy`, `up`, `down`).
0 commit comments