Skip to content

feat(agents): Use Azure MCP azureterraform for Terraform lookup - #760

Merged
jonathan-vella merged 6 commits into
test/azure-mcp-3-e2efrom
feat/terraform-avm-mcp-lookup
Oct 13, 2026
Merged

jonathan-vella merged 6 commits into
test/azure-mcp-3-e2efrom
feat/terraform-avm-mcp-lookup

Conversation

@jonathan-vella

@jonathan-vella jonathan-vella commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Description

Point the Terraform planner and CodeGen agents and the shared references at the Azure MCP azureterraform
commands (avm versions, avm get, azurerm get, azapi get) for module versions, READMEs and provider docs.
The Registry API remains the fallback. The AVM module index, cache and validators are unchanged and stay
authoritative for module existence, lifecycle and resource-type mapping.

Depends on #759 (the @azure/mcp 3.0.0 pin). All four APEX PRs target test/azure-mcp-3-e2e (not main) for end-to-end testing; merge #759 first, because this branch includes its commits.

Type of Change

  • 🤖 Agent definition update (.github/agents/)
  • 💰 MCP integration enhancement

Token / latency impact

  • NO (net line count unchanged in 05-iac-planner, which sits at its body cap)

Changes Made

  • 05-iac-planner.agent.md, 06t-terraform-codegen.agent.md: MCP lookup with Registry fallback
  • apex-azure-defaults/references/avm-modules.md, terraform-conventions.md, apex-iac-common/references/avm-module-index.md,
    avm-version-freeze-gate.md, apex-terraform-patterns/SKILL.md, iac-terraform-best-practices.instructions.md
  • Only a documented module-not-found for the exact module name counts as unpublished; any other lookup error is a verification failure

Validation

  • validate:agents, validate:agent-registry, build:explorer-graph, validate:explorer-graph, validate:skills, lint:md and the post-write test pass
  • Probed @azure/mcp@3.0.0 live: avm list (158 modules; fields moduleName, description, source, repoUrl, moduleType; no lifecycle),
    avm versions (versions match the Terraform registry; avm-res-keyvault-vault 0.12.0), avm get, azurerm get, azapi get.
  • Unpublished or unknown module: avm versions returns status: 400, ArgumentException, "not found in available modules"
    (identical for a Proposed, nonexistent and malformed name). Documented as the only "unpublished" signal.
  • Gotchas documented: azurerm get returns 200 with empty arguments for an unknown type; avm get on an unknown version returns 422.
  • Trim: removed apex-terraform-patterns/references/avm-authoring-requirements.md (218 lines of AVM-author certification
    rules that APEX never uses; only the skill table referenced it). avm-provider-compatibility.md stays, since the tools
    return READMEs, not module provider constraints.
  • Docs: apex-docs#35

3.0.0 rejects unknown tool parameters, so align the three call sites that used
names absent from the 3.0.0 schema (policy, applens, monitor log query), then
move the pin in both configure-mcp.mjs and .vscode/mcp.json so the release
check reports CURRENT. The 3.0.0 schema was checked against the published
command reference; a live tools list was not possible in this environment.
Point the planner, Terraform CodeGen and the shared references at the Azure MCP
azureterraform commands (avm versions, avm get, azurerm get, azapi get) for
module versions, READMEs and provider docs, with the Registry API as fallback.
The AVM module index and cache stay authoritative for module existence,
lifecycle and resource-type mapping, and the validators are unchanged.

Only a documented module-not-found for the exact module name counts as
unpublished; any other lookup error is a verification failure. The tool output
shapes were taken from the published 3.0.0 command reference and not yet
probed at runtime.
The live 3.0.0 tools list no longer includes extension azqr unless azqr 3.0.0 or
later is installed locally, while 2.0.5 listed it unconditionally. Document the
prerequisite and the direct CLI fallback.
Probed against @azure/mcp 3.0.0: avm versions returns status 400 with an
ArgumentException "not found in available modules" for an unpublished,
nonexistent or malformed name; avm get returns 422 for an unknown version; and
azurerm get returns 200 with empty arguments for an unknown resource type.
Document these so agents only treat the first as "unpublished".
The 218-line AVM certification checklist targets authors of AVM modules, which
APEX never writes; it only consumes them. Nothing but the skill's own table and
index referenced it, and the public AVM specification remains the source. Keep
the provider compatibility matrix, which the azureterraform tools cannot supply.
@jonathan-vella
jonathan-vella changed the base branch from chore/bump-azure-mcp-3.0.0 to test/azure-mcp-3-e2e October 13, 2026 11:12
@jonathan-vella
jonathan-vella merged commit 1d2b47b into test/azure-mcp-3-e2e Oct 13, 2026
2 checks passed
@jonathan-vella
jonathan-vella deleted the feat/terraform-avm-mcp-lookup branch October 13, 2026 17:57
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.

1 participant