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
servicesIServiceCollectionThe container to add to.
publishedCategoriesPublishedToolCategorySelectionThe 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
servicesis null.
- See Also
-
AskMailAdvertisementMcpToolAuthorizationMcpToolCategoryPublication