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
<PackageReference Include="Tharga.MongoDB.Mcp" Version="2.10.12" />
<PackageVersion Include="Tharga.MongoDB.Mcp" Version="2.10.12" />
<PackageReference Include="Tharga.MongoDB.Mcp" />
paket add Tharga.MongoDB.Mcp --version 2.10.12
#r "nuget: Tharga.MongoDB.Mcp, 2.10.12"
#:package Tharga.MongoDB.Mcp@2.10.12
#addin nuget:?package=Tharga.MongoDB.Mcp&version=2.10.12
#tool nuget:?package=Tharga.MongoDB.Mcp&version=2.10.12
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 countmongodb://monitoring— recent calls, slow queries, latencymongodb://clients— connected MongoDB driver clients
Tools (Metadata level — default)
mongodb.touch— initialise a collection (assure indexes, etc.)mongodb.rebuild_index— drop & recreate a named indexmongodb.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 sortmongodb.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.
| Product | Versions 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. |
-
net10.0
- Tharga.Mcp (>= 0.1.4)
- Tharga.MongoDB (>= 2.10.12)
-
net8.0
- Tharga.Mcp (>= 0.1.4)
- Tharga.MongoDB (>= 2.10.12)
-
net9.0
- Tharga.Mcp (>= 0.1.4)
- Tharga.MongoDB (>= 2.10.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.