Tharga.MongoDB.Mcp 2.10.12

dotnet add package Tharga.MongoDB.Mcp --version 2.10.12
                    
NuGet\Install-Package Tharga.MongoDB.Mcp -Version 2.10.12
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tharga.MongoDB.Mcp" Version="2.10.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tharga.MongoDB.Mcp" Version="2.10.12" />
                    
Directory.Packages.props
<PackageReference Include="Tharga.MongoDB.Mcp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tharga.MongoDB.Mcp --version 2.10.12
                    
#r "nuget: Tharga.MongoDB.Mcp, 2.10.12"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tharga.MongoDB.Mcp@2.10.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tharga.MongoDB.Mcp&version=2.10.12
                    
Install as a Cake Addin
#tool nuget:?package=Tharga.MongoDB.Mcp&version=2.10.12
                    
Install as a Cake Tool

Tharga.MongoDB.Mcp

Exposes Tharga.MongoDB monitoring data and admin actions over MCP (Model Context Protocol). Plugs into Tharga.Mcp so that Claude, Cursor, and other MCP clients can inspect collections, diagnose slow queries, rebuild indexes, and (optionally) read or modify documents — without SSH'ing to a prod box for mongosh.

Install

dotnet add package Tharga.MongoDB.Mcp
builder.Services.AddThargaMcp(mcp => mcp.AddMongoDB());
app.UseThargaMcp();

By default only metadata is exposed. Opt in to data tools explicitly:

builder.Services.AddThargaMcp(mcp => mcp.AddMongoDB(o =>
{
    o.DataAccess = DataAccessLevel.DataRead;       // adds get_document, list_documents, find_duplicates, explain
    // o.DataAccess = DataAccessLevel.DataReadWrite; // also adds clean
}));

The provider is registered on the System MCP scope, so it only surfaces to system-level callers (e.g. an admin API key) — not to per-team users.

What's exposed

Resources

  • mongodb://collections — every registered collection with status, indexes, document count
  • mongodb://monitoring — recent calls, slow queries, latency
  • mongodb://clients — connected MongoDB driver clients

Tools (Metadata level — default)

  • mongodb.touch — initialise a collection (assure indexes, etc.)
  • mongodb.rebuild_index — drop & recreate a named index
  • mongodb.drop_index, mongodb.reset_cache, mongodb.clear_call_history, mongodb.compare_schema

Tools (DataRead)

  • mongodb.get_document — raw BSON-as-JSON for a single document by id (auto-detects ObjectId / Guid / string)
  • mongodb.list_documents — paged listing with optional filter and sort
  • mongodb.find_duplicates, mongodb.explain

Tools (DataReadWrite)

  • mongodb.clean — apply collection cleaners

Atlas (optional)

When you set MongoDbMcpOptions.Atlas to a MongoDbApiAccess (Public/Private API key + Group/Project ID), the package additionally registers read-only MongoDB Atlas Administration tools on the System scope:

builder.Services.AddThargaMcp(mcp => mcp.AddMongoDB(o =>
{
    o.Atlas = new MongoDbApiAccess
    {
        PublicKey  = "<atlas-public-key>",
        PrivateKey = "<atlas-private-key>",
        GroupId    = "<atlas-project-id>",
    };
}));
Tool Purpose
atlas.list_clusters Clusters in the configured Atlas project — name, type, state, MongoDB version.
atlas.get_performance_advisor_suggestions Atlas Performance Advisor's suggested-index list for a named cluster (the same data the Atlas UI surfaces). Takes clusterName.
atlas.get_open_alerts Currently-firing Atlas alerts in the project.

Atlas tools are gated by the same DataAccessLevel.Metadata minimum as the rest of the package. Leaving Atlas unset keeps the surface entirely opt-in.

Documentation

Full docs and configuration reference: github.com/Tharga/MongoDB.

GitHub repo

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.10.12 94 5/18/2026
2.10.11 87 5/12/2026
2.10.10 106 5/10/2026
2.10.9 98 5/5/2026
2.10.8 94 5/5/2026 2.10.8 is deprecated because it has critical bugs.
2.10.7 93 5/5/2026 2.10.7 is deprecated because it has critical bugs.
2.10.6 98 5/3/2026
2.10.5 101 4/29/2026
2.10.4 102 4/20/2026