Definition
Assembly: ModelContextProtocol.dll
Namespace: Microsoft.Extensions.DependencyInjection
Syntax
Microsoft.Extensions.DependencyInjection.IMcpServerBuilder
Summary
This type is defined in ModelContextProtocol.
Methods
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
| Name | Type | Description |
builder | Microsoft.Extensions.DependencyInjection.IMcpServerBuilder | The MCP server builder. |
Returns
Type: Microsoft.Extensions.DependencyInjection.IMcpServerBuilder
The MCP server builder for chaining.
Exceptions
| Exception | Description |
ArgumentNullException | Thrown when builder is null. |
Examples
services.AddMcpServer()
.WithODataTools()
.WithStdioTransport();
Registers all OData tools from the Core assembly with the MCP server builder.
This method is used when integrating with the official ModelContextProtocol SDK.