graph-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@graph-mcpwhat's on my calendar tomorrow?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
graph-mcp
Thin authenticated Microsoft Graph passthrough over MCP. Nine verb-shaped tools and no business logic: the model builds every Graph URL, body and query itself, and all the server does is inject a per-user On-Behalf-Of token.
Install
uv sync --extra dev
uv run uvicorn graph_mcp.main:app --port 8080Python ≥ 3.13. GET /health verifies configuration.
Related MCP server: Microsoft Graph MCP
Configuration
All settings take the GRAPH_ prefix.
Variable | Purpose |
| Entra tenant |
| The OBO confidential client. Must be the resource app the user token's audience targets |
| Shared key for the hop from your gateway to this server |
| Defaults to |
| In-flight Graph calls, default 4 |
| Refuse an expired forwarded assertion with a real 401. On by default |
| Optional |
| Staging area for embedded attachments, swept once the TTL passes |
Tools
Tool | Verb | Purpose |
| GET | Read any resource; paginate via the returned |
| POST | Create resources, trigger actions |
| PATCH | Update in place |
| DELETE | Remove (soft-delete to the recycle bin) |
| POST | Up to 20 operations in one request |
| POST | Microsoft Search across SharePoint, OneDrive, Teams, Outlook |
| POST | Returns a pre-authenticated upload URL |
| GET | Returns a pre-authenticated download URL, or inline base64 |
| POST | Resolves a mail attachment to a download URL |
Design
No business logic. Adding a Graph capability usually means adding a tool. Here it means nothing at all: the model already knows the Graph API, so exposing the verbs exposes all of it. New delegated permissions work with no code change once admin consents them.
File bytes never pass through the model. Uploads return a pre-authenticated
upload_url the caller streams to directly, in 320 KiB-multiple fragments with
a Content-Range and no Authorization header. Downloads and mail attachments
work the same way. Nothing gets base64'd into a tool argument or result, so file
size is bounded by the network and not by a context window.
Permissions are Microsoft's to enforce, not this server's. The gateway
validates the user's Entra token and forwards it under
X-Forwarded-Authorization, and the server exchanges that for a delegated
Graph token via On-Behalf-Of. A user sees exactly what their own account can
see. No allow-list here to drift out of date, and no service principal quietly
holding more access than the person using it.
The forwarded assertion is checked for expiry before use. An expired one
gets a real 401 with a WWW-Authenticate challenge instead of a confusing
downstream Graph error, so the client knows to refresh rather than retry.
Request identity lives in contextvars, set by pure-ASGI middleware. Not
Starlette's BaseHTTPMiddleware, whose task boundary loses the contextvar
before the handler ever reads it. Same reason the MCP SDK's own auth
middleware is pure-ASGI.
Development
uv run pytest
uv run ruff check .
uv run mypy srcLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Permissioned access to Outlook, OneDrive and Teams via the user's own Microsoft account
Manage Microsoft 365 email, calendar, contacts and inbox rules via the Graph API with OAuth 2.0.
Read email/chat conversations, messages, contacts and teams; draft, send and update threads.
Verified, pay-per-use API tools for AI agents through one authenticated connection.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to interact with Microsoft 365 services (users, mail, calendar, files) via Microsoft Graph API.23 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Microsoft 365 through the Microsoft Graph API, including searching Teams messages, managing chats, and sending messages.77 npmMIT
- FlicenseBqualityDmaintenanceEnables LLMs to manage your Microsoft 365 calendar, tasks, and email via Microsoft Graph API, acting as a personal secretary.14-
- -licenseNot gradedqualityNot gradedmaintenanceProvides access to Microsoft Teams, Outlook, Calendar, and SharePoint via the Microsoft Graph API, enabling natural language interactions to read and manage messages, emails, events, and files.1-