M365 Assistant MCP Server logo

M365 Assistant MCP Server

Community
ryaker

MCP server for Claude to access Outlook data via Microsoft Graph API

Publisherryaker
Repositoryoutlook-mcp
LanguageJavaScript
Forks
162
Stars
438
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    M365 Assistant MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    438 stars and 162 forks from the linked repository.

MseeP.ai Security Assessment Badge

M365 Assistant MCP Server

A comprehensive MCP (Model Context Protocol) server that connects Claude with Microsoft 365 services through the Microsoft Graph API and Power Automate API.

Supported Services

  • Outlook - Email, calendar, folders, and rules
  • OneDrive - Files, folders, search, and sharing
  • Power Automate - Flows, environments, and run history

Directory Structure

├── index.js                 # Main entry point
├── config.js                # Configuration settings
├── auth/                    # Authentication modules
│   ├── index.js             # Authentication exports
│   ├── token-manager.js     # Token storage and refresh (Graph + Flow)
│   └── tools.js             # Auth-related tools
├── calendar/                # Calendar functionality
│   ├── index.js             # Calendar exports
│   ├── list.js              # List events
│   ├── create.js            # Create event
│   ├── delete.js            # Delete event
│   ├── cancel.js            # Cancel event
│   ├── accept.js            # Accept event
│   └── decline.js           # Decline event
├── email/                   # Email functionality
│   ├── index.js             # Email exports
│   ├── list.js              # List emails
│   ├── search.js            # Search emails
│   ├── read.js              # Read email
│   ├── send.js              # Send email
│   └── mark-as-read.js      # Mark email read/unread
├── folder/                  # Folder functionality
│   ├── index.js             # Folder exports
│   ├── list.js              # List folders
│   ├── create.js            # Create folder
│   └── move.js              # Move emails
├── rules/                   # Email rules functionality
│   ├── index.js             # Rules exports
│   ├── list.js              # List rules
│   └── create.js            # Create rule
├── onedrive/                # OneDrive functionality
│   ├── index.js             # OneDrive exports
│   ├── list.js              # List files/folders
│   ├── search.js            # Search files
│   ├── download.js          # Get download URL
│   ├── upload.js            # Simple upload (<4MB)
│   ├── upload-large.js      # Chunked upload (>4MB)
│   ├── share.js             # Create sharing link
│   └── folder.js            # Create/delete folders
├── power-automate/          # Power Automate functionality
│   ├── index.js             # Power Automate exports
│   ├── flow-api.js          # Flow API client
│   ├── list-environments.js # List environments
│   ├── list-flows.js        # List flows
│   ├── run-flow.js          # Trigger flow
│   ├── list-runs.js         # Run history
│   └── toggle-flow.js       # Enable/disable flow
└── utils/                   # Utility functions
    ├── graph-api.js         # Microsoft Graph API helper
    ├── odata-helpers.js     # OData query building
    └── mock-data.js         # Test mode data

Features

  • Authentication: OAuth 2.0 authentication with Microsoft Graph API (+ Flow API for Power Automate)
  • Email Management: List, search, read, send, and organize emails
  • Calendar Management: List, create, accept, decline, and delete calendar events
  • OneDrive Integration: List, search, upload, download, and share files
  • Power Automate: List environments/flows, trigger flows, view run history
  • Modular Structure: Clean separation of concerns for maintainability
  • Test Mode: Simulated responses for testing without real API calls

Available Tools

Outlook (Email & Calendar)

ToolDescription
list-emailsList recent emails from inbox
search-emailsSearch emails with filters
read-emailRead email content
send-emailSend a new email
mark-as-readMark email as read/unread
list-eventsList calendar events
create-eventCreate calendar event
accept-eventAccept event invitation
decline-eventDecline event invitation
delete-eventDelete calendar event
list-foldersList mail folders
create-folderCreate mail folder
move-emailsMove emails between folders
list-rulesList inbox rules
create-ruleCreate inbox rule

OneDrive

ToolDescription
onedrive-listList files in a path
onedrive-searchSearch files by query
onedrive-downloadGet download URL
onedrive-uploadUpload small file (<4MB)
onedrive-upload-largeChunked upload (>4MB)
onedrive-shareCreate sharing link
onedrive-create-folderCreate folder
onedrive-deleteDelete file or folder

Power Automate

ToolDescription
flow-list-environmentsList Power Platform environments
flow-listList flows in environment
flow-runTrigger a manual flow
flow-list-runsGet flow run history
flow-toggleEnable/disable a flow

