> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ODataServiceConfiguration

> Configuration for connecting to and interacting with OData services.

export function DocsBadge({text, variant = 'neutral'}) {
  const variantClasses = {
    success: 'mint-bg-green-500/10 mint-text-green-600 dark:mint-text-green-400 mint-border-green-500/20',
    neutral: 'mint-bg-slate-500/10 mint-text-slate-600 dark:mint-text-slate-400 mint-border-slate-500/20',
    info: 'mint-bg-blue-500/10 mint-text-blue-600 dark:mint-text-blue-400 mint-border-blue-500/20',
    warning: 'mint-bg-amber-500/10 mint-text-amber-600 dark:mint-text-amber-400 mint-border-amber-500/20',
    danger: 'mint-bg-red-500/10 mint-text-red-600 dark:mint-text-red-400 mint-border-red-500/20'
  };
  const classes = variantClasses[variant] || variantClasses.neutral;
  return <span className={`mint-inline-flex mint-items-center mint-px-2 mint-py-0.5 mint-rounded-full mint-text-xs mint-font-medium mint-tracking-wide mint-border mint-ml-1.5 mint-align-middle mint-whitespace-nowrap ${classes}`}>
      {text}
    </span>;
}

## Definition

**Assembly:** Microsoft.OData.Mcp.Core.dll

**Namespace:** Microsoft.OData.Mcp.Core.Configuration

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration
```

## Summary

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, authentication,
and operational parameters.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

Initializes a new instance of the [ODataServiceConfiguration](/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Configuration/ODataServiceConfiguration) class.

#### Syntax

```csharp theme={"dark"}
public ODataServiceConfiguration()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Authentication

Gets or sets the authentication configuration for the OData service.

#### Syntax

```csharp theme={"dark"}
public Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration Authentication { get; set; }
```

#### Property Value

Type: `Microsoft.OData.Mcp.Core.Configuration.ODataAuthenticationConfiguration`
Configuration for authenticating with the OData service.

#### Remarks

This configuration specifies how the MCP server authenticates with the
underlying OData service when making requests on behalf of users.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  AutoDiscoverMetadata

Gets or sets a value indicating whether to automatically discover metadata.

#### Syntax

```csharp theme={"dark"}
public bool AutoDiscoverMetadata { get; set; }
```

#### Property Value

Type: `bool`
`true` to automatically fetch and parse metadata; otherwise, `false`.

#### Remarks

When enabled, the MCP server will automatically fetch metadata from the configured
endpoint and generate tools based on the discovered schema.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  BaseUrl

Gets or sets the base URL of the OData service.

#### Syntax

```csharp theme={"dark"}
public string BaseUrl { get; set; }
```

#### Property Value

Type: `string?`
The root URL of the OData service.

#### Remarks

For sidecar deployments, this is the external URL of the OData service.
For middleware deployments, this can be null to use the host application's base URL.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  CustomProperties

Gets or sets custom configuration properties.

#### Syntax

```csharp theme={"dark"}
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 service-specific
settings that don't fit into the standard configuration properties.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  DefaultHeaders

Gets or sets the default headers to include in OData requests.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.Dictionary<string, string> DefaultHeaders { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.Dictionary<string, string>`
A dictionary of header name-value pairs to include in all requests.

#### Remarks

These headers will be added to all HTTP requests made to the OData service
and can be used for custom authentication, tracing, or service identification.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  FollowNextLinks

Gets or sets a value indicating whether to follow next links in paged results.

#### Syntax

```csharp theme={"dark"}
public bool FollowNextLinks { get; set; }
```

#### Property Value

Type: `bool`
`true` to automatically follow next links; otherwise, `false`.

#### Remarks

When enabled, the MCP server will automatically follow OData next links
to retrieve additional pages of results.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MaxPages

Gets or sets the maximum number of pages to follow.

#### Syntax

```csharp theme={"dark"}
public int MaxPages { get; set; }
```

