Skip to content

Commit 3a42769

Browse files
authored
Merge pull request #3502 from NuGet/main
Merge main into live
2 parents e9c4845 + 373837d commit 3a42769

File tree

173 files changed

+314
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+314
-204
lines changed

docs/TOC.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
## [MSBuild .props and .targets](concepts/MSBuild-props-and-targets.md)
8080
## [Troubleshooting Installed Packages](concepts/troubleshooting-installed-packages.md)
8181
## [MCP servers in NuGet packages](concepts/nuget-mcp.md)
82+
## [Configuring the NuGet MCP Server](concepts/NuGet-MCP-Server.md)
8283
# Reference
8384
## [.nuspec](reference/nuspec.md)
8485
## [nuget.config file](reference/nuget-config-file.md)

docs/api/NuGet-Protocols.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: The evolving nuget.org protocols to interact with NuGet clients.
44
author: anangaur
55
ms.author: anangaur
66
ms.date: 01/21/2021
7-
ms.topic: conceptual
7+
ms.topic: article
88
ms.reviewer: kraigb
99
---
1010

docs/api/implementation-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Guidelines and recommendations to anyone implementing the NuGet Ser
44
author: zivkan
55
ms.author: zivkan
66
ms.date: 07/29/2023
7-
ms.topic: conceptual
7+
ms.topic: article
88
---
99

1010
# NuGet Server Implementation Guide
@@ -150,4 +150,4 @@ If you wish to host search, or indeed any other NuGet API resource, on different
150150

151151
## Enable embedded README downloads
152152

153-
A [new resource](./readme-template-resource.md) was documented for constructing a URL that can be used to download a README for a given package. This will allow client, like the Package Management UI in VS, to display the embedded README for packages which haven't been previously installed by the user. The client will construct this URL and attempt to download the README, using the response to the request to determine if a README is available. This means servers should expect multiple requests to the constructed endpoint as users navigate the PM UI.
153+
A [new resource](./readme-template-resource.md) was documented for constructing a URL that can be used to download a README for a given package. This will allow client, like the Package Management UI in VS, to display the embedded README for packages which haven't been previously installed by the user. The client will construct this URL and attempt to download the README, using the response to the request to determine if a README is available. This means servers should expect multiple requests to the constructed endpoint as users navigate the PM UI.

docs/api/tools-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: The endpoint for
44
author: jver
55
ms.author: jver
66
ms.date: 08/16/2018
7-
ms.topic: conceptual
7+
ms.topic: article
88
ms.reviewer: kraigb
99
---
1010

docs/archive/project-json-and-uwp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Description of how the project.json file is used to track NuGet dep
44
author: JonDouglas
55
ms.author: jodou
66
ms.date: 07/17/2017
7-
ms.topic: conceptual
7+
ms.topic: article
88
---
99

1010
# project.json and UWP

docs/archive/project-json-impact.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Details on how the implementation of project.json in NuGet 3.x affe
44
author: JonDouglas
55
ms.author: jodou
66
ms.date: 01/18/2018
7-
ms.topic: conceptual
7+
ms.topic: concept-article
88
---
99

1010
# Impact of project.json when creating packages

docs/concepts/Auditing-Packages.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Auditing package dependencies for security vulnerabilities
33
description: How to audit package dependencies for security vulnerabilities and acting on security audit reports.
44
author: JonDouglas
55
ms.author: jodou
6-
ms.topic: conceptual
6+
ms.topic: how-to
77
ms.date: 10/01/2025
88
---
99

