NugetPackageServer 0.2.2
dotnet tool install --global NugetPackageServer --version 0.2.2
dotnet new tool-manifest
dotnet tool install --local NugetPackageServer --version 0.2.2
#tool dotnet:?package=NugetPackageServer&version=0.2.2
nuke :add-package NugetPackageServer --version 0.2.2
Nuget Package Server
An MCP server that lets AI agents browse the actual API surface of NuGet packages referenced by .NET projects. Instead of hallucinating APIs, agents can inspect real type definitions, method signatures, and XML documentation.
Uses MetadataLoadContext for safe, inspection-only assembly loading (no code execution) and parses project.assets.json for accurate dependency resolution.
Installation
Requires the .NET 10 SDK or later.
Global tool
dotnet tool install -g NugetPackageServer
Local tool (per-project)
dotnet new tool-manifest # if you don't have one yet
dotnet tool install NugetPackageServer
Setup
Add the MCP server to your agent's configuration.
Claude Code (global)
Add to ~/.claude.json:
{
"mcpServers": {
"nuget-package-server": {
"command": "nuget-package-server"
}
}
}
Claude Code (per-project)
Add to .mcp.json in your project root:
{
"mcpServers": {
"nuget-package-server": {
"command": "dotnet",
"args": ["nuget-package-server"]
}
}
}
Use "command": "dotnet" with "args": ["nuget-package-server"] for local tool installs, or "command": "nuget-package-server" for global installs.
Tools
load_project
Load a .NET project's NuGet package information. Call this first before using other tools.
load_project(projectPath: "path/to/MyProject.csproj")
The server parses project.assets.json to discover all packages. Run dotnet restore first if the project hasn't been restored. Multiple projects can be loaded simultaneously.
load_package
Load a NuGet package by name into an isolated context for exploration. Useful for evaluating packages before adding them to a project.
load_package(name: "Humanizer.Core", version: "2.14.1", workingDirectory: "/path/to/repo")
Creates a temporary project under {workingDirectory}/tmp/, runs dotnet restore, and indexes the package. Respects nuget.config and Central Package Management (Directory.Packages.props) from the working directory. The tfm parameter is optional if a project is already loaded.
unload_project
Free memory by unloading a previously loaded project or package.
list_project_packages
List all NuGet packages (direct and transitive) referenced by the loaded project.
list_namespaces
List all namespaces across loaded packages, grouped by package. Useful for discovering the structure of an unfamiliar package before drilling into types. Supports an optional packageName filter.
search_types
Search for types across all loaded package assemblies. Supports optional filters:
query-- case-insensitive substring match against full type namepackageName-- filter to a specific NuGet packagenamespace-- prefix match on namespacetypeKind-- filter byclass,abstract class,sealed class,static class,interface,struct,enum, ordelegate
Returns up to 50 matches.
search_members
Search for methods, properties, events, and fields across all loaded package types. Supports optional filters:
query-- case-insensitive substring match against member namepackageName-- filter to a specific NuGet packagetypeName-- substring match on declaring type namememberKind-- filter bymethod,property,constructor,event,field, orenum value
Returns up to 50 lightweight matches. Use get_type_definition for full signatures.
get_type_definition
Get the full API surface of a type: constructors, methods, properties, events, and fields. Includes inline XML doc summaries where available.
get_xml_documentation
Get detailed XML documentation for a specific member using the standard member ID format (e.g. T:Namespace.Type, M:Namespace.Type.Method).
refresh_project_context
Reload a project's context after dependencies have changed.
Building from source
git clone https://github.com/roboz0r/nuget-package-server.git
cd nuget-package-server
dotnet build
Running tests
dotnet test
Running from source
# From the repo root
dotnet pack src/NugetPackageServer/NugetPackageServer.fsproj -o ./artifacts
# In another repo, install as a local tool
dotnet tool install NugetPackageServer --add-source /absolute/path/to/nuget-package-server/artifacts
# Or as a global tool
dotnet tool install -g NugetPackageServer --add-source /absolute/path/to/nuget-package-server/artifacts
Then add the MCP config file described above.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.