microsoft/mcp/add-azure-mcp-tools
Claude Code and agent skill by microsoft/mcp
- vendor
Checking that the SKILL.md file is still in the repository.
Add a new tool/command to any Azure MCP toolset. Full lifecycle from scaffolding through PR submission. USE WHEN: add new command, create tool, new MCP tool, scaffold command, implement operation, add azure service tool, create new toolset.
Install
npx vskill@latest install microsoft/mcp/add-azure-mcp-toolsSKILL.md
The same SKILL.md was published earlier as microsoft/mcp/add-azure-mcp-tools.
Add a New Tool to Azure MCP
Purpose
Step-by-step workflow for adding a new command to any Azure MCP toolset. Each phase has an explicit gate — do not proceed until the gate passes.
Decision: New Toolset or Existing?
Before starting, determine:
- Adding to existing toolset? → Skip to Phase 1.
- Creating a new toolset? → Complete Phase 0 first.
⚠️ CRITICAL: Does your command interact with Azure resources?
| Azure Service Commands | Non-Azure Commands | ||
|---|---|---|---|
| Examples | ACR Registry List, SQL Database List, Storage Account Get | CLI wrappers, Best Practices, Documentation tools | |
| test-resources.bicep | ✅ Required | ❌ Skip | |
| test-resources-post.ps1 | ✅ Required (even if basic) | ❌ Skip | |
| RBAC role assignments | ✅ Required | ❌ Skip | |
| Live tests | ✅ Required (recorded) | ❌ Skip | |
| Unit tests | ✅ Required | ✅ Required |
Security Requirements
Terminology note: In this repo, _tool_ refers to the MCP-exposed capability and _command_ refers to the underlying C# command class implementation. Both terms appear in the codebase and docs.
All tool inputs are untrusted. These requirements apply at every phase and are not optional.
Input Validation
- Validate inputs against the specific naming rules of the Azure resource being targeted (length, allowed characters, casing). Do not apply a generic blocklist — Azure resource naming rules vary significantly by service.
- Example: Storage account names are 3–24 lowercase alphanumeric characters only.
- Example: Resource group names allow letters, digits, underscores, hyphens, and periods up to 90 characters.
- Reference: Azure naming rules and restrictions
- Use
ValidateOptionsfor semantic constraints beyond required options (name length, format, mutual exclusivity, and allowed value sets). Only reject characters that are provably invalid for the specific resource type. See theValidateOptionsoverride guidance in Phase 1e. - Always add validation errors with
validationResult.AddError(message, telemetrySafeMessage). Do not add errors through theValidationResult.Errorsproperty; direct collection changes bypass telemetry-safe error tracking. See Telemetry-safe validation errors. - Prefer SDK/runtime validators and deterministic checks first (
Length, explicit allowed-value sets, character/category checks).
Secure Logging
- Never log raw option objects (
{@Options}) — they may contain secrets, connection strings, or PII. - Log only individually named, known-safe parameters. For example:
options.Subscription,options.ResourceGroup,Name. - Do not include sensitive field values in error messages returned to callers.
- Strip or redact secret values before surfacing exception details.
Safe Downstream Interactions
- Never concatenate user input directly without prior validation into URLs, shell commands, resource identifiers, query strings, etc.
- Use the existing
IAzureServicedependency or injectIEndpointValidatorfromMicrosoft.Mcp.Core.Helpersto guard endpoint usage — choose the method that matches your scenario: - Azure service data-plane endpoint (endpoint derived from a resource name, e.g. storage account, ACR, App Config): prefer
AzureService.ValidateAzureServiceEndpoint(endpoint: endpoint, serviceType: serviceType)before constructing the client. Code withoutIAzureServicemay injectIEndpointValidatorand callValidateAzureServiceEndpoint(endpoint, serviceType, armEnvironment)with the configured Azure cloud. The validator obtains the currently executing tool namespace fromICommandContextAccessor; callers must not supply or infer it. This enforces the correct per-cloud domain suffix (e.g..blob.core.windows.net/.blob.core.chinacloudapi.cn) and HTTPS. - User-supplied URL to a known external service (e.g. a GitHub URL the user provides): call
EndpointValidator.ValidateExternalUrl(url, allowedHosts)with an explicit allowlist of permitted hosts. - User-supplied target URL with no known domain (e.g. a load-test target the user controls): call
AzureService.ValidatePublicTargetUrl(url: url)or injectIEndpointValidatorand callValidatePublicTargetUrl(url). This enforces HTTP(S)-only schemes, rejects private/reserved IP ranges and hostnames, and resolves DNS to catch hostnames that map to internal IPs. The validator applies namespace-scoped emergency overrides from the ambient command context. - When a toolset directly injects
IEndpointValidator, register it withservices.AddEndpointValidation(). Reuse the host-owned validator and policy; do not construct a production validator or pass an executing namespace at tool boundaries. - For services that construct endpoints internally, use the cloud-type switch pattern (see Phase 1c: Service Implementation) and validate the completed endpoint before credential acquisition, client construction, or network use.
- Control-plane operations (ARM resource creation, RBAC assignments, policy etc.) do not need
EndpointValidatorbecause they go through the typed Azure SDK ARM client. Construct ARM resource IDs usingResourceIdentifieror collection helpers — never by string-interpolating subscription/resource-group/resource-name directly into a raw ARM path. - For new commands and services, always pass
CancellationTokenas the final parameter to all async downstream calls and propagate it throughout — never substituteCancellationToken.Noneordefaultat call sites. - Fail closed: if tenant, subscription, or resource context is ambiguous, return an explicit validation error and require the caller to specify the value. Do not silently pick a default.
Secure Resource Provisioning Defaults
Tools that create or create-or-update Azure resources must produce a secure configuration when the caller omits security-related options. Do not rely on an Azure service's current defaults. Explicitly set every supported security property in the typed SDK request model so a service-side default change cannot make the tool less secure.
- Disable public network access, public endpoints or IPs, and anonymous access by default where the service supports it. Do not add public connectivity merely to make a newly created resource immediately reachable.
- Require encrypted transport by default: enable HTTPS-only access, disable non-TLS endpoints or ports, and set the minimum TLS version to the service's current secure recommendation (at least TLS 1.2). A weaker transport setting requires an explicit opt-in.
- Prefer Managed Identity and RBAC for authentication. Enable a system-assigned identity or accept a user-assigned identity where supported, and disable local or key-based authentication when possible. For service-to-service access, do not make connection strings, account keys, or API keys the default path.
- For create-or-update operations, omitted security options must never weaken an existing resource. Apply secure defaults when creating a resource; when updating one, preserve its current security settings unless the caller explicitly requests a supported downgrade.
A tool may expose a less secure behavior for a legitimate compatibility or development scenario, but only as a deliberate caller choice:
- Use a narrowly scoped option whose name states the behavior, such as
--allow-public-network-access,--allow-http,--minimum-tls-version, or--enable-local-auth. Avoid ambiguous options such as--secure false. - Keep the secure behavior as the effective default when the option is omitted. Never infer consent to a downgrade from another option, selected SKU, or pre-existing dependency.
- State the secure default and the security consequence in the
[Option]description and command documentation. Validate allowed values and incompatible combinations before sending the request. - Do not accept, log, persist, or return connection strings or keys merely because local authentication was enabled. Follow the existing secret-handling requirements for any command that must handle them.
Add tests proving that an invocation without security options sends or creates the secure configuration. Add focused tests for each downgrade option and for create-or-update omission behavior; use a recorded live test to verify the resulting Azure resource state when practical.
MCP-Specific Threat Patterns
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 1 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/add-azure-mcp-tools/SKILL.md
Popularity
- Repository stars
- 3,724
- Repository forks
- 631
- 7-day trend score
- 41
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/mcp/add-azure-mcp-tools)