Graph Mail MCP
Click on "Install 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 Mail MCPsearch my inbox for unread emails from Contoso about the Q3 report"
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 Mail MCP
A local stdio Model Context Protocol server for Microsoft 365 mail. It provides controlled Outlook/Exchange Online search, read, thread, attachment, and draft workflows through Microsoft Graph.
It never sends, deletes, moves, copies, archives, or marks messages as read. Raw Graph URLs, raw OData, and unrestricted Graph requests are not exposed.
Requirements
Windows with Microsoft Edge
Node.js 22+
A Microsoft 365 work or school account with Exchange Online
Delegated
Mail.ReadWritepermission
Personal Microsoft accounts are disabled by default. Shared mailboxes additionally require Exchange delegation and Mail.ReadWrite.Shared.
Related MCP server: Outlook MCP Server
Install
git clone https://github.com/hanhandly/graph-mail-mcp.git
Set-Location graph-mail-mcp
npm ci
npm run build
Copy-Item config.example.json config.local.jsonconfig.local.json is ignored by Git. Review it before authentication, especially tenant, allowedMailboxScopes, and shared-mailbox settings.
Authenticate
node dist\cli.js -c config.local.json doctor
node dist\cli.js -c config.local.json auth login --account-hint user@contoso.com
node dist\cli.js -c config.local.json auth statusLogin opens an isolated Microsoft Edge profile and uses Graph Explorer for delegated authentication. Playwright clicks Sign in, selects the hinted account, and checks whether the required mail permission is already consented. If it is, authentication continues automatically; otherwise the CLI tells the user which permission must be granted. Playwright never clicks Consent. MFA and consent confirmation remain user-controlled. auth status returns metadata, unexpected-scope warnings, and a next action, but never displays the token.
Graph Explorer can return permissions previously granted to its shared application. The default unexpectedTokenScopePolicy: "warn" keeps the local workflow usable while reporting scopes beyond the configured mail and sign-in allowlist. Set it to "reject" for strict environments; a dedicated app registration is the recommended way to obtain a genuinely least-privilege token.
Configure an MCP client
Use absolute paths in the client's MCP configuration:
{
"mcpServers": {
"graph-mail": {
"command": "node",
"args": [
"C:\\Tools\\graph-mail-mcp\\dist\\cli.js",
"-c",
"C:\\Tools\\graph-mail-mcp\\config.local.json",
"serve"
],
"cwd": "C:\\Tools\\graph-mail-mcp"
}
}
}Some clients use a different outer key, but the command, args, and cwd values are the same. Keep -c <config-path> before serve. The server uses stdio and does not open a network port.
Restart the MCP client, then call:
mail_auth_statusmail_list_foldersmail_search_messages
Tools
Area | Tools |
Authentication and folders |
|
Search and read |
|
Attachments |
|
Managed drafts |
|
Draft updates are limited to drafts created and registered by this MCP. There is no send tool.
bodyMode is enforced consistently: none omits body content and previews, preview returns bodyPreview, and text or html returns the message body. Responses are bounded by maxMessageBodyCharacters per message and maxTotalBodyCharacters overall; truncated messages carry bodyTruncated: true and the response provenance records the limit.
Security
The Graph transport uses a deny-by-default policy firewall and typed request compiler. Tokens are stored outside the repository and protected with Windows DPAPI by default. Logs and tool responses must not expose access tokens, cookies, or authorization headers.
The server accepts delegated tokens only, always rejects Mail.Send, reports unexpected scopes by default, and can reject them in strict mode. Its request firewall limits runtime operations, but deployments requiring a strictly least-privilege bearer token should use a dedicated app registration or constrained authentication provider.
See Security, Tool reference, Configuration example, and Architecture.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Outlook email through Microsoft Graph API. Supports email management operations like reading, searching, marking as read/unread, and deleting messages through natural language.82MIT
- FlicenseNot gradedqualityDmaintenanceProvides programmatic access to Microsoft Outlook mailboxes, enabling AI assistants to search, analyze, and extract insights from emails in personal and shared mailboxes.
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with Microsoft 365 Outlook Mail, allowing email operations via natural language.10MIT
- FlicenseNot gradedqualityCmaintenanceEnables to manage your Outlook mailbox via Microsoft Graph (write access) with delegated permissions, providing MCP tools to create, modify, and send emails, folders, categories, rules, and automatic replies.
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hanhandly/graph-mail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server