outlook-mcp-server

oabdelrahman98/outlook-mcp-server

3.2

If you are the rightful owner of outlook-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Outlook MCP Server is a Model Context Protocol server designed for Microsoft Outlook, enabling efficient email management through the Microsoft Graph API with secure OAuth 2.0 authentication.

Tools
10
Resources
0
Prompts
0

Outlook MCP Server

A Model Context Protocol (MCP) server for Microsoft Outlook that provides email management through the Microsoft Graph API with OAuth 2.0 authentication.

Features

  • List, read, send, and search email messages
  • Create and manage drafts
  • Reply to messages and move between folders
  • Mark messages as read/unread
  • OAuth 2.0 authentication for secure, multi-user access

Prerequisites

  • Node.js 22+
  • Azure subscription
  • Azure CLI

Quick Deployment Guide

1. Register Azure AD Application

# Create app registration
az ad app create --display-name "Outlook MCP Server" --sign-in-audience AzureADMyOrg

# Get the App ID
APP_ID=$(az ad app list --display-name "Outlook MCP Server" --query "[0].appId" -o tsv)

# Add Microsoft Graph permissions
az ad app permission add --id $APP_ID --api 00000003-0000-0000-c000-000000000000 \
  --api-permissions e383f46e-2787-4529-855e-0e479a3ffac0=Scope # Mail.Send

az ad app permission add --id $APP_ID --api 00000003-0000-0000-c000-000000000000 \
  --api-permissions 024d486e-b451-40bb-833d-3e66d98c5c73=Scope # Mail.ReadWrite

# Grant admin consent
az ad app permission admin-consent --id $APP_ID

# Create client secret (save the output!)
az ad app credential reset --id $APP_ID --append

2. Deploy to Azure Container Apps

# Set variables (customize these)
RESOURCE_GROUP="rg-outlook-mcp"
LOCATION="eastus"
ACR_NAME="youracrname"  # Must be globally unique
APP_NAME="ca-outlook-mcp"

# Create resources
az group create --name $RESOURCE_GROUP --location $LOCATION

az acr create --resource-group $RESOURCE_GROUP --name $ACR_NAME --sku Basic

az containerapp env create --name cae-outlook-mcp \
  --resource-group $RESOURCE_GROUP --location $LOCATION

# Build and deploy
az acr build --registry $ACR_NAME --image outlook-mcp:latest .

az containerapp create \
  --name $APP_NAME \
  --resource-group $RESOURCE_GROUP \
  --environment cae-outlook-mcp \
  --image $ACR_NAME.azurecr.io/outlook-mcp:latest \
  --registry-server $ACR_NAME.azurecr.io \
  --registry-identity system \
  --target-port 80 \
  --ingress external \
  --cpu 0.5 --memory 1.0Gi \
  --env-vars PORT=80

# Get your server URL
az containerapp show --name $APP_NAME --resource-group $RESOURCE_GROUP \
  --query "properties.configuration.ingress.fqdn" -o tsv

3. Configure OAuth in openapi.yaml

Update openapi.yaml with your deployment details:

servers:
  - url: https://YOUR-CONTAINER-APP-URL  # From step 2

securitySchemes:
  oauth2:
    flows:
      authorizationCode:
        authorizationUrl: https://login.microsoftonline.com/YOUR-TENANT-ID/oauth2/v2.0/authorize
        tokenUrl: https://login.microsoftonline.com/YOUR-TENANT-ID/oauth2/v2.0/token
        scopes:
          Mail.ReadWrite: "Read and write mail"
          Mail.Send: "Send mail"

Get your tenant ID:

az account show --query tenantId -o tsv

4. Create Power Platform Custom Connector

  1. Go to Power Platform
  2. Navigate to Custom Connectors+ New custom connectorImport an OpenAPI file
  3. Upload openapi.yaml
  4. In Security tab:
    • Authentication type: OAuth 2.0
    • Client ID: Your App ID from step 1
    • Client Secret: Your secret from step 1
  5. Click Update connector

5. Use in Copilot Studio

  1. Create or open a Copilot in Copilot Studio
  2. Go to ActionsAdd an actionConnectors
  3. Select your "Outlook MCP Server" connector
  4. Test: "Show me my recent emails" or "Send an email to user@example.com"

Available Tools

  • list_messages - List messages from folders (Inbox, SentItems, etc.)
  • get_message - Get message details by ID
  • send_mail - Send new email
  • search_messages - Search messages by keywords
  • reply_to_message - Reply to a message
  • list_folders - List all mail folders
  • create_draft - Create draft message
  • delete_message - Delete a message
  • move_message - Move message to folder
  • mark_as_read - Mark message as read/unread

Local Development

# Install dependencies
npm install

# Build
npm run build

# Run locally (requires GRAPH_ACCESS_TOKEN env variable)
npm start

License

MIT