DN

dimonsmart/nugetmcpserver

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

24 stars 9 forks 质量 78 趋势 14NOASSERTION

.NET MCP 服务器为大型语言模型提供真实的 NuGet API 元数据,以减少幻觉

概览

NugetMcpServer 允许 Codex、Claude Code、VS Code、Claude Desktop 及其他 MCP 客户端在生成代码前检查真实的 NuGet 包元数据和公共 API。当包版本细节重要或包存在私有数据源时,它最有用。 最快的方法是:用codex mcp add或claude mcp add安装,然后让你的助理在写依赖包的代码前先用NuGet MCP服务器。 LLM通常知道流行的库,但它们并不可靠地知道每个包版本的API表面。NugetMcpServer为助手提供了一种先检查包的方式,而不是从内存中填补空白。 NugetMcpServer 将助手直接连接到 NuGet 包,包括私有订阅源和本地包文件夹。 - 搜索 NuGet 包并检查包元数据。- 阅读实际包版本的公开 API 定义。- 比较版本,检查包文件,并使用 nuget.org、私有订阅源或本地包文件夹。

概述(AI 翻译)

糟糕的 NuGet API 猜测成本很高。

NugetMcpServer 允许 Codex、Claude Code、VS Code、Claude Desktop 及其他 MCP 客户端在生成代码前检查真实的 NuGet 包元数据和公共 API。当包版本细节重要或包存在私有数据源时,它最有用。

最快的路径:先用 codex mcp add 或 claude mcp add 安装,然后让你的助手在编写依赖包的代码前先使用 NuGet MCP 服务器。

为什么会有这样的存在

LLM通常知道流行的库,但它们并不可靠地知道每个包版本的API表面。NugetMcpServer为助手提供了一种先检查包的方式,而不是从内存中填补空白。

NugetMcpServer 将助手直接连接到 NuGet 包,包括私有订阅源和本地包文件夹。

它给你的助理带来了什么

  • 搜索 NuGet 包并检查包元数据。
  • 阅读真实包版本的公开API定义。
  • 比较版本,检查包文件,并使用 nuget.org、私有订阅源或本地包文件夹。

快速开始

这些命令使用当前发布的 NuGet 包版本 1.1.7。[dnx 下载并运行 .

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

NugetMcpServer

Bad NuGet API guesses are expensive.

NugetMcpServer lets Codex, Claude Code, VS Code, Claude Desktop, and other MCP clients inspect real NuGet package metadata and public APIs before generating code. It is most useful when package version details matter or when the package lives in a private feed.

Fastest path: install it with codex mcp add or claude mcp add, then ask your assistant to use the NuGet MCP server before writing package-dependent code.

Why this exists

LLMs often know popular libraries, but they do not reliably know the exact API surface of every package version. NugetMcpServer gives the assistant a way to check the package first instead of filling gaps from memory.

NugetMcpServer connects the assistant to NuGet packages directly, including private feeds and local package folders.

What it gives to your assistant

  • Search NuGet packages and inspect package metadata.
  • Read public API definitions for real package versions.
  • Compare versions, inspect package files, and use nuget.org, private feeds, or local package folders.

Quick start

These commands use the current published NuGet package version, 1.1.7. dnx downloads and runs the .NET tool from NuGet, so you do not need a separate dotnet tool install step.

1. Install via Codex CLI

codex mcp add nuget -- dnx [email protected] --yes

Check available MCP commands:

codex mcp --help

Inside the Codex TUI, run:

/mcp

Codex CLI and the Codex IDE extension share MCP configuration, so configuring the server once should make it available in both clients.

2. Install via Claude Code CLI

claude mcp add --transport stdio nuget -- dnx [email protected] --yes

Everything after -- is the actual MCP server command and arguments.

Manage and verify the server:

claude mcp list
claude mcp get nuget

Inside Claude Code, run:

/mcp

3. Install in VS Code

Open the NuGet package page, select the MCP Server tab, and copy the generated VS Code configuration.

For manual VS Code configuration, add this to mcp.json. Replace `` with the package version you want to pin:

在 GitHub 查看完整 README

安装

docker run -i --rm ghcr.io/dimonsmart/nugetmcpserver:latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "nuget": { "command": "dnx", "args": ["DimonSmart.NugetMcpServer@<version>", "--yes"] } } }