Skip to main content
MCP server CX Codex

Microsoft 365 Mail — Claude Code MCP server: how to install

MCP server connecting Microsoft 365 Outlook Mail via Graph API. It lets agents search inboxes, send replies, triage messages, and manage out-of-office status.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env MS_CLIENT_ID=<MS_CLIENT_ID> --env MS_CONFIG_DIR=<MS_CONFIG_DIR> --env MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> --env MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> --env MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> --transport stdio microsoft-mail -- npx -y @mindstone/mcp-server-microsoft-mail
Open on GitHub

What Microsoft 365 Mail does

This server equips AI agents with 22 tools to interact with Outlook via Microsoft Graph. Capabilities cover searching messages, drafting replies, moving emails between folders, and saving file attachments. It also houses the authenticate_microsoft_account tool for its connector group.

Unlike standalone tools, this server does not launch an interactive browser login. The host environment manages OAuth directly and writes credentials to ${MS_CONFIG_DIR}/credentials/. Without those on-disk token files, every tool invocation fails immediately with an auth_required error payload.

Running this package requires Node.js 20 or newer. You must supply MS_CLIENT_ID and MS_CONFIG_DIR. Upstream Graph requests default to a 60000 ms timeout. Downloads land in the system temporary folder unless MCP_WORKSPACE_PATH is set.

What it helps with

  • find unread messages by sender or topic
  • reply directly to existing email threads
  • save email attachments to local storage
  • set out-of-office auto-replies

Example prompts for the agent

  • Find my five latest unread emails from [email protected] and reply to the newest one
  • Download attachments from the latest email with subject Q3 planning
  • Turn on out-of-office replies until next Monday

How to install Microsoft 365 Mail

Platform CLI

claude mcp add --env MS_CLIENT_ID=<MS_CLIENT_ID> --env MS_CONFIG_DIR=<MS_CONFIG_DIR> --env MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> --env MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> --env MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> --transport stdio microsoft-mail -- npx -y @mindstone/mcp-server-microsoft-mail

Replace <…> with your own values. 1 more environment variable is in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Microsoft 365 Mail

How do I install Microsoft 365 Mail in Claude Code?

Run `claude mcp add mcp-server-microsoft-mail -e MS_CLIENT_ID=<MS_CLIENT_ID> -e MS_CONFIG_DIR=<MS_CONFIG_DIR> -- npx -y @mindstone/mcp-server-microsoft-mail`. Replace the placeholders with your Entra app client ID and config directory path.

What does the Microsoft 365 Mail MCP server do?

It exposes 22 Microsoft Graph tools for managing Outlook. Your agent can read inboxes, organize folders, send replies, and update mailbox settings.

Why does this server require MS_CONFIG_DIR?

The server does not handle OAuth login flows on its own. It relies on the host application to write session tokens into ${MS_CONFIG_DIR}/credentials/ and index them in accounts.json.

Similar MCP servers

All MCP servers for Office documents →

From the same set40

Nano Banana An MCP server that hands your agent image generation and editing through Google Gemini. Useful when a picture has to come out of the coding session itself. CX Codex +1 ★ 13repo stars Mixmax Connects your AI agent to Mixmax email automation, letting you launch drip sequences, send templated messages, and review delivery metrics. CX Codex +1 ★ 13repo stars Microsoft 365 Teams This MCP server lets an agent work with Teams chats, channel messages, and presence through Microsoft Graph. Use it to search conversations or send replies from your coding host. CX Codex +1 ★ 13repo stars Microsoft 365 SharePoint An MCP server that gives your agent SharePoint through Microsoft Graph: find sites, read libraries and lists, search content, and create sharing links. CX Codex +1 ★ 13repo stars Microsoft 365 Files This MCP server connects OneDrive to AI coding hosts through Microsoft Graph for file search, reading, transfers, and sharing links. CX Codex +1 ★ 13repo stars Microsoft 365 Calendar Brings the Outlook calendar from Microsoft 365 into your coding agent: read events, create and edit meetings, find free slots. Handy when you plan the day from the chat window. CX Codex +1 ★ 13repo stars Kling Connects Kling AI video generation and lip-sync directly to your AI agent. It handles rendering tasks, checks queue status, and downloads assets to the workspace. CX Codex +1 ★ 13repo stars Humaans Connects Humaans to an MCP host so an agent can work with people, roles, time away, offices, and company records. It requires an API key. CX Codex +1 ★ 13repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor