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.
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:
- 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
- Set up authentication and environment:
export MICROSOFT_MCP_CLIENT_ID="your-app-id-here"
- 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
- 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
- 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
Gitingest
mcp server for gitingest
mcp_server_filesystem
MCP File System Server: A secure Model Context Protocol server that provides file operations for AI assistants. Enables Claude and other assistants to safely read, write, and list files in a designated project directory with robust path validation and security controls.
claude_autoapprove_mcp
An MCP server to inject auto-approve MCP functionality into Claude Desktop
davinci -professional
An enterprise-grade MCP server that exposes the full functionality of DaVinci Resolve and DaVinci Resolve Studio (through version 20) to either Claude Desktop or Cursor MCP clients. Fully configured and tested as a Claude Desktop Extension making installation as easy as clicking a button. Supports both Windows and Macintosh.
openapi -proxy
An MCP server that provides tools for exploring large OpenAPI schemas
substack -plus
The most advanced Substack MCP server. 12 tools, browser auth, rich text support. Not affiliated with Substack Inc.