Table of Contents

Class MongoDbResourceProvider

Namespace
Tharga.MongoDB.Mcp
Assembly
Tharga.MongoDB.Mcp.dll

Exposes Tharga.MongoDB monitoring data as MCP resources on the System scope.

public sealed class MongoDbResourceProvider : IMcpResourceProvider, IMcpProvider
Inheritance
MongoDbResourceProvider
Implements
IMcpResourceProvider
IMcpProvider
Inherited Members

Constructors

MongoDbResourceProvider(IDatabaseMonitor, MongoDbMcpOptions)

public MongoDbResourceProvider(IDatabaseMonitor monitor, MongoDbMcpOptions options)

Parameters

monitor IDatabaseMonitor
options MongoDbMcpOptions

Properties

Scope

The scope this provider belongs to. Only the matching endpoint will see its contents.

public McpScope Scope { get; }

Property Value

McpScope

Methods

ListResourcesAsync(IMcpContext, CancellationToken)

Lists resources visible to the caller.

public Task<IReadOnlyList<McpResourceDescriptor>> ListResourcesAsync(IMcpContext context, CancellationToken cancellationToken)

Parameters

context IMcpContext
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<McpResourceDescriptor>>

ReadResourceAsync(string, IMcpContext, CancellationToken)

Reads a specific resource by its URI. Must return content for URIs advertised by ListResourcesAsync(IMcpContext, CancellationToken).

public Task<McpResourceContent> ReadResourceAsync(string uri, IMcpContext context, CancellationToken cancellationToken)

Parameters

uri string
context IMcpContext
cancellationToken CancellationToken

Returns

Task<McpResourceContent>