# Build a Secure C# MCP App with Cross App Access (XAA)

DevFeed: [Build a Secure C# MCP App with Cross App Access (XAA)](<https://devfeed.tech/articles/build-a-secure-c-mcp-app-with-cross-app-access-xaa-15971.md>)

Original publisher: [Read original article](<https://developer.okta.com/blog/2026/07/16/csharp-mcp-cross-app-access>)

Author: Aasawari Sahasrabuddhe

Published: 2026-07-16T05:00:00Z

Content type: tutorial

Language: en

Sources: [Okta Developer](<https://devfeed.tech/sources/okta-developer.md>)

Topics: [cross-app-access](<https://devfeed.tech/topics/cross-app-access.md>), [Model Context Protocol (MCP)](<https://devfeed.tech/topics/model-context-protocol-mcp.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [api](<https://devfeed.tech/tags/api.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [cross-app-access](<https://devfeed.tech/tags/cross-app-access.md>), [csharp](<https://devfeed.tech/tags/csharp.md>), [jwt](<https://devfeed.tech/tags/jwt.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [oauth](<https://devfeed.tech/tags/oauth.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [pkce](<https://devfeed.tech/tags/pkce.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [xaa](<https://devfeed.tech/tags/xaa.md>)

## AI overview

This tutorial explains how Cross App Access (XAA) extends user identity and enterprise policy to downstream applications, MCP servers, APIs, and agent tools. It demonstrates the XAA token-exchange flow and shows how to implement a secure MCP client in C# with an MCP SDK.

## Source excerpt

A few years ago, getting a user signed in to an application or multiple applications with Single Sign-On (SSO) was enough; OpenID Connect (OIDC) handled the login, JWTs carried the claims, and Proof Key for Code Exchange (PKCE) made it secure. Today, with evolving AI, agents act on behalf of users and seek multiple accesses across different resources to execute a task. And that is when you'll hit the gap. The user has an identity, but the downstream service--like a Model Context Protocol (MCP) server, an API, or an agent tool has no way to trust it: the ID Token that proves the user's identity for your app, not for that service. You need a way to take that identity and have it trusted further down the chain, in line with the org's policy, without asking the user to log in again. Cross App Access (XAA) solves exactly that. The user authenticates once. The Identity Provider (IdP) evaluates the enterprise policy and issues a signed Identity Assertion. The downstream service exchanges that assertion for a scoped Bearer token. In this post, we'll explore how Cross App Access (XAA) closes the trust gap, test the flow using an XAA playground, and implement a secure MCP client in just a few lines of C# using our dedicated SDK. Table of Contents What is Cross App Access (XAA)? Implementing XAA with the C# MCP SDK Building the OIDC flow Automate XAA token exchange with C# SDK Connect the MCP client to the server Testing your C# MCP app with xaa.dev Run your C# MCP app with xaa.dev Learn More About Secure AI Agent Development with C# and MCP What is Cross App Access (XAA)? Before we start implementing and building the application, it is important to understand the mechanics of Cross App Access (XAA). At its core, XAA is an open standard that securely enables AI agents to act on behalf of a user and communicate with downstream applications without requiring constant, manual user consent. While the flow is sophisticated, it relies on two standard interactions: RFC 8693 (Token Exc