Skip to content

docs(w365): document MCP server authentication + minimal request example - #335

Merged
Bertrand Desmarest (desmarest) merged 1 commit into
microsoft:mainfrom
desmarest:docs/w365-mcp-authentication
Aug 3, 2026
Merged

docs(w365): document MCP server authentication + minimal request example#335
Bertrand Desmarest (desmarest) merged 1 commit into
microsoft:mainfrom
desmarest:docs/w365-mcp-authentication

Conversation

@desmarest

Copy link
Copy Markdown
Contributor

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.md was vague on this).

Contents

  • Endpoint — production gateway URL and local-dev (McpServer:Url).
  • Token — the agent-identity ("agentic") bearer token: resource/audience app ID, scope string, and the Tools.ListInvoke.All delegated scope; how it's acquired in production (A365 SDK w365 handler) vs. local dev (Get-CuaAgentUserToken.ps1BEARER_TOKEN).
  • HeadersAuthorization: Bearer <token> is the only required header; optional x-ms-* correlation headers noted inline. Agent identity is carried by the token (no separate identity header).
  • Minimal request example — JSON-RPC tools/call for StartSessionGetSessionDetails, plus the equivalent .NET SseClientTransportOptions snippet.
  • Adds the missing w365 handler 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.

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 AI review requested due to automatic review settings July 31, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/call example for StartSessionGetSessionDetails.
  • Adds the missing w365 handler 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 omits x-ms-agentid, which the sample sends on every W365 connection (see ComputerUseOrchestrator.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.cs for where headers are attached, but that file doesn’t create the SSE transport / headers. The transport options (including x-ms-agentid and other x-ms-* headers) are built in ComputerUseOrchestrator.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`):

Comment thread dotnet/w365-computer-use/sample-agent/README.md
@desmarest
Bertrand Desmarest (desmarest) merged commit 87dca88 into microsoft:main Aug 3, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants