There are many ways to contribute to the Azure MCP project: reporting bugs, submitting pull requests, and creating suggestions. After cloning and building the repo, check out the GitHub project and issues list. Issues labeled help wanted are good issues to submit a PR for. Issues labeled good first issue are great candidates to pick up if you are in the code for the first time.
Important
If you are contributing significant changes, or if the issue is already assigned to a specific milestone, please discuss with the assignee of the issue first before starting to work on the issue.
- Contributing to Azure MCP
⚠️ If you are a Microsoft employee then please also review our Azure Internal Onboarding Documentation for getting setup
- VS Code: Install either stable or Insiders release
- GitHub Copilot: Install GitHub Copilot and GitHub Copilot Chat extensions
- Node.js: Install Node.js 20 or later (ensure
nodeandnpmare in your PATH) - PowerShell: Install PowerShell 7.0 or later (required for build and test scripts)
The project is organized as follows:
core/- Core functionality and CLI applicationsrc/- Core source codeAzureMcp.Core/- Core library with shared functionalityAzureMcp.Cli/- CLI application entry point
tests/- Core test filesAzureMcp.Core.UnitTests/- Core unit testsAzureMcp.Core.LiveTests/- Core integration testsAzureMcp.Tests/- Shared test utilities
areas/- Service-specific implementations{area-name}/- Individual Azure service areas (e.g.,storage,cosmos)src/AzureMcp.{AreaName}/- Service specific codeCommands/- Command implementationsModels/- Service specific modelsServices/- Service implementations and interfacesOptions/- Service specific command options
tests/- Service specific testsAzureMcp.{AreaName}.UnitTests/- Unit tests require no authentication or test resourcesAzureMcp.{AreaName}.LiveTests/- Live tests depend on Azure resources and authenticationtest-resources.bicep- Infrastructure templates for testingtest-resources-post.ps1- Post-deployment scripts
docs/- Documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Write or update tests
- Test locally
- Submit a pull request
⚠️ Important: Submit One Tool Per Pull RequestWe strongly recommend submitting one tool per pull request to streamline the review process and provide better onboarding experience. This approach results in:
- Faster reviews: Single tools are easier and quicker to review
- Better feedback: More focused discussions on individual tool implementation
- Easier iteration: Smaller changes mean faster iteration cycles
- Incremental progress: Get your first tool merged to establish baseline, then build upon it
If you're planning to contribute multiple tools, please:
- Submit your most important or representative tool as your first PR to establish the code patterns.
- Use that baseline to inform your subsequent tool PRs.
-
Create an issue with title: "Add command: azmcp [namespace] [resource] [operation]" and detailed description
-
Set up development environment:
- Open VS Code Insiders
- Open the Copilot Chat view
- Select "Agent" mode
-
Generate the command using Copilot:
Execute in Copilot Chat: "create [namespace] [resource] [operation] command using #new-command.md as a reference"
-
Follow implementation guidelines in docs/new-command.md
-
Update documentation:
- Add the new command to /docs/azmcp-commands.md
- Add test prompts for the new command in /docs/e2eTestPrompts.md
- Update README.md to mention the new command
-
Add CODEOWNERS entry in CODEOWNERS (example)
-
Create Pull Request:
- Reference the issue you created
- Include tests in the
/testsfolder - Ensure all tests pass
- Follow code style requirements
- Run
ToolDescriptionEvaluatorfor the new tool description and obtain a score of0.4or more and a top 3 ranking for all related test prompts
Command authors must provide both unit tests and end-to-end test prompts.
Unit tests live under the /tests folder. To run tests:
./eng/scripts/Test-Code.ps1Requirements:
- Each command should have unit tests
- Tests should cover success and error scenarios
- Mock external service calls
- Test argument validation
End-to-end tests are performed manually. Command authors must thoroughly test each command to ensure correct tool invocation and results. At least one prompt per tool is required and should be added to /docs/e2eTestPrompts.md.
To run the Azure MCP server from source for local development:
Build the project at the root directory of this repository:
dotnet buildUpdate your mcp.json to point to the locally built azmcp executable:
{
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/azure-mcp/core/src/AzureMcp.Cli/bin/Debug/net9.0/azmcp[.exe]",
"args": ["server", "start"]
}
}
}Note: Replace
<absolute-path-to>with the full path to your built executable. On Windows, useazmcp.exe. On macOS/Linux, useazmcp.
Optional --namespace and --mode parameters can be used to configure different server modes:
Default Mode (no additional parameters):
{
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/azure-mcp/core/src/AzureMcp.Cli/bin/Debug/net9.0/azmcp[.exe]",
"args": ["server", "start"]
}
}
}Namespace Mode (expose specific services):
{
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/azure-mcp/core/src/AzureMcp.Cli/bin/Debug/net9.0/azmcp[.exe]",
"args": ["server", "start", "--namespace", "storage", "--namespace", "keyvault"]
}
}
}Namespace Proxy Mode (collapse tools by namespace):
{
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/azure-mcp/core/src/AzureMcp.Cli/bin/Debug/net9.0/azmcp[.exe]",
"args": ["server", "start", "--mode", "namespace"]
}
}
}Single Tool Proxy Mode (single "azure" tool with internal routing):
{
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/azure-mcp/core/src/AzureMcp.Cli/bin/Debug/net9.0/azmcp[.exe]",
"args": ["server", "start", "--mode", "single"]
}
}
}Combined Mode (filter namespaces with proxy mode):
{
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/azure-mcp/core/src/AzureMcp.Cli/bin/Debug/net9.0/azmcp[.exe]",
"args": ["server", "start", "--namespace", "storage", "--namespace", "keyvault", "--mode", "namespace"]
}
}
}Server Mode Summary:
- Default Mode: No additional parameters - exposes all tools individually
- Namespace Mode:
--namespace <service-name>- expose specific services- Namespace Proxy Mode:
--mode namespace- collapse tools by namespace (useful for VS Code's 128 tool limit)- Single Tool Mode:
--mode single- single "azure" tool with internal routing- Combined Mode: Both
--namespaceand--modecan be used together
With the configuration in place, you can launch the MCP server directly from your IDE or any tooling that uses mcp.json.
To build a local image for testing purposes:
-
Execute:
./eng/scripts/Build-Docker.ps1. -
Update
mcp.jsonto point to locally built Docker image:{ "servers": { "Azure MCP Server": { "command": "docker", "args": [ "run", "-i", "--rm", "--env-file", "/full/path/to/.env" "azure/azure-mcp:<insert-version-here>", ] } } }
⚠️ If you are a Microsoft employee with Azure source permissions then please review our Azure Internal Onboarding Documentation. As part of reviewing community contributions, Azure team members can run live tests by adding this comment to the PR/azp run azure - mcp.
Before running live tests:
- Install Azure PowerShell
- Install Azure Bicep
- Login to Azure PowerShell:
Connect-AzAccount - Deploy test resources:
./eng/scripts/Deploy-TestResources.ps1 -Area StorageDeploy-TestResources.ps1 Parameters:
| Parameter | Type | Description |
|---|---|---|
Area |
string | REQUIRED. The service area to deploy test resources for (e.g., Storage, KeyVault). One area per run. |
SubscriptionId |
string | Target subscription ID. If omitted, the current Azure context subscription (from Get-AzContext) is used. |
ResourceGroupName |
string | Resource group name. Defaults to {username}-mcp{hash(username)}. |
BaseName |
string | Base name prefix for resources. Defaults to mcp{hash}. |
Unique |
switch | Use a unique GUID-based hash for this invocation instead of the stable username+subscription hash. |
DeleteAfterHours |
int | Hours after which resources are tagged for deletion. Defaults to 12. |
Examples:
# Deploy Storage test resources using current Azure context subscription
./eng/scripts/Deploy-TestResources.ps1 -Area Storage
# Deploy Key Vault test resources to a specific subscription and keep for one week
./eng/scripts/Deploy-TestResources.ps1 -Area KeyVault -SubscriptionId <subId> -DeleteAfterHours 168 -UniqueAfter deploying test resources, you should have a .testsettings.json file with your deployment information in the deployed areas' /tests directory.
Run live tests with:
./eng/scripts/Test-Code.ps1 -TestType LiveYou can scope tests to specific areas:
./eng/scripts/Test-Code.ps1 -TestType Live -Areas Storage, KeyVaultYou can set the TestPackage parameter in .testsettings.json to have live tests run npx targeting an arbitrary Azure MCP package:
{
"TenantId": "a20062a8-ff76-41c2-8a6d-5e843da7b051",
"TenantName": "Your Tenant",
"SubscriptionId": "cd27afdc-9976-4f08-96e9-cad120a91560",
"SubscriptionName": "Your Subscription",
"ResourceGroupName": "rg-abcdefg",
"ResourceBaseName": "t1234567890",
"TestPackage": "@azure/mcp@0.0.10"
}To run live tests against the local build of an npm module:
./eng/scripts/Build-Local.ps1This will produce .tgz files in the .dist directory and set the TestPackage parameter in the .testsettings.json file:
"TestPackage": "file://D:\\repos\\azure-mcp\\.dist\\wrapper\\azure-mcp-0.0.12-alpha.1746488279.tgz"This section assumes that the necessary Azure resources for live tests are already deployed and that the .testsettings.json file with deployment information is located in the area's /tests/ directory.
To debug the Azure MCP Server (azmcp) when running live tests in VS Code:
-
Build the package with debug symbols:
./eng/scripts/Build-Local.ps1 -DebugBuild -
Set a breakpoint in a command file (e.g.,
KeyValueListCommand.ExecuteAsync) -
In VS Code, navigate to a test method (e.g.,
AppConfigCommandTests::Should_list_appconfig_kvs()), add a breakpoint toCallToolAsynccall in the test method, then right-click and select Debug Test -
Find the
azmcpprocess ID:pgrep -fl azmcp
Get-Process | Where-Object { $_.ProcessName -like "*azmcp*" } | Select-Object Id, ProcessName, Path
-
Open the Command Palette (
Cmd+Shift+Pon Mac,Ctrl+Shift+Pon Windows/Linux), select Debug: Attach to .NET 5+ or .NET Core process, and enter theazmcpprocess ID -
Hit F5 to "Continue" debugging, the debugger should attach to
azmcpand hit the breakpoint in command file
To ensure consistent code quality, code format checks will run during all PR and CI builds. Run dotnet format before submitting to catch format errors early.
To ensure consistent spelling across the codebase, run the spelling check before submitting:
.\eng\common\spelling\Invoke-Cspell.ps1This will check all files for spelling errors using the project's dictionary. Add any new technical terms or proper nouns to .vscode/cspell.json if needed.
- Follow C# coding conventions
- No comments in implementation code (code should be self-documenting)
- Use descriptive variable and method names
- Follow the exact file structure and naming conventions
- Use proper error handling patterns
- XML documentation for public APIs
- Follow Model Context Protocol (MCP) patterns
The AOT compatibility analysis helps identify potential issues that might prevent the Azure MCP Server from working correctly when compiled with AOT or when trimming is enabled.
To run the AOT compatibility analysis locally:
./eng/scripts/Analyze-AOT-Compact.ps1The HTML report will be generated at .work/aotCompactReport/aot-compact-report.html and automatically opened in your default browser.
To output the report to console, run the analysis with -OutputFormat Console argument.
AOT compatibility warnings typically indicate:
- Use of reflection without proper annotations
- Serialization of types that might be trimmed
- Dynamic code generation
- Use of
RequiresUnreferencedCodeAttributemethods without proper precautions
You can install our pre-push hook to catch code format issues by automatically running dotnet format before each git push:
./eng/scripts/Install-GitHooks.ps1- Installs the pre-push hook into your local repo./eng/scripts/Remove-GitHooks.ps1- Disables any git hooks in your local repo
The Azure MCP Server implements the Model Context Protocol specification. When adding new commands:
- Follow MCP JSON schema patterns
- Implement proper context handling
- Use standardized response formats
- Handle errors according to MCP specifications
- Provide proper argument suggestions
The Azure MCP Server supports connecting to external MCP servers through an embedded registry.json configuration file. This enables the server to act as a proxy, aggregating tools from multiple MCP servers into a single interface. The registry follows the same configuration schema as VS Code's mcp.json.
External MCP servers are defined in the embedded resource file core/src/AzureMcp.Core/Areas/Server/Resources/registry.json. This file contains server configurations that support both SSE (Server-Sent Events) and stdio transport mechanisms, following the standard MCP configuration format.
The registry structure follows this format:
{
"servers": {
"documentation": {
"url": "https://learn.microsoft.com/api/mcp",
"description": "Search official Microsoft/Azure documentation..."
},
"another-server": {
"type": "stdio",
"command": "path/to/executable",
"args": ["arg1", "arg2"],
"env": {
"ENV_VAR": "value"
},
"description": "Another MCP server using stdio transport"
}
}
}SSE (Server-Sent Events) Transport:
- Use the
urlproperty to specify the endpoint - Supports HTTP-based communication with automatic transport mode detection
- Best for web-based MCP servers and remote endpoints
Stdio Transport:
- Use
type: "stdio"with thecommandproperty - Supports launching external processes that communicate via standard input/output
- Use
argsarray for command-line arguments - Use
envobject for environment variables - Best for local executables, command-line tools, and local MCP servers
External servers are automatically discovered when the Azure MCP Server starts. They can be filtered using the same namespace mechanisms as built-in commands:
# Include only specific external servers
azmcp server start --namespace documentation --namespace another-server
# Use namespace mode to group tools exposed by external servers
azmcp server start --mode namespaceTo add a new external MCP server to the registry:
- Edit
core/src/AzureMcp.Core/Areas/Server/Resources/registry.json - Add your server configuration under the
serversobject using VS Code's MCP configuration schema - Use a unique identifier as the key
- Provide either a
urlfor SSE transport ortype: "stdio"withcommandfor stdio transport - Include a descriptive
descriptionfield - Rebuild the project to embed the updated registry
The current registry includes:
- documentation: Microsoft Learn documentation search via SSE transport
- Additional external servers can be added following the same pattern as VS Code's mcp.json
External servers integrate seamlessly with the Azure MCP Server's tool aggregation, appearing alongside native Azure commands in the unified tool interface. This allows you to combine local MCP servers, remote MCP endpoints, and Azure-specific tools in a single interface.
- Update documentation reflecting any changes
- Add or update tests as needed
- Reference the original issue
- Wait for review and address any feedback
The internal pipeline azure-mcp is used for all official releases and CI builds. On every merge to main, a build will run and will produce a dynamically named prerelease package on the public dev feed, e.g. @azure/mcp@0.0.10-beta.4799791.
Only manual runs of the pipeline sign and publish packages. Building main or hotfix/* will publish to npmjs.com, all other refs will publish to the public dev feed.
Packages published to npmjs.com will always use the @latest dist-tag.
Packages published to the dev feed will use:
@latestfor the latest official/release build@devfor the latest CI build of main@prefor any arbitrary pipeline run or feature branch build
To run live tests for a PR, inspect the PR code for any suspicious changes, then add the comment /azp run azure - mcp to the pull request. This will queue a PR triggered run which will build, run unit tests, deploy test resources and run live tests.
If you would like to see the product of a PR as a package on the dev feed, after thoroughly inspecting the change, create a branch in the main repo and manually trigger an azure - mcp pipeline run against that branch. This will queue a manually triggered run which will build, run unit tests, deploy test resources, run live tests, sign and publish the packages to the dev feed.
Instructions for consuming the package from the dev feed can be found in the "Extensions" tab of the pipeline run page.
Please see our support statement.
We're building this in the open. Your feedback is much appreciated, and will help us shape the future of the Azure MCP server.
👉 Open an issue in the public repository.
- Azure MCP Documentation
- Command Implementation Guide
- VS Code Insiders Download
- GitHub Copilot Documentation
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. By participating, you are expected to uphold this code.
By contributing, you agree that your contributions will be licensed under the project's license.