# MentorAgentBlazorOptions class

> Configuration for AddMentorAgentBlazor(). Provides UI settings for the chat widget and the SignalR hub URL.

- URL: https://docs.mentoragent.net/api/novior-mentoragent-blazor-models/mentoragentblazoroptions
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Blazor

## Definition

Namespace: `Novior.MentorAgent.Blazor.Models`. Package: `Novior.MentorAgent.Blazor`.

`public sealed class MentorAgentBlazorOptions`

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

## Constructors

`public MentorAgentBlazorOptions()`

## Properties

### `AccessTokenProvider`

`public Func<Task<string?>>? AccessTokenProvider { get; set; }`

Supplies the bearer token for the hub connection, called on every connect and reconnect. **Without this the hub sees an anonymous caller**, whatever your application has signed the user in as — which means every `RequiredRoles` action is blocked and the user is keyed as anonymous: with the server's `AnonymousIdentity = PerSession`, the default, memory and `RateLimitPerUser` last only as long as the connection; with `Shared` every user shares the single memory key `"anonymous"` and one global limit. This is the WASM equivalent of the JavaScript client's `accessTokenFactory`, and the server reads the resulting principal off `HubCallerContext.User`. Return `null` while nobody is signed in; the connection then behaves exactly as it did before a provider was set.

```text title="Example"
builder.Services.AddSingleton<TokenStore>();
builder.Services.AddMentorAgentBlazor(options =>
{
    options.HubUrl = "https://api.example.com/mentor-hub";
    options.AccessTokenProvider = () => Task.FromResult(tokenStore.Token);
});
```

### `AiDisclosureMessage`

`public string? AiDisclosureMessage { get; set; }`

The notice's text, shown as written. If null, uses the localized default in [`MentorAgentBlazorOptions.Language`](https://docs.mentoragent.net/api/novior-mentoragent-blazor-models/mentoragentblazoroptions#language).

### `AllowedImageTypes`

`public List<string> AllowedImageTypes { get; set; }`

Client-side MIME allow-list for attachments.

### `AvatarUrl`

`public string? AvatarUrl { get; set; }`

Custom avatar URL.

### `BotName`

`public string BotName { get; set; }`

Bot name shown in the widget header.

### `ConfigureConnection`

`public Action<HttpConnectionOptions>? ConfigureConnection { get; set; }`

Escape hatch applied to the hub's `HttpConnectionOptions` after [`MentorAgentBlazorOptions.AccessTokenProvider`](https://docs.mentoragent.net/api/novior-mentoragent-blazor-models/mentoragentblazoroptions#accesstokenprovider) — custom headers, a transport restriction, cookies, `UseDefaultCredentials`. Use it for anything the options above do not name.

```text title="Example"
options.ConfigureConnection = o => o.Headers["X-Tenant"] = tenantId;
```

### `EnableImageInput`

`public bool EnableImageInput { get; set; }`

