Microsoft NuGet

com.microsoft由 microsoft.com 發布v1.4.23更新於 Oct 31, 2026

A Model Context Protocol (MCP) server for NuGet.

發布方自己的服務:Microsoft Learn MCP

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

微軟的 NuGet MCP 伺服器讓助理查詢套件資訊、規劃升級、修復有漏洞的相依套件,並檢視儲存庫的 NuGet 供應鏈設定。

可以做什麼
  • 從已設定的 NuGet 來源查詢套件的最新版本與套件內容(AGENTS.md 或 README)
  • 規劃並執行套件變更:升級至最新相容版本,或指定確切的目標版本
  • 以最小的安全版本變動修復直接與間接相依套件中的已知漏洞
  • 檢視儲存庫的供應鏈設定,例如集中套件管理、NuGet 稽核、套件來源對應及 NuGet.Config 有效性
適用情境
適合想讓助理分析專案套件相依圖、讓相依套件保持最新、修復有漏洞的套件,或稽核 NuGet 供應鏈設定的 .NET 開發人員,不必離開對話即可完成。
執行需求
透過 dnx 指令以 stdio 在本機執行,需要 .NET 10 Preview 6 或更新版本;在 Visual Studio 2022(17.14 以上)、Visual Studio 2026、VS Code 或 GitHub Copilot 的 mcp.json 中設定。使用你已設定的 NuGet 來源,預設為公開的 nuget.org 來源。未宣告任何 API 金鑰或環境變數。
安裝前請注意
多個工具會修改專案檔案:fix_vulnerable_packages、upgrade_packages_to_latest、update_package_version 以及依檢視建議進行的強化會改動套件版本與相依圖,接受前請先確認變更。遙測預設開啟並傳送給微軟,可用 DOTNET_CLI_TELEMETRY_OPTOUT 關閉。套件中繼資料會從你設定的來源取得。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Microsoft NuGet,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

NuGet MCP Server

Contains a Model Context Protocol (MCP) server for NuGet, enabling advanced tooling and automation scenarios for NuGet package management. See the official NuGet MCP documentation for the latest information.

Capabilities

  • Uses your configured NuGet feeds to get real-time information about packages.
  • Provides conservative remediation planning for packages with known vulnerabilities, including transitive dependencies.
  • Provides package upgrade planning based on a project's package graph and target frameworks.
  • Reviews your repository's NuGet supply-chain posture (Central Package Management, NuGet Audit, Package Source Mapping, and NuGet.Config validity) and recommends hardening steps.

Requirements

To run the MCP server, you must have .NET 10 Preview 6 or later installed. This version of .NET adds a command, dnx, which is used to download, install, and run the MCP server from nuget.org.

To verify your .NET version, run the following command in your terminal:

bash
dotnet --info

Getting Started

To configure the NuGet MCP server, you will need to modify an mcp.json file or other configuration. The following table provides links to documentation for configuring MCP servers in different environments:

Visual Studio 2026

The NuGet MCP server ships in-box with Visual Studio 2026. You must enable it the first time in the GitHub Copilot chat tools menu.

If you'd like to use a newer version of the NuGet MCP server than the one included with Visual Studio, you can configure it with the following snippet and include it in your mcp.json:

jsonc
{  "servers": {    "nuget": {      "type": "stdio",      "command": "dnx",      "args": [ "NuGet.Mcp.Server", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]    }  }}

If you'd like to use a specific version of the MCP server, you can specify it with package name like [email protected]:

jsonc
{  "servers": {    "nuget": {      "type": "stdio",      "command": "dnx",      "args": [ "[email protected]", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]    }  }}

When configured this way, you will need to update the version as new releases become available.

See File locations for automatic discovery of MCP configuration for more information on the location of the appropriate mcp.json for you.

Visual Studio 2022

To configure the MCP server for use with Visual Studio 2022, make sure you have update 17.14 or later installed. Then use the following snippet and include it in your mcp.json:

jsonc
{  "servers": {    "nuget": {      "type": "stdio",      "command": "dnx",      "args": [ "NuGet.Mcp.Server", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]    }  }}

If you'd like to use a specific version of the MCP server, you can specify it with package name like [email protected]:

