Skip to content
Conduit

mcp server

office365-mcp-server

MCP server for Microsoft 365 integration — Outlook, Calendar, OneDrive, SharePoint, and Teams

leonardocrdso/office365-mcp-servercommunitylistedunreviewednot running here yet

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • Node.js 20 or newer
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "leonardocrdso-office365-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@leonardocrdso/office365-mcp-server"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 14, 2026

@leonardocrdso/office365-mcp-server

An MCP (Model Context Protocol) server for Microsoft 365 integration. Interact with Outlook, Calendar, OneDrive, SharePoint and Teams via Microsoft Graph API.

Installation

Using npx (recommended)

AZURE_CLIENT_ID=your-client-id npx @leonardocrdso/office365-mcp-server

Adding to Claude Code

claude mcp add office365-mcp-server -e AZURE_CLIENT_ID=your-client-id -- npx @leonardocrdso/office365-mcp-server

Manual configuration

Add to your MCP client settings:

{
  "mcpServers": {
    "office365-mcp-server": {
      "command": "npx",
      "args": ["@leonardocrdso/office365-mcp-server"],
      "env": {
        "AZURE_CLIENT_ID": "your-client-id",
        "AZURE_TENANT_ID": "common"
      }
    }
  }
}

Azure AD Setup

  1. Go to Azure Portal > Microsoft Entra ID > App registrations
  2. Click New registration:
    • Name: Office 365 MCP Server
    • Supported account types: Accounts in any organizational directory (multi-tenant)
    • Redirect URI: leave empty
  3. In Authentication: set Allow public client flows to Yes
  4. In API permissions > Add permissions > Microsoft Graph > Delegated permissions, add:
    • User.Read
    • Mail.Read, Mail.Send, Mail.ReadWrite
    • Calendars.Read, Calendars.ReadWrite
    • Files.Read.All, Files.ReadWrite.All
    • Sites.Read.All, Sites.ReadWrite.All
    • Team.ReadBasic.All, Channel.ReadBasic.All, ChannelMessage.Send
    • ChannelMessage.Read.All — requires admin consent; without it, reading channel messages (and their files) returns 403
    • Chat.Read, Chat.ReadWrite
  5. Copy the Application (client) ID and use as AZURE_CLIENT_ID

Tools

Auth

ToolDescription
configureSet Azure credentials (Client ID and Tenant ID) — saved to persistent storage
loginStart Device Code Flow authentication — returns a code and URL
auth-statusCheck authentication status, logged-in user info and active storage path
logoutSign out and remove cached tokens

Mail

ToolDescription
list-emailsList emails from Outlook (inbox or specific folder)
search-emailsSearch emails for one exact phrase, optionally within a received date window (receivedAfter/receivedBefore); follows Graph paging and reports coverage, with the receivedBefore to continue when results were cut
read-emailRead full email content by ID
download-email-attachmentSave email attachments to local disk (by name, or all non-inline) and return their paths
send-emailSend a new email, optionally with local file attachments (up to 150 MB each)
reply-emailReply to an existing email, optionally with local file attachments
list-mail-foldersList email folders

Calendar

ToolDescription
list-eventsList calendar events in a date range
create-eventCreate a new event or meeting, optionally with local file attachments (invites go out with the files attached)
update-eventUpdate an existing event
delete-eventDelete an event
find-free-slotsCheck availability for meeting attendees
download-event-attachmentSave event attachments to local disk (by name, or all non-inline) and return their paths

OneDrive

ToolDescription
list-drive-filesList files and folders
read-file-contentRead text file content
download-drive-fileSave a OneDrive/SharePoint file (by ID, path or sharing link) to local disk and return its path
upload-fileUpload a file (up to 4MB text)
upload-drive-fileUpload a local file (by absolute path, within allowed folders) to OneDrive or a SharePoint drive
search-filesSearch files by text
share-fileCreate a sharing link

SharePoint

ToolDescription
list-sitesList SharePoint sites
get-siteGet site details
list-document-librariesList document libraries
list-library-itemsList library items
search-sharepointSearch SharePoint content

Teams

ToolDescription
list-teamsList joined teams
list-channelsList team channels
list-channel-messagesList channel messages
list-channel-message-repliesList replies in a channel message thread
send-channel-messageSend a channel message
list-chatsList direct chats
list-chat-messagesList chat messages
send-chat-messageSend a chat message
send-teams-fileSend a local file to a chat, channel or thread reply (uploaded to OneDrive/SharePoint and shared with chat members)
download-teams-message-filesSave files and inline images from a chat message, channel message or thread reply to local disk and return their paths

Environment Variables

VariableRequiredDefaultDescription
AZURE_CLIENT_IDYes—App registration client ID
AZURE_TENANT_IDNocommonTenant ID or common for multi-tenant
OFFICE365_MCP_HOMENo~/Directory for isolated config and token storage
OFFICE365_MCP_FLAG_PATH_MARKERSNo—Comma-separated path markers; matching OneDrive/SharePoint items get a warning prefix in their name
OFFICE365_MCP_UPLOAD_DIRSNo—Comma-separated folders the server may read local files from for uploads/attachments (the downloads folder is always allowed)

Isolated storage (multi-agent)

When OFFICE365_MCP_HOME is set, config and token cache are stored inside that directory (config.json and tokens.json). The directory is created automatically if it doesn't exist. Downloaded files go to downloads/ inside it (without it, to the system temp dir), one subfolder per download so the original file name is kept, capped at 100 MB per file and removed about an hour after download (swept at startup, every 15 minutes and before each new download).

This allows running multiple isolated instances of the server — for example, one per agent in an orchestrator like OpenClaw — without auth leaking between them:

{
  "mcpServers": {
    "office365-agent-a": {
      "command": "npx",
      "args": ["@leonardocrdso/office365-mcp-server"],
      "env": {
        "AZURE_CLIENT_ID": "your-client-id",
        "AZURE_TENANT_ID": "your-tenant-id",
        "OFFICE365_MCP_HOME": "/path/to/agents/agent-a/office365"
      }
    },
    "office365-agent-b": {
      "command": "npx",
      "args": ["@leonardocrdso/office365-mcp-server"],
      "env": {
        "AZURE_CLIENT_ID": "your-client-id",
        "AZURE_TENANT_ID": "your-tenant-id",
        "OFFICE365_MCP_HOME": "/path/to/agents/agent-b/office365"
      }
    }
  }
}

Without OFFICE365_MCP_HOME, storage falls back to ~/.office365-mcp-config.json and ~/.office365-mcp-tokens.json (default behavior, unchanged).

Development

# Install dependencies
bun install

# Run in development mode
bun run dev

# Build
bun run build

License

MIT

↑↓ navigate openesc close