Skip to main content

Definition

Assembly: ModelContextProtocol.dll Namespace: Microsoft.Extensions.DependencyInjection

Syntax

Microsoft.Extensions.DependencyInjection.IMcpServerBuilder

Summary

This type is defined in ModelContextProtocol.

Methods

WithODataTools Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions
Configures the OData MCP Server to use the official MCP SDK.

Syntax

public static Microsoft.Extensions.DependencyInjection.IMcpServerBuilder WithODataTools(Microsoft.Extensions.DependencyInjection.IMcpServerBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.DependencyInjection.IMcpServerBuilderThe MCP server builder.

Returns

Type: Microsoft.Extensions.DependencyInjection.IMcpServerBuilder The MCP server builder for chaining.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when builder is null.

Examples

services.AddMcpServer()
    .WithODataTools()
    .WithStdioTransport();

Remarks

Registers all OData tools from the Core assembly with the MCP server builder. This method is used when integrating with the official ModelContextProtocol SDK.