# ServerServiceExtensions class

> The ServerServiceExtensions class of Novior.MentorAgent.Server.Extensions: Extension methods for registering Novior.MentorAgent.Server services.

- URL: https://docs.mentoragent.net/api/novior-mentoragent-server-extensions/serverserviceextensions
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Server

Extension methods for registering Novior.MentorAgent.Server services.

## Definition

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

`public static class ServerServiceExtensions`

```shell
dotnet add package Novior.MentorAgent.Server
```

## Methods

### `AddMentorAgentServer`

`public static IServiceCollection AddMentorAgentServer(this IServiceCollection services)`

Adds the MentorAgent SignalR hub and server-side infrastructure. Call this after `AddMentorAgent()` in Program.cs. Then call `app.MapMentorAgentServer()` to expose the endpoints.

```text title="Example"
builder.Services.AddMentorAgent(options => { ... });
builder.Services.AddMentorAgentServer();
```

It also calls `AddMentorAgentMcp()` and `AddMentorAgentA2A()`, which register the MCP server and the A2A agent when `McpServerEnabled` / `A2AServerEnabled` are set, for `app.MapMentorAgentMcp()` and `app.MapMentorAgentA2A()`.

---

- Previous: [ServerEndpointExtensions class](https://docs.mentoragent.net/api/novior-mentoragent-server-extensions/serverendpointextensions.md)
- Next: [HubPageContextStore class](https://docs.mentoragent.net/api/novior-mentoragent-server-hubs/hubpagecontextstore.md)
