Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Routing Inheritance: System.ObjectSyntax
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
.ctor Inherited
Inherited from
objectSyntax
Methods
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetAllEndpoints
Gets all registered endpoints.Syntax
Returns
Type:System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Routing.McpRouteEntry>
A collection of all registered endpoints.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetMcpUrl
Gets the MCP URL for a given OData route.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
routeName | string | The OData route name. |
command | System.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
objectSyntax
Returns
Type:System.Type
HasEndpoint
Checks if a route has an MCP endpoint registered.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
routeName | string | The OData route name. |
Returns
Type:bool
True if the route has an MCP endpoint; otherwise, false.
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
Register
Registers an MCP endpoint.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
route | Microsoft.OData.Mcp.Core.Routing.McpRouteEntry | The route entry to register. |
Exceptions
| Exception | Description |
|---|---|
ArgumentNullException | Thrown when route is null. |
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
TryGetEndpoint
Attempts to get an endpoint by path.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
path | string | The request path. |
route | Microsoft.OData.Mcp.Core.Routing.McpRouteEntry? | The matched route entry. |
command | Microsoft.OData.Mcp.Core.Routing.McpCommand | The MCP command. |
Returns
Type:bool
True if an endpoint was found; otherwise, false.
Related APIs
- Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry