MCP HubMCP Hub
dend

entra-id-mcp-server-session-demo

by: dend

Demo showing how to use Entra ID with MCP servers without passing access tokens through.

9created 14/03/2025
Visit
Entra
authentication

📌Overview

Purpose: This framework aims to demonstrate the implementation of Entra ID authentication in an MCP server using HTTP+SSE transport.

Overview: The Minimal Entra ID-authenticated MCP Server provides a simple model for integrating Entra ID authentication with the Model Context Protocol (MCP). It utilizes a confidential client within the MCP server and employs session mapping for session assignment through a JWT-like token, avoiding the use of cookies.

Key Features:

  • Confidential Client Integration: Implements a confidential client within the server to securely manage authentication and session assignments.

  • Session Mapping with JWT: Utilizes session mapping to assign JWT tokens for session tracking, enhancing security and compliance with session management practices.


🔒 Minimal Entra ID-authenticated MCP Server

This server demonstrates how to implement Entra ID authentication with MCP using HTTP+SSE transport. It features a confidential client integrated within the MCP server, utilizing "session mapping" to manage session assignments through JWT tokens instead of cookies.

Warning: This implementation is not intended for production use. If you choose to adopt any practices from this implementation, ensure you implement proper caching and secure token handling.

Run the Server

To get started, run the following commands:

npm install
npm run build
npm run start

Testing

Use MCP Inspector or a compatible tool that supports HTTP+SSE transport for MCP servers and authentication.