Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Tools.dll Namespace: Microsoft.OData.Mcp.Tools.Hosting Inheritance: System.Object

Syntax

Summary

The Tools host’s consent presenter: it writes the sign-in URL and user code to stderr and tries to open the operator’s browser, then returns so the outbound OAuth client can complete the grant.

Remarks

Deliberately free of any dependency on an MCP server: this runs during host construction, before a session exists, and blocking the console at that point is the intended behavior. stdout belongs to the MCP transport, so every byte this writes goes to stderr. Nothing here ever prints an access token, a refresh token, or a device code — a user code and a verification URL are the only things a human needs.

Examples

Methods

PresentAsync

Presents a consent request on stderr and best-effort opens it in the operator’s browser.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task A completed task once the request has been written; the grant itself is completed by the caller.

Exceptions

Examples

Remarks

A browser that cannot be launched — a headless container, a locked-down desktop, no shell handler — is not an error: the URL is already on stderr and the operator can open it anywhere, so the failure is swallowed rather than aborting a sign-in that can still succeed.