Accelerate learning WinGet with MCP integration

Learn to accelerate your WinGet learning with hands-on MCP integration

Accelerate learning WinGet with MCP integration

WinGet (Windows Package Manager) now exposes a Model Context Protocol (MCP) server. Tools like VS Code and GitHub Copilot can query, search for, and install packages interactively. Instead of memorizing command switches, you can explore packages conversationally, then copy the exact underlying winget commands or requests for it.

This quick how-to guide shows you how to enable and use the WinGet MCP server inside VS Code to:

  • Discover available packages.
  • Inspect metadata and installer details.
  • Install or upgrade software directly.
  • Generate raw commands for scripting

Prerequisites

If you want to follow along, make sure you have:

  • VS Code v1.105.1 or higher.
  • GitHub Copilot enabled in VS Code.
  • WinGet preview v.12.170-preview or above.
💡
If you need the WinGet preview version, you can use the Repair-WinGetPackageManager command with the -IncludePrerelease switch parameter.

To verify if winget mcp exist, run:

winget --help | Select-String -Pattern mcp

If MCP appears, you're good to go.

How WinGet MCP integration works in VS Code

The WinGet MCP server is started as a stdio process (WindowsPackageManagerMCPServer.exe) which:

  1. Register the tools (e.g. find-winget-packages or install-winget-package).
  2. Declares capabilities to the client (VS Code / Copilot).
  3. Speaks JSON-RPC over stdin/stdout.

A plain, simplified request to list tools looks like:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

Behind the scenes, VS Code handles this for you. You only interact via natural language queries (e.g., "Search for a fast code editor), and Copilot maps those to tool invocations.

Here's a complete diagram of what happens behind the scenes:

Manually starting WinGet MCP server

Before you actually move directly to VS Code, taking the time to learn MCP pays off later.

You can experiment outside VS Code by running a couple of PowerShell commands in sequence. First, you start by running the WinGet MCP server:

$psi = [System.Diagnostics.ProcessStartInfo]::new()
$psi.FileName = "WindowsPackageManagerMCPServer.exe"
$psi.RedirectStandardInput = $true
$psi.RedirectStandardOutput = $true
$psi.RedirectStandardError = $true
$proc = [System.Diagnostics.Process]::Start($psi)

Below is a minimal PowerShell helper function to send initialize and then list out the available tools to the running WinGet MCP server process you just started:

# 1. Initialize session
$init = @{
  jsonrpc = '2.0'
  id = 1
  method = 'initialize'
  params = @{
    protocolVersion = '2024-11-05'
    capabilities    = @{ tools = @{} }
    clientInfo      = @{ name='ManualWinGetClient'; version='0.1.0' }
  }
}
$response = Send-McpRequest -Process $proc -Payload $init
Write-Host "Initialized: $($response.result.serverInfo.name)" -ForegroundColor Green

# 2. Notify initialized
$notify = @{ jsonrpc = '2.0'; method = 'notifications/initialized' }
Send-McpRequest -Process $proc -Payload $notify -Notify

# 3. List available tools
$listTools = @{ jsonrpc='2.0'; id=2; method='tools/list'; params=@{} }
$toolsResponse = Send-McpRequest -Process $proc -Payload $listTools

In the $toolsResponse variable, you can list out the available tools:

$toolsResponse.result.tools

# Output
name        : install-winget-package
title       : Install WinGet Package
description : Install or update a package using WinGet
inputSchema : @{type=object; properties=; required=System.Object[]}
annotations : @{title=Install WinGet Package; destructiveHint=True; idempotentHint=False; openWorldHint=False;
              readOnlyHint=False}

name        : find-winget-packages
title       : Find WinGet Packages
description : Find installed and available packages using WinGet
inputSchema : @{type=object; properties=; required=System.Object[]}
annotations : @{title=Find WinGet Packages; openWorldHint=False; readOnlyHint=True}

Understanding why we sent those specific messages in that order clarifies the MCP contract (which is hidden when you use VS Code):

  1. Initialize: Establishes the protocol version, exchange capabilities, and gives the server a chance to prepare internal tool metadata.
  2. Notify (initialized): A signal sent to the server indicating that the client has finished its initialization and is ready for normal traffic.
  3. Tools/list: Enumerates the tools currently exposed by the MCP server.

Enable WinGet MCP Server in VS Code

Now that you know how to start it manually, it's time to work through the steps by adding it in VS Code:

  1. Open the Command Palette (Ctrl+Shift+P).
  2. Run: "MCP: Add Server...
  3. Choose "Command (stdio)
  4. Run the winget mcp command and grab the command for the "Enter command"
  5. Name it: winget-mcp
  6. Add to workspace

The created .vscode/mcp.json in your workspace should look something like:

{
	"servers": {
		"winget-mcp": {
			"type": "stdio",
			"command": "C:\\Users\\<username>\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\WindowsPackageManagerMCPServer.exe",
			"args": []
		}
	},
	"inputs": []
}

You can now open Copilot Chat, click the toolbox icon, and see the WinGet tools available to you:

Asking questions and exploring packages

VS Code and CoPilot are configured with the required tools. You can now start asking questions like:

  • "Is PowerShell installed on my system using WinGet?"
  • "Show me metadata for PowerShell"
  • "Upgrade PowerShell using WinGet".

If the tool output is summarized, ask questions: "Reveal the underlying command you ran" or "Show me the raw WinGet command". The assistant will surface something like:

Metadata snapshot for PowerShell via WinGet MCP (combined Store + Winget source):

Installed package (Microsoft Store):

Name: PowerShell
Identifier (Store): 9MZ1SNWT0N5D
Source: msstore
Installed Version: 7.5.3.0
Update Available: No (isUpdateAvailable = false)
Installed: Yes
Winget repository package (not currently installed):

Name: PowerShell
Identifier (Winget): Microsoft.PowerShell
Source: winget
Installed: No

Installing a package via MCP

The MCP server can assist you with installing or upgrading a package. Ask, for example:

"Install Visual Studio Code Insiders using WinGet and the source also as WinGet. Before doing so, show me the actual command and let me approve it before executing.".

The response may vary on your system, but this was the rough output:

You can then either tell Copilot chat to install it for you or grab the literal command and execute it yourself.

Advanced usage patterns

Here are a couple of advanced usage patterns you can use to accelerate your learning.

Filter by tag or moniker

"Search for packages tagged 'terminal'".

Compare versions

"Show me installed vs available version for PowerShell".

Generate script snippets

"Generate a PowerShell script that installs Git, 7zip, and VS Code if not present."

Limitations

As you've already noticed, the MCP tooling currently only supports:

  • Finding packages installed on your system.
  • Installing or upgrading packages.

You can follow the WinGet repository issues or discussions for more MCP features.

Summary

Having the WinGet MCP server in your VS Code tools helps you learn the relevant commands more easily. Copilot maps them to the WinGet commands. You can either reuse these commands or let Copilot do the work for you.

With this knowledge at hand, what's your next question going to be?