-
Notifications
You must be signed in to change notification settings - Fork 50
Enable initial DSC MCP Server support #1092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables DSC (Desired State Configuration) to function as an MCP (Model Context Protocol) server, providing tools for interacting with DSC resources programmatically. The implementation adds the initial list_resources
tool that allows MCP clients to enumerate available DSC resources.
- Added MCP server functionality with initialization and tool handling capabilities
- Implemented
list_resources
tool for enumerating DSC resources via MCP protocol - Modified core functions to support async operation patterns required by MCP
Reviewed Changes
Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
dsc/src/main.rs | Added MCP subcommand and async main function |
dsc/src/args.rs | Added MCP command line argument |
dsc/src/mcp/mod.rs | Core MCP server implementation with initialization logic |
dsc/src/mcp/list_resources.rs | Implementation of list_resources MCP tool |
dsc/src/subcommand.rs | Made list_resources function public for MCP usage |
dsc_lib/src/dscresources/command_resource.rs | Converted invoke_command to async function |
dsc_lib/src/discovery/command_discovery.rs | Added serialization traits to ImportedManifest |
dsc/Cargo.toml | Added MCP and async runtime dependencies |
dsc_lib/Cargo.toml | Updated tokio configuration for targeted feature usage |
dsc/tests/dsc_mcp.tests.ps1 | Added comprehensive MCP server integration tests |
dsc/locales/en-us.toml | Added localization strings for MCP functionality |
dsc_lib/locales/en-us.toml | Added error message for process execution failures |
dsc/src/util.rs | Added MCP-specific exit code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I'm here, leaving my thoughts on a find_dsc_resource
tool. My expectations are:
- There will be a very large number of DSC resources eventually
- The context window will not be able to accommodate all of the information about every DSC resource
The general flow of the tool would be:
- Takes in a string
user_query
that is intended to be a distillation of the user request. - Server uses sampling to request a list of keywords to use when searching.
- Server filters resources based on given keywords.
- Server uses sampling to have model choose the best resource from the results of 3.
- Server responds with resource information sufficient for agent to use
invoke_dsc_resource
tool (includes capabilities and schema).
@SteveL-MSFT forgot to ask during the community call, but will this be just as simple to invoke as the Bicep experimental MCP server? Would love to see it in VSCode, or instructions how to enable it. |
@JohnMcPMS add your thoughts here #1093 on MCP strategy for DSC |
@Gijsreyn to play with this, see https://code.visualstudio.com/docs/copilot/customization/mcp-servers on how to add MCP servers to VSCode. This one is simply executed as |
PR Summary
Enable DSC to be MCP Server. First tool is
list_resources