Show the image-attachment button and enable paste / drag-and-drop / URL input (roadmap \#13). Must also be enabled server-side (`MentorOptions.EnableImageInput`), which is where attachments are actually validated.

### `EnableOnboardingTour`

`public bool EnableOnboardingTour { get; set; }`

Show the guided tour on first run (roadmap \#18). Default: false.

### `EnableSuggestions`

`public bool EnableSuggestions { get; set; }`

Show suggestion chips in the welcome panel.

### `EnableVoiceInput`

`public bool EnableVoiceInput { get; set; }`

Show microphone button for voice input.

### `EnableVoiceOutput`

`public bool EnableVoiceOutput { get; set; }`

Enable text-to-speech for AI responses.

### `HasMcpServers`

`public bool HasMcpServers { get; set; }`

Whether the server has MCP servers configured (enables the MCP badge).

### `HasRemoteAgents`

`public bool HasRemoteAgents { get; set; }`

Whether the server has remote A2A agents configured (enables the A2A badge).

### `HostedTools`

`public MentorHostedTools HostedTools { get; set; }`

Hosted tools active on the server (roadmap \#15), used to fill the badge. Mirror whatever `MentorOptions.HostedTools` is set to on the Novior.MentorAgent.Server project.

### `HubUrl`

`public string HubUrl { get; set; }`

URL of the Novior.MentorAgent.Server SignalR hub. Default: "/mentor-hub". A relative URL is resolved against the page's base address, as a browser does ("/mentor-hub" against the origin, "mentor-hub" under the app's base path): use it when the server also serves the client. For a server on another origin, set its absolute URL.

### `InputPlaceholder`

`public string? InputPlaceholder { get; set; }`

Input box placeholder text. If null, uses the localized default in [`MentorAgentBlazorOptions.Language`](https://docs.mentoragent.net/api/novior-mentoragent-blazor-models/mentoragentblazoroptions#language).

### `Language`

`public MentorLanguage Language { get; set; }`

Language for widget UI strings.

### `MaxImageBytes`

`public int MaxImageBytes { get; set; }`

Client-side size cap per image, in bytes. Default: 4 MB.

### `MaxImagesPerMessage`

`public int MaxImagesPerMessage { get; set; }`

Client-side cap on images per message. Default: 4.

### `McpServerNames`

`public List<string> McpServerNames { get; set; }`

Names of MCP client servers configured on the server. Used to pre-populate the MCP status badge.

### `Position`

`public ChatPosition Position { get; set; }`

Widget position on screen.

### `PrimaryColor`

`public string? PrimaryColor { get; set; }`

Custom accent color (hex, e.g. "\#7c3aed").

### `RemoteAgentDisplays`

`public List<AgentDisplayInfo> RemoteAgentDisplays { get; set; }`

Remote A2A agents to display in the A2A badge and detail bar.

### `ShowA2AStatus`

`public bool ShowA2AStatus { get; set; }`

Show A2A remote agent status badge in the widget header.

### `ShowAiDisclosure`

`public bool ShowAiDisclosure { get; set; }`

Shows, under the header, the notice that tells people they are talking to an AI assistant, for the whole conversation. Default: true. The marker on each reply (`data-ai-generated`) stays either way.

### `ShowHostedToolsStatus`

`public bool ShowHostedToolsStatus { get; set; }`

Show the provider-hosted tools badge in the widget header (roadmap \#15). Purely informational — the tools themselves are configured and executed server-side.

### `ShowMcpStatus`

`public bool ShowMcpStatus { get; set; }`

Show MCP server connection status badge in the widget header.

### `ShowRagSources`

`public bool ShowRagSources { get; set; }`

Show RAG source citations below AI responses.

### `Theme`

`public MentorTheme Theme { get; set; }`

Visual theme.

### `TourUrl`

`public string TourUrl { get; set; }`

Where to fetch the tour steps from (roadmap \#18). Default: `/mentor/tour`.

A relative value is resolved against [`MentorAgentBlazorOptions.HubUrl`](https://docs.mentoragent.net/api/novior-mentoragent-blazor-models/mentoragentblazoroptions#huburl)'s origin when that is absolute, because the tour is served by the same server as the hub — resolving it against the client app's own address instead would request it from a host that does not have it. Set an absolute URL here to override that entirely.

### `VoiceBargeIn`

`public bool VoiceBargeIn { get; set; }`

Stop playback when the user presses the microphone or sends a message (roadmap \#17). Default: true.

### `VoiceHandsFree`

`public bool VoiceHandsFree { get; set; }`

Hands-free loop — send on silence, reopen the microphone after the answer (roadmap \#17). Default: false.

### `VoiceRate`

`public double VoiceRate { get; set; }`

Speech rate for `SpeechSynthesisUtterance` (0.5–2.0). Default: 1.0.

### `VoiceStreaming`

`public bool VoiceStreaming { get; set; }`

Speak each sentence as it streams instead of reading the answer back (roadmap \#17). Default: true.

### `WelcomeMessage`

`public string? WelcomeMessage { get; set; }`

Welcome message shown when the chat is empty.

---

- Previous: [MentorHubClient class](https://docs.mentoragent.net/api/novior-mentoragent-blazor-hub/mentorhubclient.md)
- Next: [WasmMentorOrchestrator class](https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentororchestrator.md)