jsonc
{  "servers": {    "nuget": {      "type": "stdio",      "command": "dnx",      "args": [ "[email protected]", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]    }  }}

When configured this way, you will need to update the version as new releases become available.

See File locations for automatic discovery of MCP configuration for more information on the location of the appropriate mcp.json for you.

VS Code

To configure the NuGet MCP server in VS code, you can use the following badges to quickly install the MCP server:

[Install in VS Code] [Install in VS Code Insiders]

To manually configure the MCP server for use with Visual Studio or VS Code, use the following snippet and include it in your mcp.json:

jsonc
{  "servers": {    "nuget": {      "type": "stdio",      "command": "dnx",      "args": [ "NuGet.Mcp.Server", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]    }  }}

If you'd like to use a specific version of the MCP server, you can specify it with package name like [email protected]:

jsonc
{  "servers": {    "nuget": {      "type": "stdio",      "command": "dnx",      "args": [ "[email protected]", "--source", "https://api.nuget.org/v3/index.json", "--yes" ]    }  }}

When configured this way, you will need to update the version as new releases become available.

See MCP configuration in VS Code for more information on the location of the appropriate mcp.json for you.

GitHub Copilot

You can also configure the MCP Server to work with GitHub Copilot as a Coding Agent in your repositories.

First, you need to add the MCP Server configuration in your Copilot Coding Agent:

json
{   "mcpServers": {    "NuGet": {      "type": "local",      "command": "dnx",      "args": ["NuGet.Mcp.Server", "--yes"],      "tools": ["*"],      "env": {}    }  } }

This will make all the MCP Server tools available, if you want specific tools you can list them in the "tools" parameter array.

You will also need to make sure Copilot installs .NET 10 Preview 6 or higher in order to have the command dnx and install the MCP Server.

.github/workflows/copilot-setup-steps.yml

yml
name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and# allow manual testing through the repository's "Actions" tabon:  workflow_dispatch:  push:    paths:      - .github/workflows/copilot-setup-steps.yml  pull_request:    paths:      - .github/workflows/copilot-setup-steps.yml
jobs:  # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.  copilot-setup-steps:    runs-on: ubuntu-latest
    # Set the permissions to the lowest permissions possible needed for your steps.    # Copilot will be given its own token for its operations.    permissions:      # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.      contents: read
    # You can define any steps you want, and they will run before the agent starts.    # If you do not check out your code, Copilot will do this for you.    steps:      - name: Install .NET 10.x        uses: actions/setup-dotnet@v5        with:          dotnet-version: |            10.x          dotnet-quality: preview
      - name: dotnet --info        run: dotnet --info

Currently Supported Tools

  • fix_vulnerable_packages: Fixes known security vulnerabilities in NuGet dependencies by computing the smallest safe version changes.
  • upgrade_packages_to_latest: Upgrades NuGet packages to the latest compatible versions available from configured package sources.
  • get_latest_package_version: Returns the latest version of a NuGet package.
  • get_package_context: Returns the AGENTS.md context for a NuGet package when available; otherwise returns the package README.
  • update_package_version: Updates one or more NuGet packages to exact target versions while keeping the dependency graph compatible.
  • review_supply_chain_security: Reviews and recommends hardening steps for your repository's NuGet supply‑chain posture (eg, Central Package Management, NuGet Audit, Package Source Mapping, and NuGet.Config validation).

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Telemetry Configuration

Telemetry collection is on by default to help improve the product. This can be disabled, see Disabling All Telemetry section below for more details.

Disabling Telemetry Only

To disable Microsoft telemetry collection, set the environment variable DOTNET_CLI_TELEMETRY_OPTOUT to true or 1:

bash
export DOTNET_CLI_TELEMETRY_OPTOUT=true

Support

If you experience an issue with the NuGet MCP server or have any other feedback, please open an issue on the NuGet GitHub repository. Please provide the requested information in the issue template so that we can better understand and address your issue or suggestion.

No Warranty / Limitation of Liability

This software is provided "as is" without warranties or conditions of any kind, either express or implied. Microsoft shall not be liable for any damages arising from use, misuse, or misconfiguration of this software.

來源:mcp/README.md,提交 cc3c847

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

2
  1. v1.4.23最新Oct 31, 2026
  2. v1.4.16Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Microsoft 整合