๐Ÿ”’ MCP Server Authentication Reference Collection

June 27, 2025 ยท View on GitHub

Reference servers that demo how authentication works with the current Model Context Protocol spec.

Warning

Code presented here is for demo purposes only. Your specific scenarios (including rules inside your enterprise, specific security controls, or other protection mechanisms) may differ from the ones that are outlined in this repository. Always conduct a security audit and threat modeling for any production and customer-facing assets that require authentication and authorization.

Scenarios

Servers above are designed for various runtime scenarios. They are tagged as follows:

  • Remote MCP servers: Remote MCP Server
  • Local MCP servers: Local MCP Server
  • Dual-purpose MCP servers (can run locally or remotely): Dual-purpose MCP Server

Supported identity providers

ProviderScenarioServer TypeImplementationState
Entra IDAPI Management gating MCP server.Remote MCP Serverremote-mcp-apim-functions-pythonState: Prototype
Entra IDConfidential client, mapped to session token.Dual-purpose MCP Serverentra-id-cca-sessionState: Prototype
Entra IDPublic client, using WAM.Local MCP Serverentra-id-local-wamState: Prototype
GitHubGitHub application w/OAuth, mapped to session token.Dual-purpose MCP Servergithub-app-sessionState: Prototype
Entra IDAPI Management gating an Azure Functions MCP server.Remote MCP Serverremote-auth-mcp-apim-pyState: Prototype
Entra IDAPI Management gating an App Service MCP server with Protected Resource Metadata (PRM)Remote MCP Serverremote-mcp-apim-oauth-prmState: Prototype