|
1 | 1 | --- |
2 | 2 | title: Using Windows Package Manager with Model Context Protocol (MCP) Server |
3 | 3 | description: The Windows Package Manager includes a Model Context Protocol (MCP) server that enables AI agents and tools to discover and install packages through a standardized interface, enhancing the authoring experience in supported editors like VS Code. |
4 | | -ms.date: 10/30/2025 |
| 4 | +ms.date: 03/24/2026 |
5 | 5 | ms.topic: overview |
6 | 6 | --- |
7 | 7 |
|
@@ -129,14 +129,102 @@ To start using the Windows Package Manager (WinGet) MCP Server in Visual Studio |
129 | 129 | 1. Verify that the WinGet MCP server tools are available, with a checkmark next to the entry. |
130 | 130 | 1. Begin asking questions or requesting assistance with package management tasks. The AI agent automatically uses the WinGet MCP tools when appropriate to provide accurate, context-aware help. |
131 | 131 |
|
| 132 | +## Use WinGet MCP with GitHub Copilot CLI |
| 133 | + |
| 134 | +[GitHub Copilot CLI](https://docs.github.com/copilot/concepts/agents/about-copilot-cli) brings AI-powered assistance directly to your terminal. After registering the WinGet MCP server with Copilot CLI, you can search for and install packages using natural language prompts — without leaving the command line. |
| 135 | + |
| 136 | +### Prerequisites |
| 137 | + |
| 138 | +- [GitHub Copilot CLI installed](https://docs.github.com/copilot/how-tos/set-up/install-copilot-cli) and authenticated |
| 139 | +- The WinGet MCP server executable path (see [Find the WinGet MCP server executable path](#find-the-winget-mcp-server-executable-path)) |
| 140 | + |
| 141 | +### Add the WinGet MCP server to Copilot CLI |
| 142 | + |
| 143 | +#### Option 1: Use the interactive `/mcp add` command (recommended) |
| 144 | + |
| 145 | +1. Start Copilot CLI in your terminal: |
| 146 | + |
| 147 | + ```powershell |
| 148 | + copilot |
| 149 | + ``` |
| 150 | + |
| 151 | +1. At the prompt, enter the `/mcp add` slash command: |
| 152 | + |
| 153 | + ``` |
| 154 | + /mcp add |
| 155 | + ``` |
| 156 | + |
| 157 | +1. Fill in the MCP server details in the interactive form. Use **Tab** to move between fields: |
| 158 | + |
| 159 | + | Field | Value | |
| 160 | + |---|---| |
| 161 | + | Name | `winget-mcp` | |
| 162 | + | Type | `stdio` | |
| 163 | + | Command | Full path to `WindowsPackageManagerMCPServer.exe` | |
| 164 | + |
| 165 | +1. Press **Ctrl+S** to save. Copilot CLI writes the configuration to `~/.copilot/mcp-config.json`. |
| 166 | + |
| 167 | +#### Option 2: Edit `mcp-config.json` directly |
| 168 | + |
| 169 | +Open (or create) `~/.copilot/mcp-config.json` and add the following entry, replacing `<username>` with your Windows username: |
| 170 | + |
| 171 | +```json |
| 172 | +{ |
| 173 | + "mcpServers": { |
| 174 | + "winget-mcp": { |
| 175 | + "type": "stdio", |
| 176 | + "command": "C:\\Users\\<username>\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\WindowsPackageManagerMCPServer.exe", |
| 177 | + "args": [], |
| 178 | + "tools": ["*"] |
| 179 | + } |
| 180 | + } |
| 181 | +} |
| 182 | +``` |
| 183 | + |
| 184 | +> [!NOTE] |
| 185 | +> If `mcp-config.json` already exists and contains other servers, add the `winget-mcp` entry inside the existing `mcpServers` object rather than replacing the file. |
| 186 | +
|
| 187 | +### Verify the server is registered |
| 188 | + |
| 189 | +After adding the server, confirm it is loaded: |
| 190 | + |
| 191 | +1. Start or restart Copilot CLI: |
| 192 | + |
| 193 | + ```powershell |
| 194 | + copilot |
| 195 | + ``` |
| 196 | + |
| 197 | +1. At the prompt, enter: |
| 198 | + |
| 199 | + ``` |
| 200 | + /mcp |
| 201 | + ``` |
| 202 | + |
| 203 | + The output lists all configured MCP servers. Verify that **winget-mcp** appears and shows a connected status. |
| 204 | + |
| 205 | +### Use WinGet MCP in Copilot CLI prompts |
| 206 | + |
| 207 | +Once the server is registered, Copilot CLI automatically calls WinGet MCP tools when your prompt involves package management. After each search or install request, Copilot asks for your approval before running any command. For example prompts and prompting tips, see [Example prompts for WinGet MCP](#example-prompts-for-winget-mcp). |
| 208 | + |
132 | 209 | ## Example prompts for WinGet MCP |
133 | 210 |
|
134 | | -Example prompts that work well with WinGet MCP integration: |
| 211 | +The following prompts work well with both GitHub Copilot (VS Code) and GitHub Copilot CLI when the WinGet MCP server is configured: |
| 212 | + |
| 213 | +| Goal | Example prompt | |
| 214 | +|---|---| |
| 215 | +| Search for a package | `"Search WinGet for a PDF reader"` | |
| 216 | +| Install by name | `"Install the latest version of Git"` | |
| 217 | +| Install a specific version | `"Install Node.js 20 LTS from WinGet"` | |
| 218 | +| Find packages for a task | `"What WinGet packages are available for container development?"` | |
| 219 | +| Find packages for Python development | `"What packages are available for Python development?"` | |
| 220 | +| Install a common tool | `"Help me install Visual Studio Code"` | |
| 221 | +| Find platform-specific packages | `"Find packages for Docker on Windows"` | |
| 222 | + |
| 223 | +### Tips for effective prompting |
| 224 | + |
| 225 | +To help Copilot reliably invoke the WinGet MCP tools, use language that clearly indicates a package management intent. If Copilot does not use the WinGet MCP tools automatically, add explicit keywords such as **"using WinGet"**, **"from WinGet"**, or **"search WinGet"** to your prompt. |
135 | 226 |
|
136 | | -- "What packages are available for Python development?" |
137 | | -- "Help me install Visual Studio Code" |
138 | | -- "Find packages for Docker on Windows" |
139 | | -- "Install the latest version of Git" |
| 227 | +When using VS Code, also verify that Agent Mode is still enabled and that **winget-mcp** is checked in the tools panel. When using Copilot CLI, use `/mcp` to confirm the server is connected. |
140 | 228 |
|
141 | 229 | ## Available WinGet MCP commands |
142 | 230 |
|
|
0 commit comments