docs(w365): document MCP server authentication + minimal request example - #335
Merged
Bertrand Desmarest (desmarest) merged 1 commit intoAug 3, 2026
Conversation
Documents the auth contract for calling the W365 Computer Use MCP server: endpoint forms, the agent-identity bearer token (resource da81128c-.../.default, scope Tools.ListInvoke.All), how the gateway resolves agent identity from the token (appid/azp claims; canonical identity-override header x-ms-entra-agent-id), the request headers, and minimal JSON-RPC / SDK request examples. Also adds the missing w365 handler scope row to the Configuration Reference table. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d2d5f471-61b9-4142-ab74-6b965134fb5d
Copilot started reviewing on behalf of
Bertrand Desmarest (desmarest)
July 31, 2026 16:54
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the W365 Computer Use sample documentation to explain how third-party agents authenticate to the W365 Computer Use MCP server, including endpoint details, required OAuth bearer token audience/scope, and a minimal JSON-RPC request flow.
Changes:
- Adds a new “Authentication to the W365 Computer Use MCP server” section covering endpoint, token acquisition, and headers.
- Documents a minimal JSON-RPC
tools/callexample forStartSession→GetSessionDetails. - Adds the missing
w365handler scopes row to the Configuration Reference table.
Suppressed comments (2)
dotnet/w365-computer-use/sample-agent/README.md:199
- The “Headers” section lists optional
x-ms-*headers but omitsx-ms-agentid, which the sample sends on every W365 connection (seeComputerUseOrchestrator.CreateW365TransportOptions). This makes the guidance incomplete and also conflicts with the earlier “no separate identity header” statement.
Only one header is required: `Authorization: Bearer <token>` for the resource above. The sample also sends a few optional `x-ms-*` correlation headers (`x-ms-conversation-id`, `x-ms-channel-id`, `x-ms-user-message-id`, `x-ms-user-agent`) for telemetry — none are required.
> **Note:** the calling agent's identity is taken from the bearer token itself — you don't send a separate identity header.
dotnet/w365-computer-use/sample-agent/README.md:237
- This section points readers to
ComputerUse/W365McpSessionClient.csfor where headers are attached, but that file doesn’t create the SSE transport / headers. The transport options (includingx-ms-agentidand otherx-ms-*headers) are built inComputerUseOrchestrator.CreateW365TransportOptions, so the reference and code snippet should be updated to match the real implementation.
In .NET, the sample uses the MCP SDK rather than hand-rolling JSON-RPC — it attaches the headers via `SseClientTransportOptions.AdditionalHeaders` and calls `IMcpClient.CallToolAsync(...)` (see `ComputerUse/W365McpSessionClient.cs`):
Denzel Pfeifer (denzelpfeifer)
approved these changes
Jul 31, 2026
Gio (GiovanniBenitez)
self-requested a review
August 3, 2026 16:17
Gio (GiovanniBenitez)
approved these changes
Aug 3, 2026
Bertrand Desmarest (desmarest)
merged commit Aug 3, 2026
87dca88
into
microsoft:main
26 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an Authentication section to the W365 Computer Use sample README documenting how a third-party agent authenticates to the W365 Computer Use MCP server, plus a minimal request example. Fills a gap flagged by the W365 team (their
authentication.mdwas vague on this).Contents
McpServer:Url).Tools.ListInvoke.Alldelegated scope; how it's acquired in production (A365 SDKw365handler) vs. local dev (Get-CuaAgentUserToken.ps1→BEARER_TOKEN).Authorization: Bearer <token>is the only required header; optionalx-ms-*correlation headers noted inline. Agent identity is carried by the token (no separate identity header).tools/callforStartSession→GetSessionDetails, plus the equivalent .NETSseClientTransportOptionssnippet.w365handler scope row to the Configuration Reference table.Notes
Docs-only change. Content verified against the sample source (
ComputerUseOrchestrator,W365McpSessionClient) and scoped to the consumer-facing contract — no server-side implementation details.