Skip to content

(GH-1696) Add --what-if in MCP server tools - #1697

Merged
Steve Lee (SteveL-MSFT) merged 1 commit into
PowerShell:mainfrom
Gijsreyn:gh-1696/main/add-mcp-server-whatif
Aug 31, 2026
Merged

(GH-1696) Add --what-if in MCP server tools#1697
Steve Lee (SteveL-MSFT) merged 1 commit into
PowerShell:mainfrom
Gijsreyn:gh-1696/main/add-mcp-server-whatif

Conversation

@Gijsreyn

Copy link
Copy Markdown
Collaborator

PR Summary

This pull request adds --what-if support in MCP server tools.

PR Context

Fixes #1696

Copilot AI lite review requested due to automatic review settings August 31, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds what_if (dry-run / preview) support to the DSC MCP server tools so AI agents can safely simulate set/delete operations via MCP, aligning server-mode behavior with the CLI’s what-if capability.

Changes:

  • Added what_if request parameter handling for invoke_dsc_resource (set/delete) and invoke_dsc_config (set only), mapping to ExecutionKind::WhatIf and returning invalid-params errors for unsupported operations.
  • Expanded Pester coverage for MCP server what-if scenarios, including native and synthetic what-if paths.
  • Updated i18n strings, docs, and changelog to document the new capability.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dsc/tests/dsc_server.tests.ps1 Adds end-to-end MCP server tests validating what-if behavior for config/resource set/delete and unsupported ops.
dsc/src/server/invoke_dsc_resource.rs Introduces what_if request argument; routes set/delete through ExecutionKind::WhatIf and returns appropriate delete result shapes.
dsc/src/server/invoke_dsc_config.rs Adds what_if request argument for config set by setting configurator context execution type to WhatIf.
dsc/locales/en-us.toml Adds localized error messages for invalid what_if usage.
docs/concepts/dsc-mcp-server.md Documents how agents can preview changes using what_if with MCP tools.
CHANGELOG.md Notes the new MCP what-if support under Unreleased “Added”.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SteveL-MSFT
Steve Lee (SteveL-MSFT) added this pull request to the merge queue Aug 31, 2026
Merged via the queue into PowerShell:main with commit 45b1007 Aug 31, 2026
20 checks passed
@Gijsreyn
Gijs Reijn (Gijsreyn) deleted the gh-1696/main/add-mcp-server-whatif branch September 1, 2026 00:01
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.

MCP server tools don't support what-if for set/delete operations

3 participants