{"id":"f4671b7e-c8c2-4d2b-9ddd-2bd0db7045ac","slug":"leonardocrdso-office365-mcp-server","kind":"mcp","name":"office365-mcp-server","summary":"MCP server for Microsoft 365 integration — Outlook, Calendar, OneDrive, SharePoint, and Teams","owner":"leonardocrdso","repoUrl":"https://github.com/leonardocrdso/office365-mcp-server","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-02-24T18:17:01.000Z","addedAt":"2026-10-14T11:07:40.286Z","logoUrl":"https://avatars.githubusercontent.com/u/108677682?u=1f31492c0882a1267cd4d2a2019f369afac2116d&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["productivity","communication","cloud-infra"],"tags":["ai-tools","claude","microsoft-365","microsoft-graph","microsoft-teams","onedrive","outlook","sharepoint"],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-14T20:39:33.542Z","sample":false,"url":"https://conduits.dev/tools/leonardocrdso-office365-mcp-server","language":"TypeScript","transports":["stdio"],"install":{"npm":"@leonardocrdso/office365-mcp-server"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# @leonardocrdso/office365-mcp-server\n\nAn MCP (Model Context Protocol) server for Microsoft 365 integration. Interact with Outlook, Calendar, OneDrive, SharePoint and Teams via Microsoft Graph API.\n\n## Installation\n\n### Using npx (recommended)\n\n```bash\nAZURE_CLIENT_ID=your-client-id npx @leonardocrdso/office365-mcp-server\n```\n\n### Adding to Claude Code\n\n```bash\nclaude mcp add office365-mcp-server -e AZURE_CLIENT_ID=your-client-id -- npx @leonardocrdso/office365-mcp-server\n```\n\n### Manual configuration\n\nAdd to your MCP client settings:\n\n```json\n{\n  \"mcpServers\": {\n    \"office365-mcp-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"@leonardocrdso/office365-mcp-server\"],\n      \"env\": {\n        \"AZURE_CLIENT_ID\": \"your-client-id\",\n        \"AZURE_TENANT_ID\": \"common\"\n      }\n    }\n  }\n}\n```\n\n## Azure AD Setup\n\n1. Go to [Azure Portal](https://portal.azure.com) > **Microsoft Entra ID** > **App registrations**\n2. Click **New registration**:\n   - Name: `Office 365 MCP Server`\n   - Supported account types: **Accounts in any organizational directory** (multi-tenant)\n   - Redirect URI: leave empty\n3. In **Authentication**: set **Allow public client flows** to **Yes**\n4. In **API permissions** > **Add permissions** > **Microsoft Graph** > **Delegated permissions**, add:\n   - `User.Read`\n   - `Mail.Read`, `Mail.Send`, `Mail.ReadWrite`\n   - `Calendars.Read`, `Calendars.ReadWrite`\n   - `Files.Read.All`, `Files.ReadWrite.All`\n   - `Sites.Read.All`, `Sites.ReadWrite.All`\n   - `Team.ReadBasic.All`, `Channel.ReadBasic.All`, `ChannelMessage.Send`\n   - `ChannelMessage.Read.All` — requires **admin consent**; without it, reading channel messages (and their files) returns 403\n   - `Chat.Read`, `Chat.ReadWrite`\n5. Copy the **Application (client) ID** and use as `AZURE_CLIENT_ID`\n\n## Tools\n\n### Auth\n\n| Tool | Description |\n|------|-------------|\n| `configure` | Set Azure credentials (Client ID and Tenant ID) — saved to persistent storage |\n| `login` | Start Device Code Flow authentication — returns a code and URL |\n| `auth-status` | Check authentication status, logged-in user info and active storage path |\n| `logout` | Sign out and remove cached tokens |\n\n### Mail\n\n| Tool | Description |\n|------|-------------|\n| `list-emails` | List emails from Outlook (inbox or specific folder) |\n| `search-emails` | Search 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 |\n| `read-email` | Read full email content by ID |\n| `download-email-attachment` | Save email attachments to local disk (by name, or all non-inline) and return their paths |\n| `send-email` | Send a new email, optionally with local file attachments (up to 150 MB each) |\n| `reply-email` | Reply to an existing email, optionally with local file attachments |\n| `list-mail-folders` | List email folders |\n\n### Calendar\n\n| Tool | Description |\n|------|-------------|\n| `list-events` | List calendar events in a date range |\n| `create-event` | Create a new event or meeting, optionally with local file attachments (invites go out with the files attached) |\n| `update-event` | Update an existing event |\n| `delete-event` | Delete an event |\n| `find-free-slots` | Check availability for meeting attendees |\n| `download-event-attachment` | Save event attachments to local disk (by name, or all non-inline) and return their paths |\n\n### OneDrive\n\n| Tool | Description |\n|------|-------------|\n| `list-drive-files` | List files and folders |\n| `read-file-content` | Read text file content |\n| `download-drive-file` | Save a OneDrive/SharePoint file (by ID, path or sharing link) to local disk and return its path |\n| `upload-file` | Upload a file (up to 4MB text) |\n| `upload-drive-file` | Upload a local file (by absolute path, within allowed folders) to OneDrive or a SharePoint drive |\n| `search-files` | Search files by text |\n| `share-file` | Create a sharing link |\n\n### SharePoint\n\n| Tool | Description |\n|------|-------------|\n| `list-sites` | List SharePoint sites |\n| `get-site` | Get site details |\n| `list-document-libraries` | List document libraries |\n| `list-library-items` | List library items |\n| `search-sharepoint` | Search SharePoint content |\n\n### Teams\n\n| Tool | Description |\n|------|-------------|\n| `list-teams` | List joined teams |\n| `list-channels` | List team channels |\n| `list-channel-messages` | List channel messages |\n| `list-channel-message-replies` | List replies in a channel message thread |\n| `send-channel-message` | Send a channel message |\n| `list-chats` | List direct chats |\n| `list-chat-messages` | List chat messages |\n| `send-chat-message` | Send a chat message |\n| `send-teams-file` | Send a local file to a chat, channel or thread reply (uploaded to OneDrive/SharePoint and shared with chat members) |\n| `download-teams-message-files` | Save files and inline images from a chat message, channel message or thread reply to local disk and return their paths |\n\n## Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `AZURE_CLIENT_ID` | Yes | — | App registration client ID |\n| `AZURE_TENANT_ID` | No | `common` | Tenant ID or `common` for multi-tenant |\n| `OFFICE365_MCP_HOME` | No | `~/` | Directory for isolated config and token storage |\n| `OFFICE365_MCP_FLAG_PATH_MARKERS` | No | — | Comma-separated path markers; matching OneDrive/SharePoint items get a warning prefix in their name |\n| `OFFICE365_MCP_UPLOAD_DIRS` | No | — | Comma-separated folders the server may read local files from for uploads/attachments (the downloads folder is always allowed) |\n\n### Isolated storage (multi-agent)\n\nWhen `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).\n\nThis allows running multiple isolated instances of the server — for example, one per agent in an orchestrator like OpenClaw — without auth leaking between them:\n\n```json\n{\n  \"mcpServers\": {\n    \"office365-agent-a\": {\n      \"command\": \"npx\",\n      \"args\": [\"@leonardocrdso/office365-mcp-server\"],\n      \"env\": {\n        \"AZURE_CLIENT_ID\": \"your-client-id\",\n        \"AZURE_TENANT_ID\": \"your-tenant-id\",\n        \"OFFICE365_MCP_HOME\": \"/path/to/agents/agent-a/office365\"\n      }\n    },\n    \"office365-agent-b\": {\n      \"command\": \"npx\",\n      \"args\": [\"@leonardocrdso/office365-mcp-server\"],\n      \"env\": {\n        \"AZURE_CLIENT_ID\": \"your-client-id\",\n        \"AZURE_TENANT_ID\": \"your-tenant-id\",\n        \"OFFICE365_MCP_HOME\": \"/path/to/agents/agent-b/office365\"\n      }\n    }\n  }\n}\n```\n\nWithout `OFFICE365_MCP_HOME`, storage falls back to `~/.office365-mcp-config.json` and `~/.office365-mcp-tokens.json` (default behavior, unchanged).\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run in development mode\nbun run dev\n\n# Build\nbun run build\n```\n\n## License\n\nMIT\n"}