Microsoft Graph MCP Server

Microsoft Graph MCP Server

Provides read-only access to Microsoft 365 services including SharePoint, OneDrive, Outlook, Teams, and Calendar through the Microsoft Graph API, enabling users to search, browse, and retrieve content across their M365 suite.

Category
Visit Server

README

Microsoft Graph MCP Server

Read-only access to Microsoft 365 suite via Model Context Protocol.

Architecture

Architecture Diagram

The diagram shows the complete system architecture including Claude Code integration, MCP server components, Azure AD authentication, Microsoft Graph API gateway, and M365 services (SharePoint, OneDrive, Outlook, Teams, Calendar).

Features

  • SharePoint: Search sites, list files, get content
  • OneDrive: Browse user files, search
  • Outlook: Search emails, read messages
  • Teams: List teams/channels, read messages
  • Calendar: View events, search calendar

Setup

📖 For detailed setup instructions, see SETUP.md

Quick Start

  1. Azure AD App Registration: Register app with Application permissions
  2. Install: pip install -r requirements.txt
  3. Configure: Add credentials to ~/.claude.json
  4. Test: msgraph.test_connection()

Required Azure AD Permissions

Register an Azure AD app with these Application permissions:

  • Sites.Read.All - SharePoint
  • Files.Read.All - OneDrive/SharePoint files
  • Mail.Read - Outlook
  • ChannelMessage.Read.All - Teams messages
  • Chat.Read.All - Teams chats
  • Calendars.Read - Calendar
  • User.Read.All - User directory
  • Group.Read.All - Teams/Groups

Grant admin consent for all permissions.

2. Install Dependencies

cd ~/.claude/mcp-servers/msgraph-mcp
pip install -r requirements.txt

3. Configure Claude

Add to ~/.claude.json:

{
  "mcpServers": {
    "msgraph-mcp": {
      "type": "stdio",
      "command": "python3",
      "args": ["/Users/thianseongyee/.claude/mcp-servers/msgraph-mcp/server.py"],
      "env": {
        "AZURE_CLIENT_ID": "your-client-id",
        "AZURE_TENANT_ID": "your-tenant-id",
        "AZURE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Usage

Access via msgraph module in code execution:

# Test connection
result = msgraph.test_connection()

# Search SharePoint files
result = msgraph.search_files("formulation xlsx", limit=10)

# List recent emails
result = msgraph.list_recent_emails("user@company.com", limit=20)

# Get Teams channels
teams = msgraph.list_teams()
channels = msgraph.list_channels(teams['items'][0]['id'])

# View calendar
result = msgraph.list_events("user@company.com", days_ahead=7)

Available Functions

Connection

  • test_connection() - Test API connectivity
  • list_users(query, limit) - Search users
  • get_user(email) - User details

SharePoint

  • search_sites(query, limit) - Find sites
  • list_site_contents(site_id, path) - Browse folders
  • search_files(query, site_id, limit) - Search files
  • get_file_content(site_id, item_id) - Read file
  • get_file_metadata(site_id, item_id) - File info

OneDrive

  • list_user_files(email, path) - Browse OneDrive
  • search_user_files(email, query, limit) - Search files

Outlook

  • search_emails(query, email, limit) - Search mail
  • list_recent_emails(email, limit, folder) - Recent mail
  • get_email(email, message_id) - Full email

Teams

  • list_teams(limit) - List teams
  • list_channels(team_id) - Team channels
  • get_channel_messages(team_id, channel_id, limit) - Messages
  • search_channel_messages(team_id, channel_id, query) - Search

Calendar

  • list_events(email, days_ahead) - Upcoming events
  • search_events(email, query, limit) - Search calendar
  • get_event(email, event_id) - Event details

Security

  • Read-only: No write permissions
  • Sandboxed: Limited Python builtins
  • App-only auth: No user credentials stored
  • Token managed: Automatic refresh, never exposed

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured