# Microsoft 365 Mail

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: mindstone
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mindstone/mcp-servers/tree/HEAD/connectors/microsoft-mail
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/microsoft-365-mail

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MS_CLIENT_ID`, `MS_CONFIG_DIR`, `MS_ACCOUNT_EMAIL`, `MS_MCP_PACKAGE_ID`, `MICROSOFT_REQUEST_TIMEOUT_MS`, `MCP_WORKSPACE_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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

### Codex

**Platform CLI**
```bash
codex mcp add microsoft-mail --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> -- npx -y @mindstone/mcp-server-microsoft-mail
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "microsoft-mail": {
            "command": "npx",
            "args": [
                "-y",
                "@mindstone/mcp-server-microsoft-mail"
            ],
            "env": {
                "MS_CLIENT_ID": "<MS_CLIENT_ID>",
                "MS_CONFIG_DIR": "<MS_CONFIG_DIR>",
                "MS_ACCOUNT_EMAIL": "<MS_ACCOUNT_EMAIL>",
                "MS_MCP_PACKAGE_ID": "<MS_MCP_PACKAGE_ID>",
                "MICROSOFT_REQUEST_TIMEOUT_MS": "<MICROSOFT_REQUEST_TIMEOUT_MS>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "microsoft-mail": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@mindstone/mcp-server-microsoft-mail"
            ],
            "env": {
                "MS_CLIENT_ID": "<MS_CLIENT_ID>",
                "MS_CONFIG_DIR": "<MS_CONFIG_DIR>",
                "MS_ACCOUNT_EMAIL": "<MS_ACCOUNT_EMAIL>",
                "MS_MCP_PACKAGE_ID": "<MS_MCP_PACKAGE_ID>",
                "MICROSOFT_REQUEST_TIMEOUT_MS": "<MICROSOFT_REQUEST_TIMEOUT_MS>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MS_CLIENT_ID=<MS_CLIENT_ID> -e MS_CONFIG_DIR=<MS_CONFIG_DIR> -e MS_ACCOUNT_EMAIL=<MS_ACCOUNT_EMAIL> -e MS_MCP_PACKAGE_ID=<MS_MCP_PACKAGE_ID> -e MICROSOFT_REQUEST_TIMEOUT_MS=<MICROSOFT_REQUEST_TIMEOUT_MS> microsoft-mail npx -y @mindstone/mcp-server-microsoft-mail
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- 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
- Find my five latest unread emails from alice@example.com 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

## Similar
- [Excel MCP Server](https://affpapa.org/en/nevibecode/mcp/excel-mcp-server.md) — MCP server · ★ 4268
- [kordoc](https://affpapa.org/en/nevibecode/mcp/kordoc.md) — MCP server · ★ 2795
- [Power BI Authoring MCP Server (Local)](https://affpapa.org/en/nevibecode/mcp/power-bi-authoring-mcp-server-local.md) — MCP server · ★ 1248
- [Microsoft 365 MCP Server](https://affpapa.org/en/nevibecode/mcp/microsoft-365-mcp-server.md) — MCP server · ★ 1085
- [anymd](https://affpapa.org/en/nevibecode/mcp/anymd.md) — MCP server · ★ 1054
- [Docling MCP](https://affpapa.org/en/nevibecode/mcp/docling-mcp.md) — MCP server · ★ 779

From the same set: [mindstone/mcp-servers](https://affpapa.org/en/nevibecode/by/mindstone/mcp-servers.md) — 40 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
