365-MCP — Deployment Guide¶
A read-only Microsoft 365 / Entra ID security-auditing MCP server, exposed to Claude over a Cloudflare Tunnel and protected by Cloudflare Access.
This document describes the final working deployment only. It connects from Claude Code (CLI) and Claude Desktop via a Cloudflare Access service token. The claude.ai web connector does not work — see Known limitations.
Placeholders used throughout this guide — substitute your own values:
Placeholder Meaning example.comyour Cloudflare-managed domain (zone) 365-mcp.example.comthe public hostname for the MCP server cloudflared/tunnel-netyour Cloudflare Tunnel container name / its Docker network <tenant-guid>/<app-id-guid>/<secret>Entra tenant ID / app (client) ID / client secret <team>.cloudflareaccess.comyour Cloudflare Zero Trust team domain <application-aud-tag>the Access application's AUD tag <client-id>.access/<client-secret>the Cloudflare Access service token credentials
Architecture¶
Claude Code / Claude Desktop
│ (HTTPS + CF-Access-Client-Id / CF-Access-Client-Secret headers)
▼
Cloudflare edge ──[Access: Service Auth policy validates the service token]
│ injects Cf-Access-Jwt-Assertion (signed identity JWT)
▼
Cloudflare Tunnel (cloudflared) → http://365-mcp:3000
▼
365-mcp container (FastMCP, streamable-HTTP at /sse)
│ • re-validates the Cf-Access-Jwt-Assertion JWT (defense in depth)
│ • client-credentials → Microsoft Graph (read-only)
▼
Microsoft Graph API
Two independent auth layers:
- Cloudflare Access authenticates the caller at the edge (service token).
- The origin re-validates the
Cf-Access-Jwt-AssertionJWT, so nothing on the internal Docker network can reach/ssewithout having gone through Access.
The MCP server authenticates to Microsoft Graph separately using an Entra app registration (client-credentials, read-only scopes).
Prerequisites¶
- Docker + Docker Compose (optionally managed with a UI such as Dockge).
- An existing Cloudflare Tunnel container (
cloudflared) on thetunnel-netDocker network, with the zoneexample.comon Cloudflare. - Cloudflare Zero Trust enabled (free tier is fine).
- Global Administrator on the Microsoft 365 tenant (to consent Graph permissions).