- Always use primary constructors in C#
- Always run dotnet build after making a change
- Always use System.Text.Json over Newtonsoft
- Always put new classes and interfaces in separate files
- Always make members static if they can be
- All generated code needs to be AOT safe
- Never expose
RetryPolicyOptionsthrough tool options or service contracts; use Azure SDK retry defaults - Always review your own code for consistency, maintainability, and testability
- Always ask for clarifications if the request is ambiguous or lacks sufficient context.
- Use
./eng/scripts/Build-Local.ps1 -VerifyNpxto verify changes to powershell, c# project files and npm packages - Don't run local builds to check pipeline YAML files (e.g., files in
eng/pipelines/with.ymlextension)
- Ensure all tests pass
- Follow the contribution guidelines
- Include appropriate documentation
- Include tests that cover your changes
- Update CHANGELOG.md with your changes
- Run
.\eng\common\spelling\Invoke-Cspell.ps1 - Create the auto-generated PR body as normal, but
copilotshould add an additional section after all of its regular PR body content. The contents should be:## Invoking Livetests Copilot submitted PRs are not trustworthy by default. Users with `write` access to the repo need to validate the contents of this PR before leaving a comment with the text `/azp run mcp - pullrequest - live`. This will trigger the necessary livetest workflows to complete required validation.
- Always convert
toolservices to injectIHttpClientFactoryinto its clients and useIHttpClientFactory.CreateClientmethod to instantiate theHttpClientfor usage in the tool classes' methods.- If
IHttpClientFactoryis already injected into the client, ensure thatIHttpClientFactory.CreateClientis used to instantiate theHttpClient. If this is done, then no further action is needed.
- If
- Always re-parent test classes parented by
CommandTestsBasetoRecordedCommandTestsBase. This will require minor fixture adjustments. - In test classes extending
RecordedCommandTestsBase, every test for aLocalRequired = truetool must callAssertLocalToolIsUnavailableInHttpMode(toolName)and return early when it returnstrue. This verifies that remote HTTP mode does not expose the local-only tool. - Always generate a new
assets.jsonfile alongside the livetest csproj file if one does not exist. This file should contain the following content: - Copilot should utilize the recorded test documentation in
docs/recorded-tests.mdfor more details on how to convert and validate recorded tests.
When reviewing a pull request, use the mcp-code-reviewer skill. In interactive IDE and CLI sessions, return draft findings for human approval before posting them. In GitHub Copilot Code Review, post qualified inline comments directly as a comment-only review. Keep the review read-only: never modify code or the branch, approve or request changes, resolve threads, or invoke an agent to implement changes.
When reviewing PRs that add or modify MCP tools, cross-reference the pre-merge checklist and check the following repository-specific completeness requirements:
consolidated-tools.json: If a tool is renamed or removed,servers/Azure.Mcp.Server/src/Resources/consolidated-tools.jsonmust be updated. Flag a tool rename when this file is not in the diff.e2eTestPrompts.md: If a tool is added or modified,servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdmust include prompts for it. Flag a diff that removes all prompts for a tool that remains registered, or that adds a tool without corresponding prompts.azmcp-commands.md: If a tool is added, modified, or removed,servers/Azure.Mcp.Server/docs/azmcp-commands.mdmust be updated. Flag command registration changes when this file is not in the diff.- ToolDescriptionEvaluator (excluding Fabric MCP tools): If tool descriptions are added or changed, the PR description must confirm a ToolDescriptionEvaluator score of at least
0.4. Flag new tool descriptions when the PR body does not mention the score. - TreatWarningsAsErrors: This repository sets
TreatWarningsAsErrors=true. Anasyncmethod with noawaitproduces CS1998 and fails the build. Report these findings as build breaks, not style suggestions. - Changelog entries: Entries under
servers/Azure.Mcp.Server/changelog-entries/must conform to the YAML schema indocs/changelog-entries.md. Require a non-emptychangesarray whose entries contain a validsectionand adescription;prandsubsectionare optional. Check schema conformance, and do not apply generic prose style suggestions to changelog entry files.

{ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "", "TagPrefix": "<TestCsProjFileNameWithoutExtension>", // e.g., "Azure.Mcp.Tools.KeyVault.Tests" "Tag": "" }