Skip to content

Add CI test to validate Azure MCP tool names in skill markdown files#1709

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-ci-test-for-azure-mcp-tools
Open

Add CI test to validate Azure MCP tool names in skill markdown files#1709
Copilot wants to merge 4 commits intomainfrom
copilot/add-ci-test-for-azure-mcp-tools

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

Skill markdown files reference Azure MCP tools by name, but there was no automated check to catch stale or mistyped tool names that don't match what the server actually exposes.

Changes

  • New test tests/skills-validation/mcp-tool-names.test.ts — unit test that runs as part of the existing test:unit suite (picked up by the test-all-skills.yml CI workflow). It:

    • Spawns @azure/mcp@latest and queries the live tool list via JSON-RPC tools/list
    • Recursively scans all .md files under plugin/skills/ for two naming conventions:
      • mcp_azure_mcp_<tool> (GitHub Copilot MCP tool reference format)
      • azure__<tool> (alternative format)
    • Fails with file path + line number diagnostics for every invalid tool name found
  • Bug fixes in 9 MD files — discovered by the new test: mcp_azure_mcp_get_bestpractices is not a real tool; the correct name is mcp_azure_mcp_get_azure_bestpractices. Fixed across azure-upgrade, azure-cloud-migrate, and azure-prepare skill reference files.

Failure output example

When a file references a non-existent tool, the test produces:

● all Azure MCP tool names referenced in skill markdown files are valid

  expect(received).toHaveLength(0)

  Received:
    ["azure-upgrade/SKILL.md:28 — "get_bestpractices" is not a valid Azure MCP tool name",
     ...]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • centralus-2.in.applicationinsights.azure.com
    • Triggering command: /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp server start (dns block)
    • Triggering command: /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp server start grep -l t_bestpractices ure/plugin/skills/azure-compliance/references/azure-quick-review.md ure/tests/node_modules/.bin/sh t_bestpractices otnet.md rgo/bin/grep grep -l overage b-Copilot-for-Azure/plugin/skills/azure-deploy/references/recipes/cicd/verify.md ep t_bestpractices nces/ptu-guide.m-c k/_temp/ghcca-no&#34;jest&#34; &#39;--testPathIgnorePatterns=node_modules|_template|integration&#39; grep (dns block)
    • Triggering command: /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp server start grep ure/�� t_bestpractices b-Copilot-for-Azure/plugin/skills/azure-deploy/references/recipes/terraform/errors.md de/node/bin/grep t_bestpractices md ndor/bin/grep grep ure/�� d .md modules/@npmcli/run-script/lib/node-gyp-bin/npx t_bestpractices d grep grep (dns block)
  • westus-0.in.applicationinsights.azure.com
    • Triggering command: /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp server start (dns block)
    • Triggering command: /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp server start grep -l t_bestpractices ure/plugin/skills/azure-compliance/references/azure-quick-review.md ure/tests/node_modules/.bin/sh t_bestpractices otnet.md rgo/bin/grep grep -l overage b-Copilot-for-Azure/plugin/skills/azure-deploy/references/recipes/cicd/verify.md ep t_bestpractices nces/ptu-guide.m-c k/_temp/ghcca-no&#34;jest&#34; &#39;--testPathIgnorePatterns=node_modules|_template|integration&#39; grep (dns block)
    • Triggering command: /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp /home/REDACTED/.npm/_npx/541454632b79112e/node_modules/@azure/mcp-linux-x64/dist/azmcp server start grep ure/�� t_bestpractices b-Copilot-for-Azure/plugin/skills/azure-deploy/references/recipes/terraform/errors.md de/node/bin/grep t_bestpractices md ndor/bin/grep grep ure/�� d .md modules/@npmcli/run-script/lib/node-gyp-bin/npx t_bestpractices d grep grep (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add CI tests for validating Azure MCP tool names in markdown files Add CI test to validate Azure MCP tool names in skill markdown files Apr 3, 2026
Copilot AI requested a review from kvenkatrajan April 3, 2026 21:55
@kvenkatrajan kvenkatrajan marked this pull request as ready for review April 3, 2026 21:59
Copilot AI review requested due to automatic review settings April 3, 2026 21:59
@kvenkatrajan
Copy link
Copy Markdown
Collaborator

@copilot - bump the version on 'azure-cloud-migrate' , 'azure-prepare', 'azure-upgrade' skills

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 3, 2026

@copilot - bump the version on 'azure-cloud-migrate' , 'azure-prepare', 'azure-upgrade' skills

Done in commit 243a564. Bumped versions for the three modified skills:

  • azure-cloud-migrate: 1.0.1 → 1.0.2
  • azure-prepare: 1.1.6 → 1.1.7
  • azure-upgrade: 1.0.0 → 1.0.1

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated validation to ensure Azure MCP tool names referenced in skill markdown stay in sync with the tools actually exposed by @azure/mcp, and fixes existing stale tool references found by that validation.

Changes:

  • Add a new unit test that boots @azure/mcp and validates referenced Azure MCP tool names across plugin/skills/**/*.md.
  • Fix stale tool references (get_bestpracticesget_azure_bestpractices) across affected skill docs.
  • Update azure-upgrade and azure-cloud-migrate SKILL tool lists/usages to the corrected tool name.
Show a summary per file
File Description
tests/skills-validation/mcp-tool-names.test.ts New unit test that queries Azure MCP tools/list and validates tool references in skill markdown.
plugin/skills/azure-upgrade/SKILL.md Fixes Azure MCP best-practices tool name in rules/tool table.
plugin/skills/azure-upgrade/references/services/functions/assessment.md Fixes best-practices tool reference in tip.
plugin/skills/azure-upgrade/references/global-rules.md Fixes best-practices tool reference in global rules.
plugin/skills/azure-prepare/references/recipes/terraform/README.md Fixes best-practices tool reference in Terraform recipe table.
plugin/skills/azure-prepare/references/recipes/azcli/README.md Fixes best-practices tool reference in Azure CLI recipe table.
plugin/skills/azure-cloud-migrate/SKILL.md Fixes Azure MCP best-practices tool name in rules.
plugin/skills/azure-cloud-migrate/references/services/functions/global-rules.md Fixes best-practices tool reference in rules.
plugin/skills/azure-cloud-migrate/references/services/functions/code-migration.md Fixes best-practices tool reference in prerequisites/steps.
plugin/skills/azure-cloud-migrate/references/services/functions/assessment.md Fixes best-practices tool reference in tip.

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 3

Comment on lines +133 to +136
serverProcess.on("close", () => clearTimeout(timeoutHandle));

// Unref the child process so it doesn't prevent the Jest worker from exiting
serverProcess.unref();
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the npx @azure/mcp@latest server start process exits early (e.g., download failure, missing runtime), this promise currently waits until the 110s timeout before failing, which slows CI and hides the underlying exit reason. Consider capturing stderr/stdout and rejecting immediately in the close handler when the process exits before a tools/list response is received (include exit code/signal and last stderr lines for diagnostics).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 26d67d8. The close handler now rejects immediately when the process exits before a tools/list response is received, including the exit code, signal, and last 20 lines of stderr. A settled flag guards all paths (success, error event, timeout, and early close) against double-resolution.

@kvenkatrajan
Copy link
Copy Markdown
Collaborator

Fixes #778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR CI tests for ensuring that the tool names in md file reflect actual Azure MCP server tools

3 participants