Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Routing

Syntax

Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry

Summary

Manages the registration and discovery of MCP endpoints.

Methods

GetAllEndpoints Abstract

Gets all registered endpoints.

Syntax

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.

GetMcpUrl Abstract

Gets the MCP URL for a given OData route.

Syntax

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.

HasEndpoint Abstract

Checks if a route has an MCP endpoint registered.

Syntax

bool HasEndpoint(string routeName)

Parameters

NameTypeDescription
routeNamestringThe OData route name.

Returns

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

Register Abstract

Registers an MCP endpoint.

Syntax

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

Parameters

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

TryGetEndpoint Abstract

Attempts to get an endpoint by path.

Syntax

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.