NugetMcpServer

DimonSmart/NugetMcpServer

3.4

If you are the rightful owner of NugetMcpServer and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

NugetMcpServer is a powerful MCP server for obtaining accurate interface and enum definitions from NuGet packages, reducing LLM hallucinations by providing precise API information.

NugetMcpServer

Install via Docker Install via .NET Tool

NugetMcpServer is an MCP server that helps you find and inspect NuGet packages. It gives you accurate information about interfaces, classes, enums, and other types directly from the packages. This helps AI assistants provide better code suggestions and avoid making up non-existent APIs.

Certified by .

Overview

This server connects your AI assistant (like Claude or Copilot) to the real NuGet ecosystem. Instead of guessing, the AI can look up the exact methods and types available in a specific version of a package.

You can use it to:

  • Find the right package for your task.
  • See the exact interface definitions.
  • Check for breaking changes between versions.
  • Get correct code examples based on real metadata.

It works with any client that supports the Model Context Protocol (MCP), such as VS Code (with Copilot), Claude Desktop, or OllamaChat.

Supported Clients

  • VS Code: Integrate through MCP server configuration
  • OllamaChat: My experimental C# AI playground built on Semantic Kernel. It features RAG, image analysis support, multi-agent chat (e.g., philosophers debating), and MCP server support with automatic function selection via vector indexes. Check it out at OllamaChat.
  • GitHub Copilot: Use as an MCP server to get accurate package information
  • Other MCP Clients: Any tool that supports the Model Context Protocol

Quick Start

Option 1: Docker (Recommended)

Prerequisite: Docker installed and running.

Click to Install in VS Code (Docker)

Option 2: .NET Tool (Native)

Prerequisite: .NET 9.0 SDK installed.

  1. Install the tool globally:
    dotnet tool install -g DimonSmart.NugetMcpServer
    
  2. Click to Install in VS Code (Local)

Option 3: Claude Desktop

Run this command to install automatically via Smithery:

npx -y @smithery/cli install @dimonsmart/nugetmcpserver --client claude

Option 4: Manual Configuration

If you prefer to configure manually:

Docker Configuration
{
  "mcpServers": {
    "nuget": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "ghcr.io/dimonsmart/nugetmcpserver:latest"]
    }
  }
}
.NET Tool Configuration
{
  "mcpServers": {
    "nuget": {
      "command": "NugetMcpServer",
      "args": []
    }
  }
}

Private & Local NuGet Sources

You can point the server at private feeds (Azure Artifacts, Artifactory, ProGet, Nexus) and local folders.

Source resolution order (highest priority first):

  1. --source / --sources command-line args
  2. NUGET_SOURCES + NUGET_CONFIG environment variables
  3. NuGet:Sources + NuGet:ConfigPath in appsettings.json (or client env binding)
  4. Default NuGet config discovery (machine/user/solution), fallback to nuget.org

CLI Examples

NugetMcpServer --source "C:\\NuGet\\LocalFeed" --source "https://pkgs.dev.azure.com/ORG/_packaging/Feed/nuget/v3/index.json"
NugetMcpServer --nuget-config "C:\\path\\to\\nuget.config"

MCP Client Config (VS Code / Claude / etc.)

{
  "mcpServers": {
    "nuget": {
      "command": "NugetMcpServer",
      "args": [
        "--source", "C:\\NuGet\\LocalFeed",
        "--source", "https://pkgs.dev.azure.com/ORG/_packaging/Feed/nuget/v3/index.json"
      ],
      "env": {
        "NUGET_CONFIG": "C:\\path\\to\\nuget.config"
      }
    }
  }
}

Environment Variables

set NUGET_SOURCES=C:\NuGet\LocalFeed;https://pkgs.dev.azure.com/ORG/_packaging/Feed/nuget/v3/index.json
set NUGET_CONFIG=C:\path\to\nuget.config

Tool Parameters

All package-related tools accept an optional source parameter. It can be a source name from nuget.config or a full URL/local path.

{
  "name": "get_package_info",
  "parameters": {
    "packageId": "Contoso.Internal.Logging",
    "source": "corp"
  }
}

Installation Options

Option 1: Run with Docker (Recommended)

This works on Windows, macOS, and Linux. You do not need the .NET SDK.

docker run -i --rm ghcr.io/dimonsmart/nugetmcpserver:latest

Option 2: Install via Smithery

To install for Claude Desktop automatically:

npx -y @smithery/cli install @dimonsmart/nugetmcpserver --client claude

Option 3: Install via WinGet (Windows)

You can install using the Windows Package Manager:

winget install DimonSmart.NugetMcpServer

Option 4: Install as .NET Tool

If you have the .NET SDK installed:

dotnet tool install -g DimonSmart.NugetMcpServer

Available Tools

All package-related tools accept an optional source parameter (source name or URL/path) to target a specific feed or local folder.

Package Search

  • search_packages(query, maxResults?, source?)
    • Searches for packages using keywords.
    • Good for finding a specific package if you know the name or a keyword.
  • search_packages_fuzzy(query, maxResults?, source?)
    • Uses AI to guess package names based on your description.
    • Good if you don't know the exact package name (e.g., "library to generate mazes").

Package Information

  • get_package_info(packageId, version?, source?)
    • Gets details about a package, including its dependencies and whether it is a meta-package.
  • compare_package_versions(packageId, fromVersion, toVersion, ..., source?)
    • Compares two versions of a package.
    • Shows breaking changes, new methods, and removed APIs.
    • You can filter by type name or member name.

Type Definitions

  • get_interface_definition(packageId, interfaceName, version?, source?)
    • Gets the C# code for an interface.
  • get_class_or_record_or_struct_definition(packageId, typeName, version?, source?)
    • Gets the C# code for a class, record, or struct.
  • get_enum_definition(packageId, enumName, version?, source?)
    • Gets the C# code for an enum.

Listing Types

  • list_interfaces(packageId, version?, source?)
    • Lists all public interfaces in a package.
  • list_classes_records_structs(packageId, version?, source?)
    • Lists all public classes, records, and structs in a package.

File Access

  • list_package_files(packageId, version?, source?)
    • Lists all files inside the package.
  • get_package_file(packageId, filePath, ..., source?)
    • Reads the content of a file from the package.

Utilities

  • get_current_time()
    • Returns the current server time.

Examples

📄 See Example Responses

Get Interface Definition

Request:

{
  "name": "get_interface_definition",
  "parameters": {
    "packageId": "DimonSmart.MazeGenerator",
    "interfaceName": "IMazeGenerator"
  }
}

Response:

{
  "result": "namespace DimonSmart.MazeGenerator\n{\n    public interface IMazeGenerator\n    {\n        bool[,] Generate(int width, int height);\n        string AlgorithmName { get; }\n    }\n}"
}

Search Packages

Request:

{
  "name": "search_packages",
  "parameters": {
    "query": "json"
  }
}

Response:

## Newtonsoft.Json v13.0.3
**Downloads**: 4,500,000,000
**Description**: Json.NET is a popular high-performance JSON framework for .NET

Project Structure

📁 View File Structure
  • Program.cs: Main entry point.
  • Tools/: Contains the logic for each MCP tool.
  • Services/: Handles NuGet downloads, formatting, and analysis.
  • Common/: Shared code and base classes.

Version Information

Current version: 1.0.18

Check your version:

NugetMcpServer --version

Copyright

© 2025 DimonSmart

License

Unlicense - This is free and unencumbered software released into the public domain.