Get the FREE Ultimate OpenClaw Setup Guide →

microsoft

A Microsoft Graph API integration MCP server that provides AI assistants with comprehensive access to Microsoft 365 services through the Model Context Protocol (MCP). It enables natural language automation of email, calendar, file management, and contact operations across multiple Microsoft accounts.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio aojdevstudio-microsoft-mcp uvx --from git+https://github.com/elyxlz/microsoft-mcp.git microsoft-mcp \
  --env MICROSOFT_MCP_CLIENT_ID="your-app-id-here"

How to use

This MCP server provides a Python-based integration for Microsoft Graph APIs, offering tools to manage email, calendars, OneDrive files, and contacts across multiple Microsoft accounts. You can list and read emails, create and send messages with attachments, manage calendar events and availability, browse and manipulate OneDrive files, and search or manage your address book. The server supports multi-account usage, meaning you can perform operations under different account IDs by selecting the appropriate account beforehand. Available utility and core tools are exposed via functions like list_emails, send_email, create_event, list_files, search_files, unified_search, and authenticate_account, among others. Typical usage involves authenticating with your Microsoft app ID, then issuing tool commands within the context of a chosen account_id to perform tasks across Outlook, Calendar, OneDrive, and Contacts.

How to install

Prerequisites: - Python 3.8+ and the uv/uvx tooling installed. - Git. - A registered Azure app for Microsoft Graph with appropriate permissions (Mail.ReadWrite, Calendars.ReadWrite, Files.ReadWrite, Contacts.Read, People.Read, User.Read). - MICROSOFT_MCP_CLIENT_ID obtained from the Azure app registration.

Step-by-step installation:

  1. Clone the repository and install the MCP locally (example using uv for development):

git clone https://github.com/elyxlz/microsoft-mcp.git cd microsoft-mcp uv sync

  1. Set up authentication and environment:

export MICROSOFT_MCP_CLIENT_ID="your-app-id-here"

  1. Run the MCP server (example using uvx for Claude Desktop integration):

uvx --from git+https://github.com/elyxlz/microsoft-mcp.git microsoft-mcp

If you prefer a local development run:

uv run microsoft-mcp

  1. Azure app registration (manual, one-time):
  • Register an app in Azure Active Directory with Personal + Work/School accounts
  • Add required permissions: Mail.ReadWrite, Calendars.ReadWrite, Files.ReadWrite, Contacts.Read, People.Read, User.Read
  • Copy the Application (client) ID and use it as MICROSOFT_MCP_CLIENT_ID
  • Optionally configure tenant and admin consent as needed
  1. Claude Desktop integration (example):

Add to Claude Desktop config:

"mcpServers": { "microsoft": { "command": "uvx", "args": ["--from", "git+https://github.com/elyxlz/microsoft-mcp.git", "microsoft-mcp"], "env": { "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here" } } }

Or for local development with uv:

"mcpServers": { "microsoft": { "command": "uv", "args": ["--directory", "/path/to/microsoft-mcp", "run", "microsoft-mcp"], "env": { "MICROSOFT_MCP_CLIENT_ID": "your-app-id-here" } } }

Additional notes

Tips and common issues:

  • Tokens for Microsoft Graph are cached locally (see token cache path in your config or logs) and can require re-authentication if the cache is cleared.
  • Ensure the correct permissions are granted in Azure and that admin consent has been granted where required.
  • For multi-account workflows, always specify an account_id as the first argument to tools like list_emails, send_email, list_files, etc.
  • If authentication fails, verify MICROSOFT_MCP_CLIENT_ID matches the app registration and that the device code flow is allowed for your app type.
  • If you encounter token or permission errors, re-authenticate to refresh tokens and re-check Azure permissions.
  • This MCP supports both cloud-based deployment via uvx and local development with uv; adjust the command/args accordingly in your environment configuration.

Related MCP Servers

Sponsor this space

Reach thousands of developers