Skip to content

Conversation

@lei9444
Copy link
Contributor

@lei9444 lei9444 commented Oct 22, 2025

Summary of the Pull Request

This PR adds a Model Context Protocol (MCP) server to PowerToys, enabling AI agents to control PowerToys functionality. The initial implementation exposes Awake module controls through MCP tools.

Awake Tools

  • Active Process Detection: Server detects if Awake is already running (PowerToys Runner or CLI)
  • Default Behavior (force=false):
    • If Awake process is active → Returns error with summary explaining current state
    • Summary includes message: "An Awake process is already running. Use force=true to override."
  • Force Override (force=true):
    • PowerToys Runner Mode: Directly updates settings.json to change configuration
    • CLI Mode: Kills existing CLI process and launches new one with updated parameters

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

  1. build
  2. code --add-mcp "{"name":"powertoys-mcp","command":"D:\work\PowerToys\x64\Debug\PowerToys.McpServer.exe","args":[]}"

@github-actions

This comment has been minimized.

@yeelam-gordon yeelam-gordon requested a review from Copilot October 22, 2025 10:20
Copy link
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

This PR introduces a new Model Context Protocol (MCP) server component to PowerToys, enabling AI agents to control PowerToys modules through the MCP specification. The implementation focuses on exposing Awake module functionality via MCP tools.

Key changes:

  • Adds a new PowerToys.McpServer console application using .NET 9 and the official ModelContextProtocol SDK
  • Implements MCP tools for the Awake module (status retrieval, passive/indefinite/timed modes)
  • Integrates the MCP server into the build system, installer, and packaging infrastructure
  • Adds supporting files for sparse MSIX package registration

Reviewed Changes

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

Show a summary per file
File Description
src/McpServer/PowerToys.McpServer.csproj New .NET 9 console project with MCP SDK dependencies
src/McpServer/Program.cs MCP server entry point with stdio transport configuration
src/McpServer/Tools/AwakeTools.cs MCP tool implementations for Awake module operations
src/McpServer/README.md Documentation for the MCP server architecture and usage
src/modules/mcp/McpServer/Tools/AwakeTools.cs Duplicate AwakeTools implementation in different location
src/PackageIdentity/AppxManifest.xml Registers MCP server as Windows app extension
src/PackageIdentity/Assets/mcpServerConfig.json MCP server configuration for discovery
src/PackageIdentity/BuildSparsePackage.ps1 Updated packaging script to include Assets folder
src/PackageIdentity/PackageIdentity.vcxproj Build configuration changes for sparse package
src/common/GPOWrapperProjection/GPOWrapper.cs Stub GPO method for MCP (returns NotConfigured)
PowerToys.sln Adds McpServer project to solution
Directory.Packages.props Adds ModelContextProtocol package reference
tools/Verification scripts/verify-installation-script.ps1 Adds MCP server to core files verification
tools/BugReportTool/BugReportTool/ProcessesList.cpp Adds MCP server to bug report process list
installer/PowerToysSetupCustomActionsVNext/CustomAction.cpp Adds MCP server to installer termination list

@lei9444 lei9444 changed the title Leilzh/mcp Initial implementation of MCP Server and Awake tools Oct 23, 2025
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.

2 participants