Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.Core.ODataMcpOptions

Summary

Configuration options for OData MCP integration.

Constructors

.ctor

Syntax

public ODataMcpOptions()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

AllowedOrigins

Gets or sets the allowed CORS origins.

Syntax

public string[] AllowedOrigins { get; set; }

Property Value

Type: string[] An array of allowed origins. Default allows all origins (”*”).

AutoDiscoverMetadata

Gets or sets whether to auto-discover metadata.

Syntax

public bool AutoDiscoverMetadata { get; set; }

Property Value

Type: bool true to auto-discover metadata; otherwise, false. Default is true.

AutoRegisterRoutes

Gets or sets a value indicating whether to automatically register MCP endpoints for all OData routes.

Syntax

public bool AutoRegisterRoutes { get; set; }

Property Value

Type: bool true to automatically register MCP endpoints; otherwise, false. Default is true.

BasePath

Gets or sets the base path for MCP endpoints.

Syntax

public string BasePath { get; set; }

Property Value

Type: string The base path for MCP endpoints. Default is “/mcp”.

CacheDuration

Gets or sets the cache duration for dynamic content.

Syntax

public System.TimeSpan CacheDuration { get; set; }

Property Value

Type: System.TimeSpan The duration to cache dynamic content. Default is 5 minutes.

DefaultPageSize

Gets or sets the default page size for query operations.

Syntax

public int DefaultPageSize { get; set; }

Property Value

Type: int The default page size. Default is 100.

EnableCaching

Gets or sets whether to enable caching.

Syntax

public bool EnableCaching { get; set; }

Property Value

Type: bool true to enable caching; otherwise, false. Default is true.

EnableCors

Gets or sets a value indicating whether to enable CORS for MCP endpoints.

Syntax

public bool EnableCors { get; set; }

Property Value

Type: bool true to enable CORS; otherwise, false. Default is true.

Enabled

Gets or sets whether to enable MCP endpoints.

Syntax

public bool Enabled { get; set; }

Property Value

Type: bool true to enable MCP endpoints; otherwise, false. Default is true.

EnableDetailedErrors

Gets or sets whether to enable detailed error messages.

Syntax

public bool EnableDetailedErrors { get; set; }

Property Value

Type: bool true to enable detailed error messages; otherwise, false. Default is false.

EnableDynamicModels

Gets or sets a value indicating whether to enable dynamic model updates.

Syntax

public bool EnableDynamicModels { get; set; }

Property Value

Type: bool true to enable dynamic models; otherwise, false. Default is false for performance.

EnableRequestLogging

Gets or sets a value indicating whether to enable request logging.

Syntax

public bool EnableRequestLogging { get; set; }

Property Value

Type: bool true to enable detailed request logging; otherwise, false. Default is false.

ExcludeRoutes

Gets or sets the routes to exclude from automatic MCP registration.

Syntax

public string[] ExcludeRoutes { get; set; }

Property Value

Type: string[] An array of route names to exclude. Default is an empty array.

IncludeMetadata

Gets or sets a value indicating whether to include metadata in tool descriptions.

Syntax

public bool IncludeMetadata { get; set; }

Property Value

Type: bool true to include detailed metadata; otherwise, false. Default is true.

MaxPageSize

Gets or sets the maximum page size for query operations.

Syntax

public int MaxPageSize { get; set; }

Property Value

Type: int The maximum page size. Default is 1000.

MaxRequestSize

Gets or sets the maximum request size for tool execution.

Syntax

public long MaxRequestSize { get; set; }

Property Value

Type: long The maximum request size in bytes. Default is 1MB (1,048,576 bytes).

MaxToolsPerEntity

Gets or sets the maximum number of tools to generate per entity.

Syntax

public System.Nullable<int> MaxToolsPerEntity { get; set; }

Property Value

Type: System.Nullable<int> The maximum number of tools per entity, or null for unlimited. Default is null.

ModelRefreshInterval

Gets or sets the interval for refreshing dynamic models.

Syntax

public System.TimeSpan ModelRefreshInterval { get; set; }

Property Value

Type: System.TimeSpan The interval for refreshing dynamic models. Default is 1 hour.

RequestTimeout

Gets or sets the request timeout.

Syntax

public System.TimeSpan RequestTimeout { get; set; }

Property Value

Type: System.TimeSpan The request timeout. Default is 2 minutes.

ToolNamingPattern

Gets or sets the tool naming pattern.

Syntax

public string ToolNamingPattern { get; set; }

Property Value

Type: string The pattern for generating tool names. Default is ”..”. Available placeholders: , , .

UseAggressiveCaching

Gets or sets a value indicating whether to use aggressive caching.

Syntax

public bool UseAggressiveCaching { get; set; }

Property Value

Type: bool true to use aggressive caching with ETags and long expiration; otherwise, false. Default is true.

Methods

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?