Skip to main content

Definition

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

Syntax

Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration

Summary

Unified configuration for MCP servers supporting both sidecar and middleware deployment modes.

Remarks

This configuration provides a single, unified interface for configuring MCP servers regardless of deployment mode. It supports both standalone (sidecar) and embedded (middleware) deployment patterns with appropriate defaults for each scenario.

Constructors

.ctor

Initializes a new instance of the McpServerConfiguration class.

Syntax

public McpServerConfiguration()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Authentication

Gets or sets the authentication configuration.

Syntax

public Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions Authentication { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Authentication.Models.McpAuthenticationOptions Configuration for user authentication and token validation.

Remarks

Authentication configuration controls how users are authenticated and how tokens are validated and forwarded to the underlying OData service.

Caching

Gets or sets the caching configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration Caching { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.CachingConfiguration Configuration for metadata and tool caching behavior.

Remarks

Caching configuration controls how long metadata and generated tools are cached to improve performance and reduce load on the underlying OData service.

CustomProperties

Gets or sets custom configuration properties.

Syntax

public System.Collections.Generic.Dictionary<string, object> CustomProperties { get; set; }

Property Value

Type: System.Collections.Generic.Dictionary<string, object> A dictionary of custom configuration values.

Remarks

Custom properties allow extending the configuration with application-specific settings that don’t fit into the standard configuration categories.

DeploymentMode

Gets or sets the deployment mode for the MCP server.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode DeploymentMode { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode The deployment mode determining how the server operates.

Remarks

The deployment mode affects how the server discovers metadata, handles authentication, and exposes endpoints. Each mode has different configuration requirements and behaviors.

FeatureFlags

Gets or sets the feature flags configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration FeatureFlags { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.FeatureFlagsConfiguration Configuration for enabling/disabling specific features.

Remarks

Feature flags allow selective enabling of functionality for gradual rollouts, A/B testing, or environment-specific configurations.

Monitoring

Gets or sets the logging and monitoring configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Monitoring { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.MonitoringConfiguration Configuration for logging, metrics, and health monitoring.

Remarks

Monitoring configuration controls what information is logged, how metrics are collected, and what health checks are performed.

Network

Gets or sets the network and transport configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration Network { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.NetworkConfiguration Configuration for network endpoints, ports, and transport protocols.

Remarks

Network configuration specifies how the MCP server exposes its endpoints and communicates with clients and the underlying OData service.

ODataService

Gets or sets the OData service configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration ODataService { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration Configuration for connecting to and interacting with OData services.

Remarks

This configuration specifies how the MCP server discovers and communicates with the underlying OData service, including metadata endpoints and authentication.

Security

Gets or sets the security configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration Security { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.SecurityConfiguration Configuration for security policies and restrictions.

Remarks

Security configuration includes CORS policies, rate limiting, request size limits, and other security-related settings.

ServerInfo

Gets or sets the server information.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.McpServerInfo ServerInfo { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Configuration.McpServerInfo Basic information about the MCP server instance.

Remarks

This information is exposed through the server info endpoint and helps clients understand the capabilities and version of the server.

ToolGeneration

Gets or sets the tool generation configuration.

Syntax

public Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions ToolGeneration { get; set; }

Property Value

Type: Microsoft.OData.Mcp.Core.Tools.McpToolGenerationOptions Options controlling how MCP tools are generated from OData metadata.

Remarks

Tool generation options determine which operations are exposed as MCP tools, how they are named, and what authorization requirements they have.

Methods

ApplyEnvironmentOverrides

Applies environment-specific overrides to the configuration.

Syntax

public void ApplyEnvironmentOverrides(string environment)

Parameters

NameTypeDescription
environmentstringThe environment name (e.g., “Development”, “Production”).

Clone

Creates a deep copy of this configuration.

Syntax

public Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration Clone()

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration A new configuration instance with the same settings.

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

ForDevelopment

Creates a configuration optimized for development environments.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForDevelopment(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode = 1)

Parameters

NameTypeDescription
deploymentModeMicrosoft.OData.Mcp.Core.Configuration.McpDeploymentModeThe deployment mode for development.

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration A configuration instance with development-friendly settings.

ForMiddleware

Creates a configuration optimized for middleware deployment.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForMiddleware(string basePath = "/mcp")

Parameters

NameTypeDescription
basePathstringThe base path for MCP endpoints within the host application.

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration A configuration instance optimized for middleware deployment.

ForProduction

Creates a configuration optimized for production environments.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForProduction(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode = 0)

Parameters

NameTypeDescription
deploymentModeMicrosoft.OData.Mcp.Core.Configuration.McpDeploymentModeThe deployment mode for production.

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration A configuration instance with production-optimized settings.

ForSidecar

Creates a configuration optimized for sidecar deployment.

Syntax

public static Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration ForSidecar(string odataServiceUrl)

Parameters

NameTypeDescription
odataServiceUrlstringThe URL of the OData service to integrate with.

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration A configuration instance optimized for sidecar deployment.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when odataServiceUrl is null or whitespace.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetStatistics

Gets configuration statistics for monitoring and diagnostics.

Syntax

public System.Collections.Generic.Dictionary<string, object> GetStatistics()

Returns

Type: System.Collections.Generic.Dictionary<string, object> A dictionary containing configuration statistics.

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

MergeWith

Merges another configuration into this one, with the other configuration taking precedence.

Syntax

public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration other)

Parameters

NameTypeDescription
otherMicrosoft.OData.Mcp.Core.Configuration.McpServerConfigurationThe configuration to merge into this one.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when other is null.

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?

Validate

Validates the configuration for completeness and consistency.

Syntax

public System.Collections.Generic.IEnumerable<string> Validate()

Returns

Type: System.Collections.Generic.IEnumerable<string> A collection of validation errors, or empty if the configuration is valid.