RESTCLIENT.NET
Menu
EN
↗ GitHub

RESTCLIENT.NET / API REFERENCE

RestClient.Net.McpGenerator.McpServerGenerator

All API types · RestClient.Net.McpGenerator · View source

public static class McpServerGenerator

Generates MCP server code from OpenAPI specifications.

Members

Generate

public static Result<string, string> Generate(string openApiContent, string @namespace, string serverName, string extensionsNamespace, ISet<string>? includeTags = null);

Generates MCP server tools code from an OpenAPI document.

Parameter Type Default Description
openApiContent string Required The OpenAPI document content (JSON or YAML).
namespace string Required The namespace for generated MCP tools.
serverName string Required The MCP server name.
extensionsNamespace string Required The namespace of the pre-generated extensions.
includeTags ISet<string>? null Optional set of tags to include. If specified, only operations with these tags are generated.

Returns: A Result containing the generated C# code or error message.

View source: RestClient.Net.McpGenerator/McpServerGenerator.cs:18