Skip to main content
Glama

Microsoft MCP

by elyxlz
  • Apple

Microsoft MCP

Powerful MCP server for Microsoft Graph API - a complete AI assistant toolkit for Outlook, Calendar, OneDrive, and Contacts.

Features

  • Email Management: Read, send, reply, manage attachments, organize folders
  • Calendar Intelligence: Create, update, check availability, respond to invitations
  • OneDrive Files: Upload, download, browse with pagination
  • Contacts: Search and list contacts from your address book
  • Multi-Account: Support for multiple Microsoft accounts (personal, work, school)
  • Unified Search: Search across emails, files, events, and people

Quick Start with Claude Desktop

# Add Microsoft MCP server (replace with your Azure app ID) claude mcp add microsoft-mcp -e MICROSOFT_MCP_CLIENT_ID=your-app-id-here -- uvx --from git+https://github.com/elyxlz/microsoft-mcp.git microsoft-mcp # Start Claude Desktop claude

Usage Examples

# Email examples > read my latest emails with full content > reply to the email from John saying "I'll review this today" > send an email with attachment to alice@example.com # Calendar examples > show my calendar for next week > check if I'm free tomorrow at 2pm > create a meeting with Bob next Monday at 10am # File examples > list files in my OneDrive > upload this report to OneDrive > search for "project proposal" across all my files # Multi-account > list all my Microsoft accounts > send email from my work account

Available Tools

Email Tools

  • read_emails - Read emails with full body content
  • get_email - Get specific email with attachments
  • reply_to_email - Reply maintaining thread context
  • send_email - Send with CC/BCC and attachments
  • mark_email_read - Mark emails as read/unread
  • move_email - Move between folders
  • download_attachment - Download email attachments

Calendar Tools

  • get_calendar_events - List events with full details
  • check_availability - Check free/busy times
  • create_event - Create with location and attendees
  • update_event - Reschedule or modify events
  • delete_event - Cancel events
  • respond_to_event - Accept/decline invitations

Contact & File Tools

  • get_contacts - Search or list contacts
  • list_files - Browse OneDrive with pagination
  • upload_file - Upload files to OneDrive
  • download_file - Download file content
  • delete_file - Delete files or folders

Utility Tools

  • search - Universal search across all services
  • list_accounts - Show authenticated accounts

Manual Setup

1. Azure App Registration

  1. Go to Azure Portal → Microsoft Entra ID → App registrations
  2. New registration → Name: microsoft-mcp
  3. Supported account types: Personal + Work/School
  4. Authentication → Allow public client flows: Yes
  5. API permissions → Add these delegated permissions:
    • Mail.ReadWrite
    • Calendars.ReadWrite
    • Files.ReadWrite
    • Contacts.Read
    • People.Read
    • User.Read
  6. Copy Application ID

2. Installation

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

3. Authentication

# Set your Azure app ID export MICROSOFT_MCP_CLIENT_ID="your-app-id-here" # Run authentication script uv run authenticate.py # Follow the prompts to authenticate your Microsoft accounts

4. Claude Desktop Configuration

Add to your Claude Desktop configuration:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{ "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:

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

Multi-Account Support

All tools support an optional account_id parameter:

# Use default account send_email("user@example.com", "Subject", "Body") # Use specific account send_email("user@example.com", "Subject", "Body", account_id="account-id-here") # List accounts to get IDs list_accounts()

Development

# Run tests uv run pytest tests/ -v # Type checking uv run pyright # Format code uvx ruff format . # Lint uvx ruff check --fix --unsafe-fixes .

Example: AI Assistant Scenarios

Smart Email Management

# Read latest emails with full content emails = read_emails(count=10, include_body=True) # Reply maintaining thread reply_to_email(email_id, "Thanks for your message. I'll review and get back to you.") # Forward with attachments email = get_email(email_id) attachments = [download_attachment(email_id, att["id"]) for att in email["attachments"]] send_email("boss@company.com", f"FW: {email['subject']}", email["body"]["content"], attachments=attachments)

Intelligent Scheduling

# Check availability before scheduling availability = check_availability("2024-01-15T10:00:00Z", "2024-01-15T18:00:00Z", ["colleague@company.com"]) # Create meeting with details create_event( "Project Review", "2024-01-15T14:00:00Z", "2024-01-15T15:00:00Z", location="Conference Room A", body="Quarterly review of project progress", attendees=["colleague@company.com", "manager@company.com"] )

Security Notes

  • Tokens are cached locally in ~/.microsoft_mcp_token_cache.json
  • Use app-specific passwords if you have 2FA enabled
  • Only request permissions your app actually needs
  • Consider using a dedicated app registration for production

Troubleshooting

  • Authentication fails: Check your CLIENT_ID is correct
  • "Need admin approval": Use MICROSOFT_MCP_TENANT_ID=consumers for personal accounts
  • Missing permissions: Ensure all required API permissions are granted in Azure
  • Token errors: Delete ~/.microsoft_mcp_token_cache.json and re-authenticate

License

MIT

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    Provides tools for interacting with Gmail and Calendar APIs. This server enables you to manage your emails and calendar events programmatically through the MCP interface.
    Last updated -
    8
    13
    JavaScript
    MIT License
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that enables AI assistants to interact with Linear project management systems, allowing users to retrieve, create, and update issues, projects, and teams through natural language.
    Last updated -
    32
    80
    5
    TypeScript
    MIT License
    • Apple
  • -
    security
    F
    license
    -
    quality
    An MCP server that enables AI assistants to access and interact with Google Classroom data, allowing users to view courses, course details, and assignments through natural language commands.
    Last updated -
    508
    1
    JavaScript
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that enables interaction with Microsoft 365 services (Excel, Calendar, Mail, OneDrive, Teams, etc.) through the Graph API, allowing AI assistants to manage Microsoft 365 resources via natural language.
    Last updated -
    1,049
    74
    TypeScript
    MIT License

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/elyxlz/microsoft-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server