[CLI as MCP] Initialize Local MCP Server#9013
Draft
ReaNAiveD wants to merge 5 commits intoAzure:mainfrom
Draft
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
Collaborator
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
ReaNAiveD
commented
Jul 29, 2025
src/mcp-server/azext_mcp/server.py
Outdated
Comment on lines
123
to
130
| super().resource( | ||
| "az://{command_name_path}", | ||
| name="Azure CLI Command Help", | ||
| description="Retrieve comprehensive help documentation for Azure CLI commands and command groups. " | ||
| "Provides detailed information including command syntax, parameters, examples, and usage patterns. " | ||
| "Path format: 'az://command/subcommand' (e.g., 'az://login', 'az://vm/create', 'az://storage/account/list')", | ||
| mime_type="application/json", | ||
| )(self.command_help_resource) |
Member
Author
There was a problem hiding this comment.
This doesn't work because the implemetation of MCP python package has only very basic support of RFG 6570. modelcontextprotocol/python-sdk#378
4 tasks
Member
|
Can boost this work, AWS has released something similar https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a very initial idea of a Local MCP server, which I name it "CLI as MCP".
Azure CLI could provide a command
az mcp upto serve as a local MCP server through stdio.Through this way, Azure CLI could integrate with VSCode Copilot Chat and other MCP client.
How to Install
Build the mcp server and install it as an Azure CLI extension.
Enable MCP Server in VSCode
In VSCode, click the tools icon in Copilot Chat.





Select
Add More ToolsSelect
Add MCP Server...Select the
Command(stdio)typeInput
az mcp upto start the Local MCP ServerEnable MCP Server in VSCode (Alternative)
Add a new file named
mcp.jsonin.vscodefolder. Add the following config in this file:{ "servers": { "AzureLocalMcpServer": { "type": "stdio", "command": "az", "args": [ "mcp", "up" ] } }, "inputs": [] }How to use
After adding the Server, you should see two new tools in your toolset.

You can now use it in the Agent Mode!

This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az mcp upGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.