Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.AspNetCore.dll Namespace: Microsoft.OData.Mcp.AspNetCore.HealthChecks Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.AspNetCore.HealthChecks.McpServerHealthCheck

Summary

Health check for the MCP server functionality.

Remarks

This health check verifies that the core MCP server components are functioning correctly, including metadata parsing, tool registration, and basic connectivity.

Constructors

.ctor

Initializes a new instance of the McpServerHealthCheck class.

Syntax

public McpServerHealthCheck(Microsoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.AspNetCore.HealthChecks.McpServerHealthCheck> logger, Microsoft.OData.Mcp.Core.Tools.IMcpToolFactory toolFactory = null)

Parameters

NameTypeDescription
loggerMicrosoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.AspNetCore.HealthChecks.McpServerHealthCheck>The logger instance.
toolFactoryMicrosoft.OData.Mcp.Core.Tools.IMcpToolFactory?The MCP tool factory (optional).

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when logger is null.

.ctor Inherited

Inherited from object

Syntax

public Object()

Methods

CheckHealthAsync

Checks the health of the MCP server.

Syntax

public System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult> CheckHealthAsync(Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckContext context, System.Threading.CancellationToken cancellationToken = null)

Parameters

NameTypeDescription
contextMicrosoft.Extensions.Diagnostics.HealthChecks.HealthCheckContextThe health check context.
cancellationTokenSystem.Threading.CancellationTokenA cancellation token to cancel the operation.

Returns

Type: System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult> A task that represents the asynchronous health check operation.

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?
  • Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck