azsdk-samples-mcp
AGENTS.md0 starsChanged 9 months agoMITView on GitHub
This document provides guidance for agents working on the azsdk-samples-mcp repository. This repository contains a Model Context Protocol (MCP) server built in C# that provides tools for discovering and retrieving samples from Azure SDK dependencies. It also includes Rust utilities for testing. Use the year when the source file was created. Test source files and classes should end in "Tests", with the base name matching the class being tested: Use MSTest 4.0 assertions and patterns for all tests. Build the…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- check-spellingSkill
- lint-markdownSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
23 rules. About 1 is common, 17 are distinctive, and 5 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Use .NET style guide conventions.
- Very specific: line 32
Ensure all code follows project formatting standards by running dotnet format --severity warn.
- Very specific: line 34
Use structured logging with ILogger instead of Console.WriteLine.
- Very specific: line 36
All components should inject and use ILoggerFactory for logging.
- Distinctive: line 37
All C# source files must include a copyright header:
- Distinctive: line 44
Use the year when the source file was created.
- Distinctive: line 48
Test source files and classes should end in "Tests", with the base name matching the class being tested:
- Distinctive: line 54
Use MSTest 4.0 assertions and patterns for all tests.
- Distinctive: line 79
Run unit tests from the repository root:
- Distinctive: line 91
Run linting checks at these key times during development:
- Distinctive: line 93
Early: After adding new code with technical terms, library names, or identifiers
- Distinctive: line 94
During development: After creating or modifying markdown documentation
- Very specific: line 95
Before first commit: Before running report_progress for the first time
- Distinctive: line 104
When both a repository skill and a plugin skill could handle the same task, always prefer the repository skill over the plugin skill.
- Distinctive: line 108
Before committing changes, run:
- Very specific: line 114
If dotnet format cannot fix remaining issues, manually address them according to the error messages.
- Distinctive: line 124
Test the MCP server using the .NET sample utility, which downloads a blob from Azure Blob Storage.
- Common: line 129
Test the MCP server using the Rust sample utility, which lists secrets from an Azure Key Vault.
- Distinctive: line 134
Test the MCP server using the TypeScript sample utility, which lists configuration values from Azure App Configuration.
- Distinctive: line 147
Follow the prompts to select subscription, location, and other parameters.
- Distinctive: line 167
Before creating a commit or pull request, verify all quality checks have passed.
- Distinctive: line 172
Run both linting skills listed in Skills.
- Distinctive: line 176
All checks must pass before committing.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
Agent Instructions
This document provides guidance for agents working on the azsdk-samples-mcp repository.
Repository Overview
This repository contains a Model Context Protocol (MCP) server built in C# that provides tools for discovering and retrieving samples from Azure SDK dependencies. It also includes Rust utilities for testing.
Repository Structure
├── src/AzureSdk.SamplesMcp/ # Main MCP server (.NET)
│ ├── Tools.cs # MCP tool definitions (dependencies, samples)
│ ├── Providers/ # Dependency provider implementations
│ │ └── Cargo.cs # Rust Cargo provider
│ ├── Services/ # Service utilities
│ │ └── Command.cs # Command execution utility
│ ├── FileSystem.cs # File system abstraction
│ ├── Environment.cs # Environment variable access
│ ├── Program.cs # Application entry point
│ └── AzureSdk.SamplesMcp.csproj # Project file
├── tests/AzureSdk.SamplesMcp.Test/ # Unit tests (.NET)
├── samples/list-secrets/ # Rust sample utility
│ ├── src/main.rs # Secrets sample using Azure SDK
│ └── Cargo.toml # Rust project manifest
└── .github/workflows/ # CI/CD workflowsStyle Guidelines
- Use .NET style guide conventions.
- Ensure all code follows project formatting standards by running
dotnet format --severity warn. - Fix any formatting issues that the formatter reports but cannot automatically correct.
- Use structured logging with
ILoggerinstead ofConsole.WriteLine. - Logging must be configured in
Program.csonly. - All components should inject and use
ILoggerFactoryfor logging. All C# source files must include a copyright header:
// Copyright {Year} Heath Stewart. // Licensed under the MIT License. See LICENSE.txt in the project root for license information.Use the year when the source file was created.
Test Naming
Test source files and classes should end in "Tests", with the base name matching the class being tested:
- File:
FileSystemTests.cs - Class:
FileSystemTests - Tests for:
FileSystem
Use MSTest 4.0 assertions and patterns for all tests.
Logging Example
ILogger logger = context.Services!.GetRequiredService<ILoggerFactory>()
.CreateLogger("ToolName");
logger.LogDebug("Debug message {}", param);
logger.LogInformation("Info message {}", param);Development Commands
Building
Build the main MCP server from the repository root:
dotnet buildThis builds both src/AzureSdk.SamplesMcp and the tests in tests/AzureSdk.SamplesMcp.Test.
Testing
Run unit tests from the repository root:
dotnet testLinting
ALWAYS use the repository skills for linting. Do not run linting commands directly.
When to Run Linting
Run linting checks at these key times during development:
- Early: After adding new code with technical terms, library names, or identifiers
- During development: After creating or modifying markdown documentation
- Before first commit: Before running
report_progressfor the first time - Throughout: Whenever you add new words that might be flagged as misspellings
- Final check: As part of the pre-commit checklist
Skills
- check-spelling: Check and fix spelling in project source files using cSpell
- lint-markdown: Check and fix formatting and other issues in markdown files using markdownlint-cli2
When both a repository skill and a plugin skill could handle the same task, always prefer the repository skill over the plugin skill.
Formatting
Before committing changes, run:
dotnet format --severity warnIf dotnet format cannot fix remaining issues, manually address them according to the error messages. The analyzer in the CI pipeline verifies formatting.
Samples and Provisioning
Provisioning Azure Resources
To provision Azure resources for testing the samples, see infra/README.md for instructions on deploying Storage, App Configuration, and Key Vault resources using Azure Developer CLI.
MCP Server with .NET
Test the MCP server using the .NET sample utility, which downloads a blob from Azure Blob Storage. See samples/download-blob/README.md for details on how to build and run the sample.
MCP Server with Rust
Test the MCP server using the Rust sample utility, which lists secrets from an Azure Key Vault. See samples/list-secrets/README.md for details on how to build and run the sample.
MCP Server with TypeScript
Test the MCP server using the TypeScript sample utility, which lists configuration values from Azure App Configuration. See samples/list-appconfig/README.md for details on how to build and run the sample.
Running All Samples
To run all samples with provisioned resources:
Provision Azure resources interactively:
azd provisionFollow the prompts to select subscription, location, and other parameters.
- Process all samples' comment prompts using the MCP server configured in your AI assistant. For each sample, use the comment at the top of the source file as a prompt to implement the functionality using Azure SDK samples.
Run all the samples using the provisioned resources:
# .NET sample dotnet run --project samples/download-blob/download-blob.csproj -- $(azd env get-value AZURE_STORAGE_BLOB_URL) # Rust sample cargo run --manifest-path samples/list-secrets/Cargo.toml -- $(azd env get-value AZURE_KEYVAULT_ENDPOINT) # TypeScript sample (build first) cd samples/list-appconfig && npm run build npm exec list-appconfig -- $(azd env get-value AZURE_APPCONFIG_ENDPOINT)
Pre-commit Checklist
Before creating a commit or pull request, verify all quality checks have passed.
This is a final verification. Linting should already be run during development (see Linting).
- Complete Formatting.
- Run both linting skills listed in Skills.
- Complete Building.
- Complete Testing.
All checks must pass before committing.
Commits and Pull Requests
See .github/instructions/commits.instructions.md for commit message and pull request guidelines.
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.

