azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

[CLI as MCP] Initialize Local MCP Server

Open ReaNAiveD opened this issue 6 months ago • 5 comments

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 up to 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.

azdev extension build mcp-server
az extension add --source azure-cli-extensions\src\mcp-server\dist\mcp_server-1.0.0b1-py3-none-any.whl

Enable MCP Server in VSCode

In VSCode, click the tools icon in Copilot Chat. image Select Add More Tools image Select Add MCP Server... image Select the Command(stdio) type image Input az mcp up to start the Local MCP Server image

Enable MCP Server in VSCode (Alternative)

Add a new file named mcp.json in .vscode folder. 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. image

You can now use it in the Agent Mode! image


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az mcp up

General Guidelines

  • [ ] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • [ ] Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • [ ] My extension version conforms to the Extension version schema

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.json automatically.
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.

ReaNAiveD avatar Jul 29 '25 06:07 ReaNAiveD

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). After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

github-actions[bot] avatar Jul 29 '25 06:07 github-actions[bot]

Thank you for your contribution! We will review the pull request and get back to you soon.

yonzhan avatar Jul 29 '25 06:07 yonzhan

github-actions[bot] avatar Jul 29 '25 06:07 github-actions[bot]

Can boost this work, AWS has released something similar

https://github.com/awslabs/mcp/tree/main/src/aws-api-mcp-server

mainred avatar Oct 23 '25 00:10 mainred