mcp
Copilot instructions3.7k starsChanged 3 months agoMITView on GitHub
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…
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-azure-mcp-toolsSkill
- agentic-workflowsSkill
- harden-tool-url-inputsSkill
- mcp-code-reviewerSkill
- resilience-management-operationsSkill
- azurebackup-add-toolSkill
- azurebackup-telemetry-reportSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
24 rules. About 0 are common, 12 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Always use primary constructors in C#
- Distinctive: line 4
Always run dotnet build after making a change
- Distinctive: line 5
Always use System.Text.Json over Newtonsoft
- Distinctive: line 6
Always put new classes and interfaces in separate files
- Distinctive: line 7
Always make members static if they can be
- Distinctive: line 8
All generated code needs to be AOT safe
- Very specific: line 9
Never expose RetryPolicyOptions through tool options or service contracts.
- Distinctive: line 10
Always review your own code for consistency, maintainability, and testability
- Distinctive: line 11
Always ask for clarifications if the request is ambiguous or lacks sufficient context.
- Very specific: line 15
Use ./eng/scripts/Build-Local.ps1 -VerifyNpx to verify changes to powershell, c# project files and npm packages
- Very specific: line 16
Don't run local builds to check pipeline YAML files (e.g., files in eng/pipelines/ with .yml extension)
- Distinctive: line 20
Ensure all tests pass
- Distinctive: line 21
Follow the contribution guidelines
- Distinctive: line 24
Update CHANGELOG.md with your changes
- Very specific: line 26
Create the auto-generated PR body as normal, but copilot should add an additional section after all of its regular PR body content.
- Very specific: line 35
Always convert tool services to inject IHttpClientFactory into its clients and use IHttpClientFactory.CreateClient method to instantiate …
- Very specific: line 36
If IHttpClientFactory is already injected into the client, ensure that IHttpClientFactory.CreateClient is used to instantiate the …
- Very specific: line 37
Always re-parent test classes parented by CommandTestsBase to RecordedCommandTestsBase.
- Very specific: line 39
Always generate a new assets.json file alongside the livetest csproj file if one does not exist.
- Distinctive: line 54
When reviewing PRs that add or modify MCP tools, cross-reference the pre-merge checklist and check the following repository-specific …
- Very specific: line 56
consolidated-tools.json: If a tool is renamed or removed, servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json must be updated. - Very specific: line 57
e2eTestPrompts.md: If a tool is added or modified, servers/Azure.Mcp.Server/docs/e2eTestPrompts.md must include prompts for it. - Very specific: line 58
azmcp-commands.md: If a tool is added, modified, or removed, servers/Azure.Mcp.Server/docs/azmcp-commands.md must be updated. - Very specific: line 59
ToolDescriptionEvaluator: If tool descriptions are added or changed, the PR description must confirm a ToolDescriptionEvaluator score of at …
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Coding Instructions for GitHub Copilot
- 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.
Engineering System
- 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)
Pull Request Guidelines
- 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.
Transitioning Live Tests to Recorded Tests
- 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:{ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "", "TagPrefix": "<TestCsProjFileNameWithoutExtension>", // e.g., "Azure.Mcp.Tools.KeyVault.Tests" "Tag": "" } - Copilot should utilize the recorded test documentation in
docs/recorded-tests.mdfor more details on how to convert and validate recorded tests.
Code Review Guidelines
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: 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

