Skip to content
Back to search

outlook-mcp

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ryaker--outlook-mcp/badge.svg)](/listings/ryaker--outlook-mcp)

HTML

<a href="/listings/ryaker--outlook-mcp"><img src="/api/listings/ryaker--outlook-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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!

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 280 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/ryaker-outlook-mcp-badge.png)](https://mseep.ai/app/ryaker-outlook-mcp)
  2. # M365 Assistant MCP Server
  3. A comprehensive MCP (Model Context Protocol) server that connects Claude with Microsoft 365 services through the Microsoft Graph API and Power Automate API.
  4. ## Supported Services
  5. - **Outlook** - Email, calendar, folders, and rules
  6. - **OneDrive** - Files, folders, search, and sharing
  7. - **Power Automate** - Flows, environments, and run history
  8. ## Directory Structure
  9. ```
  10. ├── index.js # Main entry point
  11. ├── config.js # Configuration settings
  12. ├── auth/ # Authentication modules
  13. │ ├── index.js # Authentication exports
  14. │ ├── token-manager.js # Token storage and refresh (Graph + Flow)
  15. │ └── tools.js # Auth-related tools
  16. ├── calendar/ # Calendar functionality
  17. │ ├── index.js # Calendar exports
  18. │ ├── list.js # List events
  19. │ ├── create.js # Create event
  20. │ ├── delete.js # Delete event
  21. │ ├── cancel.js # Cancel event
  22. │ ├── accept.js # Accept event
  23. │ └── decline.js # Decline event
  24. ├── email/ # Email functionality
  25. │ ├── index.js # Email exports
  26. │ ├── list.js # List emails
  27. │ ├── search.js # Search emails
  28. │ ├── read.js # Read email
  29. │ ├── send.js # Send email
  30. │ └── mark-as-read.js # Mark email read/unread
  31. ├── folder/ # Folder functionality
  32. │ ├── index.js # Folder exports
  33. │ ├── list.js # List folders
  34. │ ├── create.js # Create folder
  35. │ └── move.js # Move emails
  36. ├── rules/ # Email rules functionality
  37. │ ├── index.js # Rules exports
  38. │ ├── list.js # List rules
  39. │ └── create.js # Create rule
  40. ├── onedrive/ # OneDrive functionality
  41. │ ├── index.js # OneDrive exports
  42. │ ├── list.js # List files/folders
  43. │ ├── search.js # Search files
  44. │ ├── download.js # Get download URL
  45. │ ├── upload.js # Simple upload (<4MB)
  46. │ ├── upload-large.js # Chunked upload (>4MB)
  47. │ ├── share.js # Create sharing link
  48. │ └── folder.js # Create/delete folders
  49. ├── power-automate/ # Power Automate functionality
  50. │ ├── index.js # Power Automate exports
  51. │ ├── flow-api.js # Flow API client
  52. │ ├── list-environments.js # List environments
  53. │ ├── list-flows.js # List flows
  54. │ ├── run-flow.js # Trigger flow
  55. │ ├── list-runs.js # Run history
  56. │ └── toggle-flow.js # Enable/disable flow
  57. └── utils/ # Utility functions
  58. ├── graph-api.js # Microsoft Graph API helper
  59. ├── odata-helpers.js # OData query building
  60. └── mock-data.js # Test mode data
  61. ```
  62. ## Features
  63. - **Authentication**: OAuth 2.0 authentication with Microsoft Graph API (+ Flow API for Power Automate)
  64. - **Email Management**: List, search, read, send, and organize emails
  65. - **Calendar Management**: List, create, accept, decline, and delete calendar events
  66. - **OneDrive Integration**: List, search, upload, download, and share files
  67. - **Power Automate**: List environments/flows, trigger flows, view run history
  68. - **Modular Structure**: Clean separation of concerns for maintainability
  69. - **Test Mode**: Simulated responses for testing without real API calls
  70. ## Available Tools
  71. ### Outlook (Email & Calendar)
  72. | Tool | Description |
  73. |------|-------------|
  74. | `list-emails` | List recent emails from inbox |
  75. | `search-emails` | Search emails with filters |
  76. | `read-email` | Read email content |
  77. | `send-email` | Send a new email |
  78. | `mark-as-read` | Mark email as read/unread |
  79. | `list-events` | List calendar events |
  80. | `create-event` | Create calendar event |
  81. | `accept-event` | Accept event invitation |
  82. | `decline-event` | Decline event invitation |
  83. | `delete-event` | Delete calendar event |
  84. | `list-folders` | List mail folders |
  85. | `create-folder` | Create mail folder |
  86. | `move-emails` | Move emails between folders |
  87. | `list-rules` | List inbox rules |
  88. | `create-rule` | Create inbox rule |
  89. ### OneDrive
  90. | Tool | Description |
  91. |------|-------------|
  92. | `onedrive-list` | List files in a path |
  93. | `onedrive-search` | Search files by query |
  94. | `onedrive-download` | Get download URL |
  95. | `onedrive-upload` | Upload small file (<4MB) |
  96. | `onedrive-upload-large` | Chunked upload (>4MB) |
  97. | `onedrive-share` | Create sharing link |
  98. | `onedrive-create-folder` | Create folder |
  99. | `onedrive-delete` | Delete file or folder |
  100. ### Power Automate
  101. | Tool | Description |
  102. |------|-------------|
  103. | `flow-list-environments` | List Power Platform environments |
  104. | `flow-list` | List flows in environment |
  105. | `flow-run` | Trigger a manual flow |
  106. | `flow-list-runs` | Get flow run history |
  107. | `flow-toggle` | Enable/disable a flow |
  108. ## Quick Start
  109. 1. **Install dependencies**: `npm install`
  110. 2. **Azure setup**: Register app in Azure Portal (see detailed steps below)
  111. 3. **Configure environment**: Copy `.env.example` to `.env` and add your Azure credentials
  112. 4. **Configure Claude**: Update your Claude Desktop config with the server path
  113. 5. **Start auth server**: `npm run auth-server`
  114. 6. **Authenticate**: Use the authenticate tool in Claude to get the OAuth URL
  115. 7. **Start using**: Access your M365 data through Claude!
  116. ## Installation
  117. ### Prerequisites
  118. - Node.js 14.0.0 or higher
  119. - npm or yarn package manager
  120. - Azure account for app registration
  121. ### Install Dependencies
  122. ```bash
  123. npm install
  124. ```
  125. ## Azure App Registration & Configuration
  126. ### App Registration
  127. 1. Open [Azure Portal](https://portal.azure.com/)
  128. 2. Search for "App registrations"
  129. 3. Click "New registration"
  130. 4. Name: "M365 MCP Server"
  131. 5. Account type: "Accounts in any organizational directory and personal Microsoft accounts"
  132. 6. Redirect URI: Web → `http://localhost:3333/auth/callback`
  133. 7. Click "Register"
  134. 8. Copy the "Application (client) ID" for your `.env` file
  135. ### App Permissions
  136. 1. Go to "API permissions" under Manage
  137. 2. Click "Add a permission" → "Microsoft Graph" → "Delegated permissions"
  138. 3. Add these permissions:
  139. - `offline_access`
  140. - `User.Read`
  141. - `Mail.Read`, `Mail.ReadWrite`, `Mail.Send`
  142. - `Calendars.Read`, `Calendars.ReadWrite`
  143. - `Files.Read`, `Files.ReadWrite`
  144. 4. Click "Add permissions"
  145. **For Power Automate** (optional):
  146. - Requires additional Azure AD configuration with Flow API scope
  147. - See Power Automate section below for details
  148. ### Client Secret
  149. 1. Go to "Certificates & secrets" → "Client secrets"
  150. 2. Click "New client secret"
  151. 3. Add description and select expiration
  152. 4. **Copy the VALUE** (not the Secret ID)
  153. ## Configuration
  154. ### 1. Environment Variables
  155. ```bash
  156. cp .env.example .env
  157. ```
  158. Edit `.env`:
  159. ```bash
  160. # Get these values from Azure Portal > App Registrations > Your App
  161. MS_CLIENT_ID=your-application-client-id-here
  162. MS_CLIENT_SECRET=your-client-secret-VALUE-here
  163. MS_TENANT_ID=your-tenant-id-here
  164. USE_TEST_MODE=false
  165. ```
  166. **Important Notes:**
  167. - Use `MS_CLIENT_ID` and `MS_CLIENT_SECRET` in the `.env` file
  168. - Set `MS_TENANT_ID` for single-tenant apps to avoid `/common` endpoint errors
  169. - For Claude Desktop config, you'll use `OUTLOOK_CLIENT_ID` and `OUTLOOK_CLIENT_SECRET`
  170. - Always use the client secret **VALUE**, never the Secret ID
  171. ### 2. Claude Desktop Configuration
  172. Add to your Claude Desktop config:
  173. ```json
  174. {
  175. "mcpServers": {
  176. "m365-assistant": {
  177. "command": "node",
  178. "args": ["/path/to/outlook-mcp/index.js"],
  179. "env": {
  180. "USE_TEST_MODE": "false",
  181. "OUTLOOK_CLIENT_ID": "your-client-id",
  182. "OUTLOOK_CLIENT_SECRET": "your-client-secret"
  183. }
  184. }
  185. }
  186. }
  187. ```
  188. ## Authentication
  189. ### Graph API (Outlook + OneDrive)
  190. 1. Start auth server: `npm run auth-server`
  191. 2. Use the `authenticate` tool in Claude
  192. 3. Visit the provided URL and sign in
  193. 4. Tokens saved to `~/.outlook-mcp-tokens.json`
  194. ### Power Automate (Optional)
  195. Power Automate requires a separate token with the Flow API scope. Configure additional Azure AD permissions for `https://service.flow.microsoft.com//.default` scope.
  196. **Limitations:**
  197. - Only solution-aware flows are accessible
  198. - Only manual trigger flows can be run via API
  199. - Requires environment ID for most operations
  200. ## Troubleshooting
  201. ### Common Issues
  202. **"Cannot find module"**
  203. ```bash
  204. npm install
  205. ```
  206. **"Port 3333 in use"**
  207. ```bash
  208. npx kill-port 3333
  209. npm run auth-server
  210. ```
  211. **"Invalid client secret" (AADSTS7000215)**
  212. - Use the secret **VALUE**, not the Secret ID
  213. **"Authentication required"**
  214. - Delete `~/.outlook-mcp-tokens.json` and re-authenticate
  215. ## Testing
  216. ```bash
  217. # Run with MCP Inspector
  218. npm run inspect
  219. # Run in test mode (mock data)
  220. npm run test-mode
  221. # Run Jest tests
  222. npm test
  223. ```
  224. ## Extending the Server
  225. 1. Create new module directory
  226. 2. Implement tool handlers in separate files
  227. 3. Export tool definitions from module index
  228. 4. Import and add to `TOOLS` array in `index.js`

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.