MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Server

ProtocolServiceCollectionExtensions class

Registers the MCP server and the A2A agent that EndpointRouteBuilderExtensions.MapMentorAgentMcp and EndpointRouteBuilderExtensions.MapMentorAgentA2A map.

View as Markdown
On this page

Until 1.0.0-rc.15 AddMentorAgent registered both itself. They moved to this package with the endpoints (story 105) because their transports need ASP.NET Core, which MentorAgent no longer references — that is what lets a MAUI app reference it on Android, iOS and Mac Catalyst. AddMentorAgentServer() calls both, so a headless host needs nothing more; a Blazor Server host that serves MCP or A2A without the hub calls the one it needs after AddMentorAgent.

Namespace: Novior.MentorAgent.Extensions. Package: Novior.MentorAgent.Server.

public static class ProtocolServiceCollectionExtensions

Terminal
dotnet add package Novior.MentorAgent.Server

public static IServiceCollection AddMentorAgentA2A(this IServiceCollection services)

Registers the A2A agent when MentorOptions.A2AServerEnabled is true, so that app.MapMentorAgentA2A() can map it. Call it after AddMentorAgent():

Example
builder.Services.AddMentorAgent(options => { options.A2AServerEnabled = true; /* ... */ });
builder.Services.AddMentorAgentA2A();
// ...
app.MapMentorAgentA2A();

The flag is read as AddMentorAgent read it, at registration time. Calling this twice, or together with AddMentorAgentServer(), which calls it, registers the agent once. Called before AddMentorAgent() it registers nothing, and the host stops at start-up saying so; the same when A2AServerEnabled is turned on after AddMentorAgent() read it, in a Configure or PostConfigure of MentorOptions.

public static IServiceCollection AddMentorAgentMcp(this IServiceCollection services)

Registers the MCP server when MentorOptions.McpServerEnabled is true, so that app.MapMentorAgentMcp() can map it. Call it after AddMentorAgent():

Example
builder.Services.AddMentorAgent(options => { options.McpServerEnabled = true; /* ... */ });
builder.Services.AddMentorAgentMcp();
// ...
app.MapMentorAgentMcp();

The flag is read as AddMentorAgent read it, at registration time. Calling this twice, or together with AddMentorAgentServer(), which calls it, registers the server once. Called before AddMentorAgent() it registers nothing, and the host stops at start-up saying so; the same when McpServerEnabled is turned on after AddMentorAgent() read it, in a Configure or PostConfigure of MentorOptions.