Quick Start

  1. Install dependencies: npm install
  2. Azure setup: Register app in Azure Portal (see detailed steps below)
  3. Configure environment: Copy .env.example to .env and add your Azure credentials
  4. Configure Claude: Update your Claude Desktop config with the server path
  5. Start auth server: npm run auth-server
  6. Authenticate: Use the authenticate tool in Claude to get the OAuth URL
  7. Start using: Access your M365 data through Claude!

Installation

Prerequisites

  • Node.js 14.0.0 or higher
  • npm or yarn package manager
  • Azure account for app registration

Install Dependencies

bash
npm install

Azure App Registration & Configuration

App Registration

  1. Open Azure Portal
  2. Search for "App registrations"
  3. Click "New registration"
  4. Name: "M365 MCP Server"
  5. Account type: "Accounts in any organizational directory and personal Microsoft accounts"
  6. Redirect URI: Web → http://localhost:3333/auth/callback
  7. Click "Register"
  8. Copy the "Application (client) ID" for your .env file

App Permissions

  1. Go to "API permissions" under Manage
  2. Click "Add a permission" → "Microsoft Graph" → "Delegated permissions"
  3. Add these permissions:
    • offline_access
    • User.Read
    • Mail.Read, Mail.ReadWrite, Mail.Send
    • Calendars.Read, Calendars.ReadWrite
    • Files.Read, Files.ReadWrite
  4. Click "Add permissions"

For Power Automate (optional):

  • Requires additional Azure AD configuration with Flow API scope
  • See Power Automate section below for details

Client Secret

  1. Go to "Certificates & secrets" → "Client secrets"
  2. Click "New client secret"
  3. Add description and select expiration
  4. Copy the VALUE (not the Secret ID)

Configuration

1. Environment Variables

bash
cp .env.example .env

Edit .env:

bash
# Get these values from Azure Portal > App Registrations > Your App
MS_CLIENT_ID=your-application-client-id-here
MS_CLIENT_SECRET=your-client-secret-VALUE-here
MS_TENANT_ID=your-tenant-id-here
USE_TEST_MODE=false

Important Notes:

  • Use MS_CLIENT_ID and MS_CLIENT_SECRET in the .env file
  • Set MS_TENANT_ID for single-tenant apps to avoid /common endpoint errors
  • For Claude Desktop config, you'll use OUTLOOK_CLIENT_ID and OUTLOOK_CLIENT_SECRET
  • Always use the client secret VALUE, never the Secret ID

2. Claude Desktop Configuration

Add to your Claude Desktop config:

json
{
  "mcpServers": {
    "m365-assistant": {
      "command": "node",
      "args": ["/path/to/outlook-mcp/index.js"],
      "env": {
        "USE_TEST_MODE": "false",
        "OUTLOOK_CLIENT_ID": "your-client-id",
        "OUTLOOK_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

Authentication

Graph API (Outlook + OneDrive)

  1. Start auth server: npm run auth-server
  2. Use the authenticate tool in Claude
  3. Visit the provided URL and sign in
  4. Tokens saved to ~/.outlook-mcp-tokens.json

Power Automate (Optional)

Power Automate requires a separate token with the Flow API scope. Configure additional Azure AD permissions for https://service.flow.microsoft.com//.default scope.

Limitations:

  • Only solution-aware flows are accessible
  • Only manual trigger flows can be run via API
  • Requires environment ID for most operations

Troubleshooting

Common Issues

"Cannot find module"

bash
npm install

"Port 3333 in use"

bash
npx kill-port 3333
npm run auth-server

"Invalid client secret" (AADSTS7000215)

  • Use the secret VALUE, not the Secret ID

"Authentication required"

  • Delete ~/.outlook-mcp-tokens.json and re-authenticate

Testing

bash
# Run with MCP Inspector
npm run inspect

# Run in test mode (mock data)
npm run test-mode

# Run Jest tests
npm test

Extending the Server

  1. Create new module directory
  2. Implement tool handlers in separate files
  3. Export tool definitions from module index
  4. Import and add to TOOLS array in index.js

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "ryaker-outlook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "m365-mcp"
      ]
    }
  }
}

Use M365 Assistant MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once M365 Assistant MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add M365 Assistant MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the M365 Assistant MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "ryaker-outlook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "m365-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the M365 Assistant MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the M365 Assistant MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use M365 Assistant MCP Server to help me with this task?
M365 Assistant MCP Server
Sure. I read it.
Here is what I found using M365 Assistant MCP Server.

Frequently asked questions

What is the M365 Assistant MCP Server MCP server used for?

M365 Assistant MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use M365 Assistant MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use M365 Assistant MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use M365 Assistant MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With M365 Assistant MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect M365 Assistant MCP Server MCP to TypingMind?

M365 Assistant MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does M365 Assistant MCP Server MCP provide in TypingMind?

M365 Assistant MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use M365 Assistant MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If M365 Assistant MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