Skip to main content

Definition

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

Syntax

Microsoft.OData.Mcp.Core.Routing.McpEndpointRegistry

Summary

Default implementation of the MCP endpoint registry.

Remarks

This implementation is thread-safe and optimized for concurrent access during application startup when multiple OData routes may be registered simultaneously.

Constructors

.ctor

Initializes a new instance of the McpEndpointRegistry class.

Syntax

public McpEndpointRegistry()

.ctor Inherited

Inherited from object

Syntax

public Object()

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

GetAllEndpoints

Gets all registered endpoints.

Syntax

public System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Routing.McpRouteEntry> GetAllEndpoints()

Returns

Type: System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Routing.McpRouteEntry> A collection of all registered endpoints.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetMcpUrl

Gets the MCP URL for a given OData route.

Syntax

public string GetMcpUrl(string routeName, System.Nullable<Microsoft.OData.Mcp.Core.Routing.McpCommand> command = null)

Parameters

NameTypeDescription
routeNamestringThe OData route name.
commandSystem.Nullable<Microsoft.OData.Mcp.Core.Routing.McpCommand>The MCP command (optional).

Returns

Type: string? The MCP URL, or null if not found.

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

HasEndpoint

Checks if a route has an MCP endpoint registered.

Syntax

public bool HasEndpoint(string routeName)

Parameters

NameTypeDescription
routeNamestringThe OData route name.

Returns

Type: bool True if the route has an MCP endpoint; otherwise, false.

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

Register

Registers an MCP endpoint.

Syntax

public void Register(Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route)

Parameters

NameTypeDescription
routeMicrosoft.OData.Mcp.Core.Routing.McpRouteEntryThe route entry to register.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when route is null.

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?

TryGetEndpoint

Attempts to get an endpoint by path.

Syntax

public bool TryGetEndpoint(string path, out Microsoft.OData.Mcp.Core.Routing.McpRouteEntry route, out Microsoft.OData.Mcp.Core.Routing.McpCommand command)

Parameters

NameTypeDescription
pathstringThe request path.
routeMicrosoft.OData.Mcp.Core.Routing.McpRouteEntry?The matched route entry.
commandMicrosoft.OData.Mcp.Core.Routing.McpCommandThe MCP command.

Returns

Type: bool True if an endpoint was found; otherwise, false.
  • Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry