Get the FREE Ultimate OpenClaw Setup Guide →

outlook

MCP server for Microsoft Office 365 Outlook – email, calendar & SharePoint integration for Claude, ChatGPT, and AI assistants via Microsoft Graph API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio xenoxilus-outlook-mcp node /absolute/path/to/outlook-mcp/server/index.js \
  --env AZURE_CLIENT_ID="your-azure-client-id" \
  --env AZURE_TENANT_ID="your-azure-tenant-id" \
  --env MCP_OUTLOOK_WORK_DIR="optional/download/directory"

How to use

This MCP server exposes Microsoft Outlook functionality via the Microsoft Graph API, enabling AI assistants to read, search, send, and reply to emails, access calendar events, and process Office documents. It also supports managing large attachments and interacting with SharePoint files through links or IDs. After starting the server, configure your MCP client (Claude Code, mcp CLI, or other MCP clients) to point to the local node server. You’ll provide your Azure AD client and tenant IDs so the server can authenticate with Microsoft Graph using OAuth 2.0 PKCE. Once configured, you can issue prompts like 'Show my unread emails', 'Schedule a meeting for tomorrow', or 'Download the latest attachment and extract text', and the server will perform those actions through Graph API calls and return structured results to your AI client.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Git installed
  • An Azure AD application with Client ID and Tenant ID (as described in the Azure Setup Guide)

Installation steps (CLI-based setup):

  1. Clone the repository:
git clone https://github.com/XenoXilus/outlook-mcp.git
cd outlook-mcp
  1. Install dependencies:
npm install
  1. Start the server (example):
node server/index.js
  1. Configure your MCP client to connect to the running server. Example config (CLI/MCP clients):
{
  "outlook-mcp": {
    "command": "node",
    "args": ["/absolute/path/to/outlook-mcp/server/index.js"],
    "env": {
      "AZURE_CLIENT_ID": "your-azure-client-id",
      "AZURE_TENANT_ID": "your-azure-tenant-id",
      "MCP_OUTLOOK_WORK_DIR": "/optional/download/directory"
    }
  }
}
  1. If you prefer using the DXT extension flow (Claude Desktop), follow the DXT extension installation steps in the README, including packaging and loading the extension with your Azure credentials.

Additional notes

Environment variables:

  • AZURE_CLIENT_ID: Required, Azure AD application client ID
  • AZURE_TENANT_ID: Required, Azure AD directory (tenant) ID
  • MCP_OUTLOOK_WORK_DIR: Optional, directory for saving large files; defaults to system temp if not set

Large file handling: The server detects when responses would exceed MCP's 1MB response limit and saves content to local files with timestamped names. If MCP_OUTLOOK_WORK_DIR is set, files are saved there; otherwise, they go to the system temp directory and are cleaned up over time.

Azure setup tips: Use PKCE flow; no client secret is required. Ensure the registered app has the necessary permissions (Mail, Calendars, Files, Sites, offline_access).

Common issues: Ensure the server process has network access to Microsoft Graph endpoints, and that the Azure app’s redirect URI matches your environment if you’re testing OAuth flows locally. If you encounter token refresh issues, verify clock skew between your machine and Azure servers and consult the OAuth logs.

Related MCP Servers

Sponsor this space

Reach thousands of developers