Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
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:
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"]
}
];Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Models. Package: Novior.MentorAgent.
public sealed class MentorMcpServer
dotnet add package Novior.MentorAgentConstructors
Section titled “Constructors”public MentorMcpServer()
Properties
Section titled “Properties”AllowedTools
Section titled “AllowedTools”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".
Arguments
Section titled “Arguments”public IList<string>? Arguments { get; set; }
Command-line arguments for stdio transport (e.g. ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]).
Command
Section titled “Command”public string? Command { get; set; }
Executable command for stdio-based MCP servers (e.g. "npx", "uvx", "python"). Mutually exclusive with MentorMcpServer.ServerUrl.
EnvironmentVariables
Section titled “EnvironmentVariables”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).
RequiresConfirmation
Section titled “RequiresConfirmation”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
ServerUrl
Section titled “ServerUrl”public string? ServerUrl { get; set; }
HTTP/SSE endpoint URL for HTTP-based MCP servers. Mutually exclusive with MentorMcpServer.Command.
Shared
Section titled “Shared”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.
