Back to MCP directory
publicPublicdnsLocal runtime

entra-id-mcp-server-session-demo

一个展示如何实现Entra ID认证的MCP服务器最小化示例,使用HTTP+SSE传输协议。

article

README

🚀 最小的 Entra ID 鉴权 MCP 服务器

这是一个最小的服务器示例,展示了如何在 MCP 中运用 Entra ID 鉴权以及 HTTP+SSE 传输。与以往的服务器实现有所不同,该实现依赖于驻留在 MCP 服务器内部的一个机密客户端,通过类似 JWT 令牌(由于不能使用 cookie)的方式进行“会话映射”,以此确保客户端获得会话分配。

⚠️ 重要提示

此存储库已归档。有关最新示例和最佳实践,请参考参考集合

💡 使用建议

这不是用于生产环境的实现。如果您要采用此实现中的任何做法,请确保实施适当的缓存和安全令牌/凭证处理实践。

🚀 快速开始

📦 安装指南

npm install
npm run build
npm run start

💻 使用示例

您需要使用 MCP Inspector 或支持 HTTP+SSE 传输的 MCP 服务器和身份验证工具进行测试。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client