#### Property Value

Type: `int`
The maximum number of result pages to retrieve.

#### Remarks

This setting prevents infinite loops when following next links and
limits the total amount of data retrieved in a single operation.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MaxPageSize

Gets or sets the maximum page size for query results.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<int> MaxPageSize { get; set; }
```

#### Property Value

Type: `System.Nullable<int>`
The maximum number of entities to return in a single query response.

#### Remarks

This setting helps prevent excessively large responses that could impact
performance or memory usage. Set to null for no limit.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MaxRetryAttempts

Gets or sets the maximum number of retry attempts for failed requests.

#### Syntax

```csharp theme={"dark"}
public int MaxRetryAttempts { get; set; }
```

#### Property Value

Type: `int`
The number of retry attempts for failed HTTP requests.

#### Remarks

When requests to the OData service fail due to transient errors,
the MCP server will retry up to this number of times.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MetadataPath

Gets or sets the path to the OData metadata endpoint.

#### Syntax

```csharp theme={"dark"}
public string MetadataPath { get; set; }
```

#### Property Value

Type: `string`
The relative path to the metadata endpoint (typically "/\$metadata").

#### Remarks

This path is appended to the base URL to construct the full metadata endpoint URL.
The metadata endpoint must return CSDL (Common Schema Definition Language) XML.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  RefreshInterval

Gets or sets the interval for refreshing metadata.

#### Syntax

```csharp theme={"dark"}
public System.TimeSpan RefreshInterval { get; set; }
```

#### Property Value

Type: `System.TimeSpan`
The time interval between metadata refresh attempts.

#### Remarks

The MCP server will periodically refresh metadata to detect schema changes.
Set to [Zero](https://learn.microsoft.com/dotnet/api/system.timespan.zero) to disable automatic refresh.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  RequestTimeout

Gets or sets the timeout for HTTP requests to the OData service.

#### Syntax

```csharp theme={"dark"}
public System.TimeSpan RequestTimeout { get; set; }
```

#### Property Value

Type: `System.TimeSpan`
The maximum time to wait for HTTP responses.

#### Remarks

This timeout applies to all HTTP requests made to the OData service,
including metadata discovery and data operations.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  RetryDelay

Gets or sets the base delay for retry attempts.

#### Syntax

```csharp theme={"dark"}
public System.TimeSpan RetryDelay { get; set; }
```

#### Property Value

Type: `System.TimeSpan`
The initial delay before the first retry attempt.

#### Remarks

Subsequent retries will use exponential backoff based on this initial delay.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  SupportedODataVersions

Gets or sets the supported OData versions.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> SupportedODataVersions { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A list of OData versions supported by the service.

#### Remarks

This information helps the MCP server understand which OData features
are available and how to construct appropriate requests.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  UseHostContext

Gets or sets a value indicating whether to use the host application context.

#### Syntax

```csharp theme={"dark"}
public bool UseHostContext { get; set; }
```

#### Property Value

Type: `bool`
`true` to use host context for middleware deployments; otherwise, `false`.

#### Remarks

When enabled in middleware deployments, the MCP server will use the host
application's HTTP context to make requests to the OData service.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ValidateSSL

Gets or sets a value indicating whether to validate SSL certificates.

#### Syntax

```csharp theme={"dark"}
public bool ValidateSSL { get; set; }
```

#### Property Value

Type: `bool`
`true` to validate SSL certificates; otherwise, `false`.

#### Remarks

For development environments, SSL validation can be disabled to work
with self-signed certificates. This should always be enabled in production.

## Methods

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  AddCustomProperty

Adds a custom property to the configuration.

#### Syntax

```csharp theme={"dark"}
public void AddCustomProperty(string key, object value)
```

#### Parameters

| Name    | Type     | Description         |
| ------- | -------- | ------------------- |
| `key`   | `string` | The property key.   |
| `value` | `object` | The property value. |

#### Exceptions

| Exception           | Description                              |
| ------------------- | ---------------------------------------- |
| `ArgumentException` | Thrown when *key* is null or whitespace. |

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  AddDefaultHeader

Adds a default header to be included in all OData requests.

#### Syntax

```csharp theme={"dark"}
public void AddDefaultHeader(string name, string value)
```

#### Parameters

| Name    | Type     | Description       |
| ------- | -------- | ----------------- |
| `name`  | `string` | The header name.  |
| `value` | `string` | The header value. |

#### Exceptions

| Exception           | Description                               |
| ------------------- | ----------------------------------------- |
| `ArgumentException` | Thrown when *name* is null or whitespace. |

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Clone

Creates a copy of this configuration.

#### Syntax

```csharp theme={"dark"}
public Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration Clone()
```

#### Returns

Type: `Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration`
A new instance with the same settings.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetCustomProperty

Gets a custom property value.

#### Syntax

```csharp theme={"dark"}
public T GetCustomProperty<T>(string key)
```

#### Parameters

| Name  | Type     | Description       |
| ----- | -------- | ----------------- |
| `key` | `string` | The property key. |

#### Returns

Type: `T?`
The property value if found and of the correct type; otherwise, the default value.

#### Type Parameters

* `T` - The type of the property value.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetEntitySetUrl

Gets the full URL for an OData entity set.

#### Syntax

```csharp theme={"dark"}
public string GetEntitySetUrl(string entitySetName, string hostBaseUrl = null)
```

#### Parameters

| Name            | Type      | Description                                   |
| --------------- | --------- | --------------------------------------------- |
| `entitySetName` | `string`  | The name of the entity set.                   |
| `hostBaseUrl`   | `string?` | The host base URL for middleware deployments. |

#### Returns

Type: `string`
The complete URL to the entity set.

#### Exceptions

| Exception           | Description                                        |
| ------------------- | -------------------------------------------------- |
| `ArgumentException` | Thrown when *entitySetName* is null or whitespace. |

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetHashCode <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetMetadataUrl

Gets the full metadata URL for the OData service.

#### Syntax

```csharp theme={"dark"}
public string GetMetadataUrl(string hostBaseUrl = null)
```

#### Parameters

| Name          | Type      | Description                                   |
| ------------- | --------- | --------------------------------------------- |
| `hostBaseUrl` | `string?` | The host base URL for middleware deployments. |

#### Returns

Type: `string`
The complete URL to the metadata endpoint.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetType <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MemberwiseClone <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MergeWith

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

#### Syntax

```csharp theme={"dark"}
public void MergeWith(Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration other)
```

#### Parameters

| Name    | Type                                                               | Description                               |
| ------- | ------------------------------------------------------------------ | ----------------------------------------- |
| `other` | `Microsoft.OData.Mcp.Core.Configuration.ODataServiceConfiguration` | The configuration to merge into this one. |

#### Exceptions

| Exception               | Description                  |
| ----------------------- | ---------------------------- |
| `ArgumentNullException` | Thrown when *other* is null. |

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ReferenceEquals <DocsBadge text="Inherited" variant="neutral" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  RemoveDefaultHeader

Removes a default header.

#### Syntax

```csharp theme={"dark"}
public bool RemoveDefaultHeader(string name)
```

#### Parameters

| Name   | Type     | Description                |
| ------ | -------- | -------------------------- |
| `name` | `string` | The header name to remove. |

#### Returns

Type: `bool`
`true` if the header was removed; otherwise, `false`.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Validate

Validates the OData service configuration.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<string> Validate(Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode deploymentMode)
```

#### Parameters

| Name             | Type                                                       | Description                                          |
| ---------------- | ---------------------------------------------------------- | ---------------------------------------------------- |
| `deploymentMode` | `Microsoft.OData.Mcp.Core.Configuration.McpDeploymentMode` | The deployment mode for context-specific validation. |

#### Returns

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