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: ms-365-mcp-server
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.61 npm1MIT
- AlicenseCqualityCmaintenanceEnables AI assistants to interact with Microsoft 365 and Office services through the Microsoft Graph API, providing tools for email, calendar, files, Teams, SharePoint, and more with configurable permissions and output formats.188MIT
- AlicenseNot gradedqualityCmaintenanceEnables natural language access to Microsoft 365 data by providing tools for reading and writing emails, calendar events, contacts, tasks, files, Teams meeting recordings and transcripts, and mailbox settings over the Model Context Protocol.170 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables interaction with Microsoft 365 and Office services through the Microsoft Graph API, including email, calendar, files, Teams, SharePoint, and more.49,317 npmMIT