@@ -202,6 +202,10 @@ If a known vulnerability exists in a top-level package's transitive dependencies
202202
- [Suppress the advisory](#excluding-advisories) until it can be addressed.
203203
- File an issue in the top-level package's tracker to request an update.
204204

205+
### Use Copilot to update packages
206+
NuGet has released a Model Context Protocol (MCP) server that has the ability to update packages in your project to versions that resolve known vulnerabilities.
207+
See [Fixing package vulnerabilities](NuGet-MCP-Server.md#fixing-package-vulnerabilities) for more information.
208+
205209
### Security vulnerabilities found with no updates
206210

207211
In the case that a known vulnerability exists in a package without a security fix, you can do the following.

docs/concepts/Dependency-Resolution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Details on the process through which a NuGet package's dependencies
44
author: JonDouglas
55
ms.author: jodou
66
ms.date: 08/14/2017
7-
ms.topic: conceptual
7+
ms.topic: article
88
---
99

1010
# How NuGet resolves package dependencies

docs/concepts/MSBuild-props-and-targets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Describes MSBuild props and targets in NuGet packages
44
author: nkolev92
55
ms.author: nikolev
66
ms.date: 07/13/2022
7-
ms.topic: conceptual
7+
ms.topic: article
88
---
99

1010
# MSBuild .props and .targets in a package

docs/concepts/NuGet-MCP-Server.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Using the NuGet Model Context Protocol (MCP) Server
3+
description: How to configure and use the NuGet Model Context Protocol (MCP) server.
4+
author: jeffkl
5+
ms.author: jeffkl
6+
ms.topic: conceptual
7+
ms.date: 10/01/2025
8+
---
9+
10+
# Using the NuGet Model Context Protocol (MCP) Server
11+
12+
## Requirements
13+
14+
To run the MCP server, you must have **[.NET 10 SDK or later](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)** installed.
15+
This version of .NET adds a command, `dnx`, which is used to download, install, and run the MCP server from [nuget.org](https://nuget.org).
16+
17+
To verify your .NET version, run the following command in your terminal:
18+
```bash
19+
dotnet --info
20+
```
21+
22+
## Getting started in Visual Studio 2026
23+
24+
In Visual Studio 2026, the NuGet MCP server is built-in but must be enabled once in order to use its functionality.
25+
26+
To enable the NuGet MCP server, follow these steps:
27+
1. Open Visual Studio 2026.
28+
1. Open the GitHub Copilot Chat window and make sure you are signed in.
29+
1. Click the tools icon in the bottom toolbar to bring up the Tools menu.
30+
1. Find the MCP server named "nuget" and check the box to enable it.
31+
32+
![GitHub Copilot Chat Tools window in Visual Studio 2026](./media/copilot-tools-menu.png)
33+
34+
## Getting started in Visual Studio 2022
35+
36+
> [!NOTE]
37+
> You must have Visual Studio 2022 17.14 or later in order to configure an MCP server.
38+
39+
In Visual Studio 2022, you must manually add the NuGet MCP server to your configuration.
40+
There are several configuration files that Visual Studio 2022 uses to define MCP servers.
41+
See [Use MCP Servers](/visualstudio/ide/mcp-servers) for more information on which file to configure.
42+
43+
Once you have identified the correct configuration file, add the following JSON snippet to your `mcp.json`:
44+
```json
45+
{
46+
"servers": {
47+
"nuget": {
48+
"type": "stdio",
49+
"command": "dnx",
50+
"args": [ "NuGet.Mcp.Server", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]
51+
}
52+
}
53+
}
54+
```
55+
56+
This will configure Visual Studio 2022 to use the latest version of the NuGet MCP server from nuget.org.
57+
To verify that the MCP server is working correctly, open the GitHub Copilot Chat window and make sure you are signed in.
58+
Then click the Tools icon in the bottom toolbar to bring up the Tools menu.
59+
You should see the MCP server named "nuget" in the list of available servers.
60+
61+
![GitHub Copilot Chat Tools window in Visual Studio 2022](./media/copilot-tools-menu-2022.png)
62+
63+
## Getting started in VS Code
64+
65+
To configure the NuGet MCP server in VS Code click the appropriate button below and it will be set up.
66+
67+
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](
68+
https://vscode.dev/redirect/mcp/install?name=NuGet&config=%7B%22name%22%3A%22NuGet.Mcp.Server%22%2C%22command%22%3A%22dnx%22%2C%22args%22%3A%5B%22NuGet.Mcp.Server%22%2C%22https%3A%2F%2Fapi.nuget.org%2Fv3%2Findex.json%22%2Cnull%2Cnull%5D%7D) [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=NuGet&config=%7B%22name%22%3A%22NuGet.Mcp.Server%22%2C%22command%22%3A%22dnx%22%2C%22args%22%3A%5B%22NuGet.Mcp.Server%22%2C%22https%3A%2F%2Fapi.nuget.org%2Fv3%2Findex.json%22%2Cnull%2Cnull%5D%7D&quality=insiders)
69+
70+
> ![GitHub Copilot Chat Tools window in VS Code](./media/copilot-tools-menu-vs-code.png)
71+
72+
To verify that the MCP server is working correctly, open the GitHub Copilot Chat window and make sure you are signed in.
73+
Then click the Tools icon in the bottom toolbar to bring up the Tools menu.
74+
You should see the MCP server named "nuget" in the list of available servers.
75+
76+
## Fixing package vulnerabilities
77+
78+
The NuGet MCP server can help you identify and fix package vulnerabilities in your project.
79+
To use the MCP server to fix vulnerabilities, enter the following prompt in the GitHub Copilot Chat window:
80+
81+
> Fix my package vulnerabilities
82+
83+
The MCP server will analyze your project's dependencies and suggest updates to packages that have known vulnerabilities.
84+
85+
## Updating all packages
86+
87+
The NuGet MCP server can also update your packages to the latest compatible versions.
88+
To use the MCP server to update all packages, enter the following prompt in the GitHub Copilot Chat window:
89+
90+
> Update all my packages to the latest compatible versions
91+
92+
The MCP server will analyze your project's target framework(s) and suggest updates to the latest version of packages that are compatible with your project.
93+
94+
## Update a package to a specific version
95+
96+
The NuGet MCP server can update a specific package to a version you specify.
97+
To do so, enter the following prompt in the GitHub Copilot Chat window:
98+
99+
> Update the package [PackageName] to version [VersionNumber]
100+
101+
## Support
102+
103+
If you experience an issue with the NuGet MCP server or have any other feedback, please open an issue on the [NuGet GitHub repository](https://github.com/NuGet/Home/issues/new?template=MCPSERVER.yml).
104+
Please provide the requested information in the issue template so that we can better understand and address your issue or suggestion.

0 commit comments

Comments
 (0)