Class McpServerController
- Namespace
- nanoFramework.WebServer.Mcp
- Assembly
- nanoFramework.WebServer.Mcp.dll
McpServerController class provides endpoints for handling requests related to MCP (Model Context Protocol) tools.
public class McpServerController
- Inheritance
-
McpServerController
- Derived
- Inherited Members
- Extension Methods
Constructors
McpServerController()
public McpServerController()
Fields
SupportedVersion
The supported version of the MCP protocol.
public const string SupportedVersion = "2025-03-26"
Field Value
Properties
Instructions
Gets or sets the instructions for using the MCP server.
public static string Instructions { get; set; }
Property Value
ServerName
Gets or sets the server name.
public static string ServerName { get; set; }
Property Value
ServerVersion
Gets or sets the server version.
public static string ServerVersion { get; set; }
Property Value
Methods
HandleMcpRequest(WebServerEventArgs)
Handles POST requests to the "mcp" route. Processes the incoming request, invokes the specified tool with provided parameters, and writes the result to the response stream in JSON format.
[Route("mcp")]
[Method("POST")]
public void HandleMcpRequest(WebServerEventArgs e)
Parameters
eWebServerEventArgsThe web server event arguments containing the HTTP context and request/response information.