New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@masonator/m365-mcp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@masonator/m365-mcp

MCP server implementation for Microsoft 365 via Microsoft Graph API

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
524
7385.71%
Maintainers
1
Weekly downloads
 
Created
Source

M365 MCP

npm version MIT License Node.js TypeScript CI

MCP server for Microsoft 365 via the Microsoft Graph API. 16 tools giving read-only access to your profile, calendar, email, Teams chats and channels, OneDrive files, SharePoint, tasks, the org directory, and meeting transcripts from any MCP client.

Installation

Claude Code

claude mcp add m365-mcp -e MS365_MCP_CLIENT_ID=your-client-id -e MS365_MCP_TENANT_ID=your-tenant-id -- npx -y @masonator/m365-mcp

Claude Desktop

Add to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "m365-mcp": {
      "command": "npx",
      "args": ["-y", "@masonator/m365-mcp"],
      "env": {
        "MS365_MCP_CLIENT_ID": "your-azure-ad-client-id",
        "MS365_MCP_TENANT_ID": "your-azure-ad-tenant-id"
      }
    }
  }
}

First Run

On first use, the server opens your browser to sign in with Microsoft. After granting consent, tokens are stored locally at ~/.config/m365-mcp/tokens.json (permissions 600) and refreshed automatically.

Environment Variables

VariableRequiredDescription
MS365_MCP_CLIENT_IDYesAzure AD application (client) ID
MS365_MCP_TENANT_IDYesAzure AD tenant ID
MS365_MCP_CLIENT_SECRETNoAzure AD client secret (confidential clients only)
MS365_MCP_TIMEZONENoTimezone for calendar (default: system timezone)
MS365_MCP_REDIRECT_URLNoOAuth redirect URI (default: dynamic port, http://localhost:{port}/callback)

Azure AD Setup

Register an application in Azure AD with these settings:

  • App registration > New registration
  • Redirect URI: http://localhost (Web platform) — or set a fixed URI via MS365_MCP_REDIRECT_URL
  • Certificates & secrets > New client secret
  • API permissions > Add the following delegated permissions:
PermissionUsed by
User.Readms_profile, ms_auth_status
User.Read.Allms_people
Mail.Readms_mail
Calendars.Readms_calendar, ms_schedule, ms_transcripts
Files.Readms_files
Chat.Readms_chat
ChannelMessage.Read.Allms_teams
Channel.ReadBasic.Allms_teams
Team.ReadBasic.Allms_teams
OnlineMeetings.Readms_transcripts
OnlineMeetingTranscript.Read.Allms_transcripts
Sites.Read.Allms_sharepoint
Group.Read.Allms_people
Tasks.Readms_tasks

All permissions are delegated and read-only: the server acts as the signed-in user and cannot reach anyone else's mailbox, chats or files.

Confidential vs public clients. If the registration uses the Web platform with a client secret, the token request must not carry an Origin header — Azure rejects cross-origin token redemption for anything but SPA clients (AADSTS9002326). The server detects this from MS365_MCP_CLIENT_SECRET and omits the header automatically.

Tools

ms_auth_status

Check connection status. If not connected, opens browser to sign in.

ms_profile

Fetch your Microsoft 365 profile — display name, email, job title, office location.

ms_calendar

Fetch calendar events. Defaults to today.

ParameterDescription
dateSpecific date (YYYY-MM-DD)
startStart of range (ISO 8601)
endEnd of range (ISO 8601)
compactSummarise each event, omitting the body. Good for scanning.

ms_mail

Read recent emails with optional keyword search.

ParameterDescription
searchKeyword to filter emails
countNumber of emails (1-25, default 10)

ms_chat

Read Teams chats. Without chat_id lists recent chats; with chat_id returns messages from that thread.

ParameterDescription
chat_idSpecific chat thread ID
countNumber of items (1-25, default 10)

ms_files

Browse or search OneDrive files.

ParameterDescription
pathFolder path (e.g., /Documents)
searchSearch across OneDrive
countMax items (1-50, default 20)

ms_transcripts

Fetch Teams meeting transcripts. Returns previews (~3000 chars) with a transcript_id for drill-down to the full transcript.

ParameterDescription
dateDate (YYYY-MM-DD)
startStart of range (ISO 8601)
endEnd of range (ISO 8601)
transcript_idID from a previous list call for full content

ms_teams

Browse joined Teams, their channels, and channel messages. Progressive drill-down: no arguments lists teams, team_id lists channels, team_id + channel_id reads messages.

ParameterDescription
team_idTeam ID to list its channels
channel_idChannel ID (with team_id) to read messages
message_idMessage ID (with both above) to read its reply thread
countMax results (1-50, default 20)

ms_tasks

Read Microsoft To Do and Planner tasks. Completed tasks are hidden unless asked for.

ParameterDescription
list_idTo Do list ID to read its tasks
plannerReturn assigned Planner tasks instead
include_completedInclude finished tasks (default false)
countMax results (1-50, default 25)

ms_people

Look people up in the organisation directory. search resolves a name to the email address that ms_schedule needs.

ParameterDescription
searchName or partial name to search for
userEmail or object ID — returns details, manager, direct reports
groupsList the signed-in user's group and team memberships
countMax results (1-50, default 20)

Search across mail, Teams chats, calendar, OneDrive and SharePoint in one call. Use this when you don't already know where something lives. Supports KQL, so from:jane subject:budget works.

ParameterDescription
queryWhat to search for (required)
typesLimit to mail, chat, calendar, files, sharepoint
countMax results per area (1-25, default 5)

ms_insights

Documents you recently worked with, or that were shared with you.

ParameterDescription
kindused (default), shared, or trending
countMax results (1-50, default 15)

trending is disabled by policy in many tenants; the tool says so plainly rather than returning an error.

ms_brief

One call that assembles a catch-up, composed from the tools above.

With no arguments: today's meetings, unread mail, recent chats, open Planner tasks and yesterday's meeting transcripts. With person: who they are, plus your recent mail and chats involving them.

ParameterDescription
personCatch up on one person — name or email
dateDate for the brief (YYYY-MM-DD, defaults to today)
countMax items per section (1-15, default 5)

A section that fails is marked as unavailable rather than taking the whole brief down.

ms_server_info

Server metadata: version, registered tools, and which environment variables are set.

Development

git clone https://github.com/StuMason/m365-mcp.git
cd m365-mcp
npm install
npm run build
npm test

Contributing

See CONTRIBUTING.md for details.

License

MIT - Stu Mason

Keywords

microsoft-365

FAQs

Package last updated on 11 Sep 2026

Related posts