(GH-1696) Add --what-if in MCP server tools - #1697
Open
Gijs Reijn (Gijsreyn) wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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_ifrequest parameter handling forinvoke_dsc_resource(set/delete) andinvoke_dsc_config(setonly), mapping toExecutionKind::WhatIfand 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request adds --what-if support in MCP server tools.
PR Context
Fixes #1696