MentorAgent Docs
Menu

Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.

ReferencePackage: Novior.MentorAgent

MentorMcpServer class

The MentorMcpServer class of Novior.MentorAgent.Models: Configuration for an external MCP (Model Context Protocol) server that MentorAgent will connect to as…

On this page

Configuration for an external MCP (Model Context Protocol) server that MentorAgent will connect to as a client. The server's tools become available to the coordinator as L1 tools, just like [MentorAction] methods. Usage:

Example
options.McpServers = [
    // stdio transport (local process launched via npx, uvx, etc.)
    new MentorMcpServer {
        Name = "filesystem",
        Command = "npx",
        Arguments = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
        RequiresConfirmation = true
    },
    // HTTP transport (remote MCP server)
    new MentorMcpServer {
        Name = "my-tools",
        ServerUrl = "https://my-mcp-server.example.com/mcp",
        AllowedTools = ["search", "fetch"]
    }
];

Namespace: Novior.MentorAgent.Models. Package: Novior.MentorAgent.

public sealed class MentorMcpServer

Terminal
dotnet add package Novior.MentorAgent

public MentorMcpServer()

public string[]? AllowedTools { get; set; }

If it lists names, only these tools from the MCP server are registered. Null (default) or an empty array registers every tool the server exposes: an empty list is not "none".

public IList<string>? Arguments { get; set; }

Command-line arguments for stdio transport (e.g. ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]).

public string? Command { get; set; }

Executable command for stdio-based MCP servers (e.g. "npx", "uvx", "python"). Mutually exclusive with MentorMcpServer.ServerUrl.

public IDictionary<string, string>? EnvironmentVariables { get; set; }

Optional environment variables passed to the stdio process.

public required string Name { get; set; }

Display name for this server (shown in the MCP status badge).

public bool RequiresConfirmation { get; set; }

When true, the coordinator will ask the user to confirm before calling any tool from this MCP server (same as [MentorAction(RequiresConfirmation=true)]). Default: false

public string? ServerUrl { get; set; }

HTTP/SSE endpoint URL for HTTP-based MCP servers. Mutually exclusive with MentorMcpServer.Command.

public bool? Shared { get; set; }

Whether one connection to this server is shared by every session in the process. null (default) decides by transport: a server reached over MentorMcpServer.ServerUrl is shared, a server started from MentorMcpServer.Command is per session.

The default is the safe reading of each case. A remote endpoint is shared by nature, so pooling the client changes nothing it can observe. A local child process can hold state for the person who started it — @modelcontextprotocol/server-memory is a knowledge graph with no notion of a user — so sharing it would put every visitor in the same store.

Set true for a stdio server you know is stateless, and the process starts one child instead of one per visitor: measured on the sample, two browser tabs were eight node processes and 580 MB. Set false for a URL server that keeps per-connection state.