Skip to content

MCP server unable to install packages when the source parameter is used #5715

@SpecterShell

Description

@SpecterShell

Relevant area(s)

WinGet CLI

Relevant command(s)

winget mcp

Brief description of your issue

The MCP server can't install packages when invoked with the "source" parameter (e.g., "source":"winget"). It can install without this parameter.

Steps to reproduce

  1. Connect to the WinGet MCP server in any program. The following example uses OpenAI Codex, but it can be replicated in other programs like Cherry Studio. The configuration is as follows:

    [mcp_servers.winget-mcp]
    command = "C:\\Users\\<username>\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\WindowsPackageManagerMCPServer.exe"
    type = "stdio"
  2. Prompt the model to install Codex. For example: Could you find and install Codex with WinGet? Please choose the one from OpenAI.

Expected behavior

The package should be installed properly.

Actual behavior

The model tries to install OpenAI Codex, but the function failed:

tool running...
winget-mcp.install-winget-package({"identifier":"OpenAI.Codex","source":"winget"})

tool success, duration: 139ms
winget-mcp.install-winget-package({"identifier":"OpenAI.Codex","source":"winget"})

{"message": "Did not find a package with the requested identifier", "identifier": "OpenAI.Codex",
"source": "winget", "packages": []}

Ask the model to install this package again without the source parameter (e.g., Could you retry installing without the "source" parameter?), and it'll success this time.

tool running...
winget-mcp.install-winget-package({"identifier":"OpenAI.Codex"})

tool success, duration: 4.65s
winget-mcp.install-winget-package({"identifier":"OpenAI.Codex"})

{"message": "Install completed successfully", "installedPackageInformation": {"identifier":
"OpenAI.Codex", "name": "Codex CLI", "source": "winget", "isInstalled": true, "installedVersion":
"0.31.0", "installedLocation": "C:\\Users\\SpecterShell\\AppData\\Local\\Microsoft\\WinGet\
\Packages\\OpenAI.Codex_Microsoft.Winget.Source_8wekyb3d8bbwe", "isUpdateAvailable": false}}

Environment

Windows Package Manager (Preview) v1.12.170-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.5074
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.27.170.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-MCPIssue related to WinGet MCP ServerIssue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions