Skip to content

Commit 33cd89a

Browse files
committed
Add GP for MCP server
1 parent 16c46fd commit 33cd89a

File tree

14 files changed

+70
-4
lines changed

14 files changed

+70
-4
lines changed

doc/admx/DesktopAppInstaller.admx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@
176176
<decimal value="0" />
177177
</disabledValue>
178178
</policy>
179+
<policy name="EnableWindowsPackageManagerMcpServer" class="Machine" displayName="$(string.EnableWindowsPackageManagerMcpServer)" explainText="$(string.EnableWindowsPackageManagerMcpServerExplanation)" key="Software\Policies\Microsoft\Windows\AppInstaller" valueName="EnableWindowsPackageManagerMcpServer">
180+
<parentCategory ref="AppInstaller" />
181+
<supportedOn ref="windows:SUPPORTED_Windows_10_0_RS5" />
182+
<enabledValue>
183+
<decimal value="1" />
184+
</enabledValue>
185+
<disabledValue>
186+
<decimal value="0" />
187+
</disabledValue>
188+
</policy>
179189
<policy name="WindowsPackageManagerDefaultProxy" class="Machine" displayName="$(string.WindowsPackageManagerDefaultProxy)" explainText="$(string.WindowsPackageManagerDefaultProxyExplanation)" presentation="$(presentation.WindowsPackageManagerDefaultProxy)" key="Software\Policies\Microsoft\Windows\AppInstaller">
180190
<parentCategory ref="AppInstaller" />
181191
<supportedOn ref="windows:SUPPORTED_Windows_10_0_RS5" />

doc/admx/en-US/DesktopAppInstaller.adml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ If you disable this setting, users will not be able to use the Windows Package M
116116
If you enable this setting, users will be able to configure the Windows Package Manager's use of proxy through the command line.
117117

118118
If you disable or do not configure this setting, users will not be able to to configure the Windows Package Manager's use of proxy through the command line.</string>
119+
<string id="EnableWindowsPackageManagerMcpServer">Enable Windows Package Manager MCP Server</string>
120+
<string id="EnableWindowsPackageManagerMcpServerExplanation">
121+
This policy controls whether the Windows Package Manager Model Context Protocol (MCP) server can be used.
122+
123+
If you enable or do not configure this setting, users will be able to use the Windows Package Manager's MCP server.
124+
125+
If you disable this setting, users will not be able to to use the Windows Package Manager's MCP server.</string>
119126
<string id="WindowsPackageManagerDefaultProxy">Set Windows Package Manager Default Proxy</string>
120127
<string id="WindowsPackageManagerDefaultProxyExplanation">This policy controls the default proxy used by the Windows Package Manager.
121128

src/AppInstallerCLICore/Commands/McpCommand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using namespace AppInstaller::CLI::Workflow;
1010
namespace AppInstaller::CLI
1111
{
1212
McpCommand::McpCommand(std::string_view parent) :
13-
Command("mcp", {}, parent, Settings::TogglePolicy::Policy::Configuration)
13+
Command("mcp", {}, parent, Settings::TogglePolicy::Policy::McpServer)
1414
{
1515
}
1616

src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,4 +3384,7 @@ Please specify one of them using the --source option to proceed.</value>
33843384
MCP stands for Model Context Protocol and should probably remain as-is.
33853385
An unlocalized JSON fragment will follow on another line.</comment>
33863386
</data>
3387+
<data name="PolicyEnableMcpServer" xml:space="preserve">
3388+
<value>Enable Windows Package Manager MCP Server</value>
3389+
</data>
33873390
</root>

src/AppInstallerSharedLib/GroupPolicy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ namespace AppInstaller::Settings
326326
return TogglePolicy(policy, "EnableWindowsPackageManagerConfiguration"sv, String::PolicyEnableWinGetConfiguration);
327327
case TogglePolicy::Policy::ProxyCommandLineOptions:
328328
return TogglePolicy(policy, "EnableWindowsPackageManagerProxyCommandLineOptions"sv, String::PolicyEnableProxyCommandLineOptions);
329+
case TogglePolicy::Policy::McpServer:
330+
return TogglePolicy(policy, "EnableWindowsPackageManagerMcpServer"sv, String::PolicyEnableMcpServer);
329331
default:
330332
THROW_HR(E_UNEXPECTED);
331333
}

src/AppInstallerSharedLib/Public/winget/GroupPolicy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace AppInstaller::Settings
4747
WinGetCommandLineInterfaces,
4848
Configuration,
4949
ProxyCommandLineOptions,
50+
McpServer,
5051
Max,
5152
};
5253

src/AppInstallerSharedLib/Public/winget/Resources.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ namespace AppInstaller
6060
WINGET_DEFINE_RESOURCE_STRINGID(PolicyEnableWindowsPackageManagerCommandLineInterfaces);
6161
WINGET_DEFINE_RESOURCE_STRINGID(PolicyEnableWinGetConfiguration);
6262
WINGET_DEFINE_RESOURCE_STRINGID(PolicyEnableProxyCommandLineOptions);
63+
WINGET_DEFINE_RESOURCE_STRINGID(PolicyEnableMcpServer);
6364

6465
WINGET_DEFINE_RESOURCE_STRINGID(SettingsWarningInvalidFieldFormat);
6566
WINGET_DEFINE_RESOURCE_STRINGID(SettingsWarningInvalidFieldValue);

src/PowerShell/Microsoft.WinGet.SharedLib/PolicySettings/Enums.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// -----------------------------------------------------------------------------
1+
// -----------------------------------------------------------------------------
22
// <copyright file="Enums.cs" company="Microsoft Corporation">
33
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
44
// </copyright>
@@ -96,6 +96,11 @@ public enum Policy
9696
/// Enabled configuration.
9797
/// </summary>
9898
Configuration,
99+
100+
/// <summary>
101+
/// Enabled MCP server.
102+
/// </summary>
103+
McpServer,
99104
}
100105

101106
/// <summary>

src/PowerShell/Microsoft.WinGet.SharedLib/PolicySettings/TogglePolicy.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// -----------------------------------------------------------------------------
1+
// -----------------------------------------------------------------------------
22
// <copyright file="TogglePolicy.cs" company="Microsoft Corporation">
33
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
44
// </copyright>
@@ -125,6 +125,8 @@ internal static TogglePolicy Create(Policy policy)
125125
return new TogglePolicy(policy, "EnableWindowsPackageManagerCommandLineInterfaces", GroupPolicyResource.PolicyEnableWindowsPackageManagerCommandLineInterfaces);
126126
case Policy.Configuration:
127127
return new TogglePolicy(policy, "EnableWindowsPackageManagerConfiguration", GroupPolicyResource.PolicyEnableWinGetConfiguration);
128+
case Policy.McpServer:
129+
return new TogglePolicy(policy, "EnableWindowsPackageManagerMcpServer", GroupPolicyResource.PolicyEnableMcpServer);
128130
default:
129131
throw new ArgumentException(null, nameof(policy));
130132
}

src/PowerShell/Microsoft.WinGet.SharedLib/Resources/GroupPolicyResource.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)