# Microsoft Graph MCP server (mail, calendar, contacts of the signed-in M365 # account) by marlonluo2018. Chosen over the author's outlook-mcp-server, # which drives the Outlook desktop client through win32COM and therefore only # runs on Windows; this one talks to the Graph API and is plain Python. # # Not on PyPI, so it is built from the GitHub source. Auth is the device-code # flow against Microsoft's public client id (no Azure app registration); # tokens land in ~/.microsoft_graph_mcp_tokens.json. Settings come from env # vars (CLIENT_ID, TENANT_ID, USER_TIMEZONE, ...); the optional .env the # upstream README mentions would sit inside the store and is not used. { lib, python3Packages, fetchFromGitHub, }: python3Packages.buildPythonApplication { pname = "microsoft-graph-mcp-server"; version = "0.1.0-unstable-2026-11-12"; pyproject = true; src = fetchFromGitHub { owner = "marlonluo2018"; repo = "microsoft_graph_mcp_server"; rev = "b4c2725ee9e3d47dce8641d5ca90434aca16c9db"; hash = "sha256-RSPyjq3Zu9WBbihI4yuB3PhxgRaF9G2gl+xaslnBdJI="; }; build-system = with python3Packages; [hatchling]; dependencies = with python3Packages; [ mcp_1 # upstream targets the 1.x low-level Server API (list_tools decorators); mcp 2.x removed it msal httpx pydantic pydantic-settings python-dotenv click rich typing-extensions tzdata pillow # optional image attachments (MULTIMODAL_SUPPORTED) ]; # Upstream defaults USER_TIMEZONE to Asia/Shanghai; the env still wins. makeWrapperArgs = ["--set-default" "USER_TIMEZONE" "Europe/Berlin"]; # server.py builds an MSAL client at import time, which hits the network, # so only the config module is import-checked in the sandbox. pythonImportsCheck = ["microsoft_graph_mcp_server.config"]; meta = { description = "MCP server for Microsoft Graph (Outlook mail, calendar, contacts)"; homepage = "https://github.com/marlonluo2018/microsoft_graph_mcp_server"; license = lib.licenses.mit; mainProgram = "microsoft-graph-mcp-server"; }; }