Table of Contents

Method AddMailFathomServer

Namespace
MailFathom.Mcp
Assembly
MailFathom.Mcp.dll

AddMailFathomServer(IServiceCollection, PublishedToolCategorySelection?)

Adds the MailFathom MCP server, its tools, and the reporting that wraps every tool call.

public static IMcpServerBuilder AddMailFathomServer(this IServiceCollection services, PublishedToolCategorySelection? publishedCategories = null)

Parameters

services IServiceCollection

The container to add to.

publishedCategories PublishedToolCategorySelection

The kinds of tool this endpoint publishes, or null to publish every one of them.

Returns

IMcpServerBuilder

The builder, so a caller can extend the server registration.

Remarks

The tools resolve their dependencies per call from the request's scope, so the application ports they read through may be registered with any lifetime the host chooses — which is also what lets a filter read the caller the request was admitted under.

The selection is a parameter rather than a setting this project reads, because which categories a deployment publishes is written in its configuration and configuration is the host's to bind. Omitting it publishes every category, which is what a deployment that names none has.

Exceptions

ArgumentNullException

Thrown when services is null.

See Also
AskMailAdvertisement
McpToolAuthorization
McpToolCategoryPublication