With the rise of AI agents and extensibility through MCP (Model Context Protocol), exposing your APIs and tools to agents like Copilot Studio is becoming increasingly common. But the catch – without proper authentication, you’re opening the doors to your enterprise data.
In this post, we’ll walk through how to secure an MCP Server using Microsoft Entra ID and consume it from Copilot Studio using delegated permissions.
MCP servers allow AI agents to invoke tools and APIs in a standardized way. When integrated with platforms like Microsoft Copilot Studio, they unlock powerful automation scenarios.
However, MCP servers are essentially OAuth 2.0 resource servers, and every MCP client (like Copilot Studio) acts as an OAuth client.
Why Securing Your MCP Server is Important
Without proper authentication:
Anyone with access to the endpoint could invoke your tools
Sensitive operations such as internal APIs may be exposed
No identity context → no auditing or governance
Modern MCP implementations rely on OAuth-based authentication, ensuring:
Identity-aware requests
Scoped access tokens
Secure communication between client and server
In enterprise scenarios, Entra IDbecomes the natural choice.
Prerequisites
Before we begin, make sure you have:
Access to a Microsoft Entra ID tenant
Access to Microsoft Copilot Studio
Basic understanding of:
OAuth 2.0 / Delegated permissions
App registrations
MCP server up and running (use the repo above)
Architecture Overview
We will configure:
MCP Server → Protected resource (API)
Copilot Studio → Client application
Entra ID → Identity provider
Flow:
User signs in via Copilot Studio
Copilot gets delegated token
Token is sent to MCP Server
MCP Server validates and processes request
Step 1: Create App Registration for MCP Server (Resource API)
Go to Entra ID → App registrations → New registration
Configure:
Name: MCP-Server-App
Supported account types: Single Tenant
After creation:
Copy the Client Id, Tenant Id from the Overview section.
Expose an API
Go to Expose an API
Set Application ID URI (e.g., api://xxx-xxxx)
Add a scope:
Name: access_as_user
Who can consent: Admins + users
Configure Permissions
Add required Microsoft Graph delegated permissions (if needed) or remove it.
This app represents your secured MCP Server
Step 2: Configure MCP Server with Entra ID
In your MCP server, appsettings.json (from repo):
Configure:
Tenant ID
Client ID (MCP Server app)
Scopes
This allows the server to:
Validate incoming tokens
Optionally call APIs like Microsoft Graph
Many MCP implementations use OAuth flows such as on-behalf-of (OBO)/delegates permissions to call APIs using the user’s identity.
Step 3: Create App Registration for Copilot Studio (Client)
Create another app:
Name: Copilot-MCP-Client
Supported Account Types: Single tenant only
Configure:
API Permissions
Add permission:
My APIs → MCP-Server-App
Select: access_as_user (delegated)
Copy the Client Id, secret and the OAuth endpoints for adding the MCP server in Copilot studio interface.
Grant Admin Consent
This step is not Mandatory, if not provided an admin consent the user will asked for a consent with the permissions for the app while creating the connection to the MCP Server.
Step 4: Add MCP Server in Copilot Studio
Now comes the interesting part.
In Copilot Studio:
Go to Tools
Click + Add a tool > Model Context Protocol
Provide the details from the Copilot Studio Client app registration and MCP endpoint (e.g., /mcp or /)
Copilot Studio will:
Create a custom connector behind the scenes
On the next screen, you will get the link to the redirect url
Now go to the Copilot studio client app registration Authentication section under Manage blade
Add Redirect URI (important for Copilot Studio custom connector)
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Discover more from 365 Community Online
Subscribe now to keep reading and get access to the full archive.