Table of Contents

Interface IMcpServerBuilder

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
ModelContextProtocol.dll

Provides a builder for configuring IMcpServer instances.

public interface IMcpServerBuilder
Extension Methods

Remarks

The IMcpServerBuilder interface provides a fluent API for configuring Model Context Protocol (MCP) servers when using dependency injection. It exposes methods for registering tools, prompts, custom request handlers, and server transports, allowing for comprehensive server configuration through a chain of method calls.

The builder is obtained from the AddMcpServer(IServiceCollection, Action<McpServerOptions>?) extension method and provides access to the underlying service collection via the Services property.

Properties

Services

Gets the associated service collection.

IServiceCollection Services { get; }

Property Value

IServiceCollection