CodeEffectsMcpBuilder Class
Assembly: CodeEffects.Rule.Mcp.dll
Namespace: CodeEffects.Rule.Mcp
Summary
Returned by AddCodeEffectsMcp(..). You add the libraries the MCP server offers to it, one extension method for each.
Syntax
public sealed class CodeEffectsMcpBuilder
You never create this class. AddCodeEffectsMcp(..) returns it, and each of WithRepository(..) (RepositoryMcpExtensions) and WithAudit(..) (AuditMcpExtensions) returns it again, so the calls chain.
Add each library at most once. Adding the same library a second time throws an InvalidOperationException. The order in which you add the libraries makes no difference.
Properties
Services
Type: Microsoft.Extensions.DependencyInjection.IServiceCollection
Gets the application's services, the collection AddCodeEffectsMcp(..) was called on. The property is read-only.
Example
using CodeEffects.Rule.Mcp;
CodeEffectsMcpBuilder mcp = builder.Services.AddCodeEffectsMcp(o => o.MapCaller = mapCaller);
mcp.WithRepository(r => r.DbProvider = dbProvider);
mcp.WithAudit(a => a.DbProvider = dbProvider);