@littlebearapps/outlook-assistant 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/.env.example +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +422 -0
  4. package/advanced/index.js +652 -0
  5. package/auth/index.js +32 -0
  6. package/auth/oauth-server.js +233 -0
  7. package/auth/token-manager.js +105 -0
  8. package/auth/token-storage.js +359 -0
  9. package/auth/tools.js +159 -0
  10. package/calendar/accept.js +72 -0
  11. package/calendar/cancel.js +72 -0
  12. package/calendar/create.js +115 -0
  13. package/calendar/decline.js +72 -0
  14. package/calendar/delete.js +67 -0
  15. package/calendar/index.js +130 -0
  16. package/calendar/list.js +108 -0
  17. package/categories/index.js +955 -0
  18. package/config.js +95 -0
  19. package/contacts/index.js +754 -0
  20. package/email/attachments.js +365 -0
  21. package/email/conversations.js +666 -0
  22. package/email/delta.js +210 -0
  23. package/email/export.js +572 -0
  24. package/email/folder-utils.js +192 -0
  25. package/email/headers.js +344 -0
  26. package/email/index.js +537 -0
  27. package/email/list.js +136 -0
  28. package/email/mark-as-read.js +114 -0
  29. package/email/mime.js +286 -0
  30. package/email/read.js +161 -0
  31. package/email/search.js +628 -0
  32. package/email/send.js +169 -0
  33. package/folder/create.js +137 -0
  34. package/folder/delete.js +108 -0
  35. package/folder/index.js +112 -0
  36. package/folder/list.js +289 -0
  37. package/folder/move.js +186 -0
  38. package/folder/stats.js +322 -0
  39. package/index.js +162 -0
  40. package/llms.txt +76 -0
  41. package/outlook-auth-server.js +384 -0
  42. package/package.json +97 -0
  43. package/rules/create.js +273 -0
  44. package/rules/index.js +276 -0
  45. package/rules/list.js +216 -0
  46. package/settings/index.js +678 -0
  47. package/utils/field-presets.js +311 -0
  48. package/utils/graph-api.js +268 -0
  49. package/utils/mock-data.js +154 -0
  50. package/utils/odata-helpers.js +33 -0
  51. package/utils/response-formatter.js +457 -0
  52. package/utils/safety.js +123 -0
package/.env.example ADDED
@@ -0,0 +1,22 @@
1
+ # Microsoft Azure App Registration Credentials
2
+ # Get these from Azure Portal > App Registrations > Your App
3
+
4
+ # Application (client) ID from Azure Portal
5
+ OUTLOOK_CLIENT_ID=your-client-id-here
6
+
7
+ # Client secret VALUE (not the secret ID) from Azure Portal > Certificates & secrets
8
+ OUTLOOK_CLIENT_SECRET=your-client-secret-here
9
+
10
+ # Backwards-compatible aliases (also accepted):
11
+ # MS_CLIENT_ID=your-client-id-here
12
+ # MS_CLIENT_SECRET=your-client-secret-here
13
+
14
+ # Optional: Enable test mode with mock data (true/false)
15
+ USE_TEST_MODE=false
16
+
17
+ # Optional: Safety controls for send-email
18
+ # Maximum emails that can be sent per server session (0 = unlimited)
19
+ # OUTLOOK_MAX_EMAILS_PER_SESSION=10
20
+
21
+ # Restrict sending to specific domains/addresses (comma-separated)
22
+ # OUTLOOK_ALLOWED_RECIPIENTS=mycompany.com,partner@example.com
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Little Bear Apps
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,422 @@
1
+ <p align="center">
2
+ <img src="docs/assets/outlook-assistant-logo-full.svg" height="200" alt="Outlook Assistant" />
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>Let your AI assistant read, search, send, and manage your Outlook email, calendar, and contacts — all from the conversation.</strong>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@littlebearapps/outlook-assistant"><img src="https://img.shields.io/npm/v/@littlebearapps/outlook-assistant" alt="npm version" /></a>
11
+ <a href="https://www.npmjs.com/package/@littlebearapps/outlook-assistant"><img src="https://img.shields.io/npm/dm/@littlebearapps/outlook-assistant" alt="npm downloads" /></a>
12
+ <a href="https://github.com/littlebearapps/outlook-assistant/actions/workflows/ci.yml"><img src="https://github.com/littlebearapps/outlook-assistant/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
13
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
14
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen" alt="Node.js" /></a>
15
+ </p>
16
+
17
+ Outlook Assistant connects AI assistants to your Microsoft Outlook account through the [Model Context Protocol](https://modelcontextprotocol.io/). Ask your AI assistant to search your inbox, send emails, schedule meetings, manage contacts, and configure mailbox settings — without leaving the conversation. Works with Claude, Cursor, Windsurf, and any MCP-compatible client.
18
+
19
+ **Works with personal Outlook.com and work/school Microsoft 365 accounts.**
20
+
21
+ ### What you can do
22
+
23
+ - **Search and read emails** — find messages by sender, subject, date, or keywords; read full threads with conversation grouping; batch flag, move, export, or categorise multiple emails at once
24
+ - **Send emails with safety controls** — dry-run preview, session rate limiting, and recipient allowlist to prevent mistakes
25
+ - **Manage your calendar** — view upcoming events, schedule meetings with attendees, decline or cancel invitations
26
+ - **Export emails** — save to Markdown, EML, MBOX, JSON, or HTML for archiving, analysis, or migration; export search results or entire threads in one call
27
+ - **Investigate email headers** — check DKIM, SPF, and DMARC authentication; trace delivery chains; analyse spam scores — useful for phishing investigation and compliance
28
+ - **Organise your inbox** — create folders, set up inbox rules, colour-code with categories, manage Focused Inbox — all work together for complete inbox automation
29
+ - **Track inbox changes** — delta sync detects new, modified, and deleted emails since your last check, with tokens for incremental polling
30
+ - **Manage contacts** — search your contact book and organisational directory, create and update contact records
31
+ - **Configure settings** — set out-of-office auto-replies, working hours, and time zone
32
+ - **Access shared mailboxes** — read team inboxes and service accounts (Microsoft 365)
33
+ - **Find meeting rooms** — search by building, floor, capacity, AV equipment, and wheelchair accessibility (Microsoft 365)
34
+
35
+ ### Why Outlook Assistant?
36
+
37
+ | Without Outlook Assistant | With Outlook Assistant |
38
+ |---------------------|------------------|
39
+ | Switch between your AI tool and Outlook to manage email | Read, search, send, and export emails directly from your AI assistant |
40
+ | Manually search and export email threads | Full email tools including search, threading, and bulk export |
41
+ | Context-switch for calendar and contacts | Manage calendar events, contacts, and settings in one place |
42
+ | Copy-paste email content into conversations | Your AI assistant reads your emails natively with full context |
43
+ | No programmatic access to mailbox rules or categories | Create inbox rules, manage categories, configure auto-replies |
44
+ | Manually check each email for phishing red flags | Forensic header analysis — DKIM, SPF, DMARC, spam scores, and delivery chain in one call |
45
+ | Poll your inbox to check for new mail | Delta sync returns only changes since your last check, with tokens for continuous polling |
46
+
47
+ ## Features
48
+
49
+ | Module | Tools | What You Can Do |
50
+ |--------|------:|-----------------|
51
+ | **Email** | 6 | `search-emails` (list/search/delta/conversations), `read-email` (content + forensic headers), `send-email` (with dry-run), `update-email` (read status, flags), `attachments`, `export` |
52
+ | **Calendar** | 3 | `list-events`, `create-event`, `manage-event` (decline/cancel/delete) |
53
+ | **Contacts** | 2 | `manage-contact` (list/search/get/create/update/delete), `search-people` |
54
+ | **Categories** | 3 | `manage-category` (CRUD), `apply-category`, `manage-focused-inbox` |
55
+ | **Settings** | 1 | `mailbox-settings` (get/set auto-replies/set working hours) |
56
+ | **Folder** | 1 | `folders` (list/create/move/stats/delete) |
57
+ | **Rules** | 1 | `manage-rules` (list/create/reorder/delete) |
58
+ | **Advanced** | 2 | `access-shared-mailbox`, `find-meeting-rooms` |
59
+ | **Auth** | 1 | `auth` (status/authenticate/about) |
60
+
61
+ **20 tools total** — consolidated from 55 for optimal AI performance. See the [Tools Reference](docs/quickrefs/tools-reference.md) for complete parameter details.
62
+
63
+ ### Export Formats
64
+
65
+ | Format | Extension | When to Use It |
66
+ |--------|-----------|----------------|
67
+ | `mime` / `eml` | `.eml` | Legal holds, forensic preservation, importing into other mail clients |
68
+ | `mbox` | `.mbox` | Archiving entire conversation threads, migrating between systems |
69
+ | `markdown` | `.md` | Pasting into documents, feeding into AI workflows |
70
+ | `json` | `.json` | Data analysis, pipeline processing, compliance reporting |
71
+ | `html` | `.html` | Visual archival with formatting intact |
72
+
73
+ Export individual emails, search results, or entire conversation threads — use `target=messages` with a search query to batch-export without manually collecting IDs.
74
+
75
+ ## Account Compatibility
76
+
77
+ Outlook Assistant works with both personal and work/school Microsoft accounts, but some features behave differently:
78
+
79
+ | Feature | Personal (Outlook.com) | Work/School (Microsoft 365) |
80
+ |---------|----------------------|---------------------------|
81
+ | Email read, send, search | Full support | Full support |
82
+ | Calendar events | Full support | Full support |
83
+ | Contacts CRUD | Full support | Full support |
84
+ | Inbox rules | Full support | Full support |
85
+ | Folders | Full support | Full support |
86
+ | Free-text `query` search | Limited — use `subject`, `from`, `to` filters instead | Full KQL support |
87
+ | Categories | Full support | Full support |
88
+ | Mailbox settings | Full support | Full support |
89
+ | Focused Inbox | Not available | Full support |
90
+ | Shared mailboxes | Not available | Requires `Mail.Read.Shared` |
91
+ | Meeting room search | Not available | Requires `Place.Read.All` + admin consent |
92
+
93
+ > **Note**: On personal accounts, Microsoft's `$search` API has limited support for free-text queries. Outlook Assistant handles this automatically with progressive search — if your query returns no results, it falls back through OData filters, boolean filters, and recent message listing to find your emails. For the most direct results on personal accounts, use the structured filter parameters (`from`, `subject`, `to`, `receivedAfter`).
94
+
95
+ ### What Makes This Different
96
+
97
+ - **Progressive search** — on accounts where Microsoft's `$search` API is limited, Outlook Assistant automatically falls back through up to 4 search strategies to find your emails. Most Graph API wrappers fail silently; this one adapts.
98
+ - **Email forensics** — full header analysis (DKIM, SPF, DMARC, delivery chain, spam scores) built in as a first-class feature — useful for phishing investigation, compliance, and security review.
99
+ - **Delta sync** — incremental inbox monitoring returns only what changed since your last check, with tokens for continuous polling. Designed for agent workflows that need to watch a mailbox.
100
+ - **Batch operations** — flag, move, export, or categorise multiple emails in a single call. Search-driven export lets you batch-export results without collecting IDs manually.
101
+ - **Compound automation** — rules, categories, folders, and Focused Inbox work together. Set up complete inbox management through your AI assistant in one conversation.
102
+
103
+ ## Safety & Token Efficiency
104
+
105
+ Outlook Assistant is designed with safety-first principles for AI-driven email access:
106
+
107
+ **Destructive action safeguards** — Every tool carries [MCP annotations](https://modelcontextprotocol.io/docs/concepts/tools#annotations) (`readOnlyHint`, `destructiveHint`, `idempotentHint`) so AI clients can auto-approve safe reads and prompt for confirmation on destructive operations like sending email or deleting events.
108
+
109
+ **Send-email protections** — The `send-email` tool includes:
110
+ - **Dry-run mode** (`dryRun: true`) — preview composed emails without sending
111
+ - **Session rate limiting** — configurable via `OUTLOOK_MAX_EMAILS_PER_SESSION` (default: unlimited)
112
+ - **Recipient allowlist** — restrict sending to approved addresses/domains via `OUTLOOK_ALLOWED_RECIPIENTS`
113
+
114
+ **Token-optimised architecture** — Tools are consolidated using the STRAP (Single Tool, Resource, Action Pattern) approach. 20 tools instead of 55 reduces per-turn overhead by ~11,000 tokens (~64%), keeping more of the AI's context window available for your actual conversation. Fewer tools also means the AI selects the right tool more accurately — research shows tool selection degrades beyond ~40 tools.
115
+
116
+ > **Important**: These safeguards are defence-in-depth measures that reduce risk, but they are not a guarantee against unintended actions. AI-driven access to your email is inherently sensitive — always review tool calls before approving, particularly for sends and deletes. No automated guardrail is foolproof, and you remain responsible for actions taken through your mailbox.
117
+
118
+ ## Quick Start
119
+
120
+ ### 1. Install
121
+
122
+ ```bash
123
+ npm install -g @littlebearapps/outlook-assistant
124
+ ```
125
+
126
+ Or run directly without installing:
127
+
128
+ ```bash
129
+ npx @littlebearapps/outlook-assistant
130
+ ```
131
+
132
+ ### 2. Register an Azure App
133
+
134
+ You need a Microsoft Azure app registration to authenticate. See the **[Azure Setup Guide](docs/guides/azure-setup.md)** for a detailed walkthrough (including first-time Azure account creation), or if you've done this before:
135
+
136
+ 1. Create a new app registration at [portal.azure.com](https://portal.azure.com/)
137
+ 2. Set redirect URI to `http://localhost:3333/auth/callback`
138
+ 3. Add Microsoft Graph delegated permissions (Mail, Calendar, Contacts)
139
+ 4. Create a client secret and copy the **Value** (not the Secret ID)
140
+
141
+ ### 3. Configure Your MCP Client
142
+
143
+ Add to your MCP client config. For Claude Desktop (`claude_desktop_config.json`):
144
+
145
+ ```json
146
+ {
147
+ "mcpServers": {
148
+ "outlook": {
149
+ "command": "npx",
150
+ "args": ["@littlebearapps/outlook-assistant"],
151
+ "env": {
152
+ "OUTLOOK_CLIENT_ID": "your-application-client-id",
153
+ "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ ### 4. Authenticate
161
+
162
+ 1. Start the auth server: `outlook-assistant-auth` (or `npx @littlebearapps/outlook-assistant-auth`)
163
+ 2. In your AI assistant, use the `auth` tool with `action=authenticate` to get an OAuth URL
164
+ 3. Open the URL, sign in with your Microsoft account, and grant permissions
165
+ 4. Tokens are saved locally and refresh automatically
166
+
167
+ > **Note**: The auth server needs `OUTLOOK_CLIENT_ID` and `OUTLOOK_CLIENT_SECRET` environment variables. Your MCP client's `"env"` config only applies to the MCP server process — when running the auth server separately, ensure these are set in a `.env` file or exported in your shell.
168
+
169
+ ## Installation
170
+
171
+ ### Prerequisites
172
+
173
+ - **Node.js** 18.0.0 or higher
174
+ - **npm** (included with Node.js)
175
+ - **Azure account** for app registration ([free tier works](https://azure.microsoft.com/free/))
176
+
177
+ ### From npm (recommended)
178
+
179
+ ```bash
180
+ npm install -g @littlebearapps/outlook-assistant
181
+ ```
182
+
183
+ ### From source
184
+
185
+ ```bash
186
+ git clone https://github.com/littlebearapps/outlook-assistant.git
187
+ cd outlook-assistant
188
+ npm install
189
+ ```
190
+
191
+ ## Azure App Registration
192
+
193
+ > **First time with Azure?** The [Azure Setup Guide](docs/guides/azure-setup.md) covers everything from creating an account to your first authentication, including billing setup and common pitfalls.
194
+
195
+ ### Create the App
196
+
197
+ 1. Open [Azure Portal](https://portal.azure.com/)
198
+ 2. Sign in with a Microsoft Work or Personal account
199
+ 3. Search for **App registrations** and click **New registration**
200
+ 4. Enter a name (e.g. "Outlook Assistant Server")
201
+ 5. Select **Accounts in any organizational directory and personal Microsoft accounts**
202
+ 6. Set redirect URI: platform **Web**, URI `http://localhost:3333/auth/callback`
203
+ 7. Click **Register**
204
+ 8. Copy the **Application (client) ID**
205
+
206
+ ### Add Permissions
207
+
208
+ 1. Go to **API permissions** > **Add a permission** > **Microsoft Graph** > **Delegated permissions**
209
+ 2. Add these **required** permissions:
210
+ - `offline_access` — refresh tokens between sessions
211
+ - `User.Read` — basic profile
212
+ - `Mail.Read`, `Mail.ReadWrite`, `Mail.Send` — email operations
213
+ - `Calendars.Read`, `Calendars.ReadWrite` — calendar operations
214
+ - `Contacts.Read`, `Contacts.ReadWrite` — contact management
215
+ - `MailboxSettings.ReadWrite` — settings, auto-replies, categories
216
+ - `People.Read` — people search
217
+ 3. Optionally add **org-only** permissions (work/school accounts only):
218
+ - `Mail.Read.Shared` — shared mailbox access
219
+ - `Place.Read.All` — meeting room search (requires admin consent)
220
+ 4. Click **Add permissions**
221
+
222
+ ### Create a Client Secret
223
+
224
+ 1. Go to **Certificates & secrets** > **New client secret**
225
+ 2. Enter a description and select expiration
226
+ 3. Click **Add**
227
+ 4. **Copy the secret Value immediately** — you won't be able to see it again. Use the **Value**, not the Secret ID.
228
+
229
+ ## Configuration
230
+
231
+ ### Environment Variables
232
+
233
+ Create a `.env` file from the example:
234
+
235
+ ```bash
236
+ cp .env.example .env
237
+ ```
238
+
239
+ Edit with your Azure credentials:
240
+
241
+ ```bash
242
+ OUTLOOK_CLIENT_ID=your-application-client-id
243
+ OUTLOOK_CLIENT_SECRET=your-client-secret-VALUE
244
+ USE_TEST_MODE=false
245
+ ```
246
+
247
+ > **Note:** The server also accepts `MS_CLIENT_ID` and `MS_CLIENT_SECRET` for backwards compatibility.
248
+
249
+ ### MCP Client Configuration
250
+
251
+ Add to your MCP client config (example for Claude Desktop):
252
+
253
+ ```json
254
+ {
255
+ "mcpServers": {
256
+ "outlook": {
257
+ "command": "npx",
258
+ "args": ["@littlebearapps/outlook-assistant"],
259
+ "env": {
260
+ "OUTLOOK_CLIENT_ID": "your-application-client-id",
261
+ "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE"
262
+ }
263
+ }
264
+ }
265
+ }
266
+ ```
267
+
268
+ Or if installed from source:
269
+
270
+ ```json
271
+ {
272
+ "mcpServers": {
273
+ "outlook": {
274
+ "command": "node",
275
+ "args": ["/path/to/outlook-assistant/index.js"],
276
+ "env": {
277
+ "OUTLOOK_CLIENT_ID": "your-application-client-id",
278
+ "OUTLOOK_CLIENT_SECRET": "your-client-secret-VALUE"
279
+ }
280
+ }
281
+ }
282
+ }
283
+ ```
284
+
285
+ ## Authentication Flow
286
+
287
+ ### Step 1: Start the Auth Server
288
+
289
+ ```bash
290
+ npm run auth-server
291
+ ```
292
+
293
+ This starts a local server on port 3333 to handle the OAuth callback.
294
+
295
+ > **Note**: The auth server reads `OUTLOOK_CLIENT_ID` and `OUTLOOK_CLIENT_SECRET` from environment variables (or `MS_CLIENT_ID`/`MS_CLIENT_SECRET`). When running the auth server separately, ensure your `.env` file is in the project root or export the variables in your shell. Your MCP client's `"env"` config only applies to the MCP server process, not a separately-started auth server.
296
+
297
+ ### Step 2: Authenticate
298
+
299
+ 1. In your AI assistant, use the `auth` tool with `action=authenticate`
300
+ 2. Open the provided URL in your browser
301
+ 3. Sign in with your Microsoft account and grant permissions
302
+ 4. Tokens are saved to `~/.outlook-assistant-tokens.json` and refresh automatically
303
+
304
+ ## Directory Structure
305
+
306
+ ```
307
+ outlook-assistant/
308
+ ├── index.js # Main entry point (20 tools)
309
+ ├── config.js # Configuration settings
310
+ ├── outlook-auth-server.js # OAuth server (port 3333)
311
+ ├── auth/ # Authentication module (1 tool)
312
+ ├── email/ # Email module (6 tools)
313
+ │ ├── headers.js # Email header retrieval
314
+ │ ├── mime.js # Raw MIME/EML content
315
+ │ ├── conversations.js # Thread listing/export
316
+ │ ├── attachments.js # Attachment operations
317
+ │ └── ...
318
+ ├── calendar/ # Calendar module (3 tools)
319
+ ├── contacts/ # Contacts module (2 tools)
320
+ ├── categories/ # Categories module (3 tools)
321
+ ├── settings/ # Settings module (1 tool)
322
+ ├── folder/ # Folder module (1 tool)
323
+ ├── rules/ # Rules module (1 tool)
324
+ ├── advanced/ # Advanced module (2 tools)
325
+ └── utils/
326
+ ├── graph-api.js # Microsoft Graph API client
327
+ ├── safety.js # Rate limiting, recipient allowlist, dry-run
328
+ ├── odata-helpers.js # OData query building
329
+ ├── field-presets.js # Token-efficient field selections
330
+ ├── response-formatter.js # Verbosity levels
331
+ └── mock-data.js # Test mode data
332
+ ```
333
+
334
+ ## Troubleshooting
335
+
336
+ ### "Cannot find module '@modelcontextprotocol/sdk/server/index.js'"
337
+
338
+ ```bash
339
+ npm install
340
+ ```
341
+
342
+ ### "EADDRINUSE: address already in use :::3333"
343
+
344
+ ```bash
345
+ npx kill-port 3333
346
+ npm run auth-server
347
+ ```
348
+
349
+ ### "Invalid client secret" (AADSTS7000215)
350
+
351
+ You're using the Secret **ID** instead of the Secret **Value**. Go to Azure Portal > Certificates & secrets and copy the **Value** column.
352
+
353
+ ### Authentication URL doesn't work
354
+
355
+ Start the auth server first: `npm run auth-server`
356
+
357
+ ### Empty API responses
358
+
359
+ Check authentication status with the `auth` tool (action=status). Tokens may have expired — re-authenticate if needed.
360
+
361
+ ## Development
362
+
363
+ ### Running Tests
364
+
365
+ ```bash
366
+ npm test # Jest unit tests
367
+ npm run inspect # MCP Inspector (interactive)
368
+ ```
369
+
370
+ ### Test Mode
371
+
372
+ Run with mock data (no real API calls):
373
+
374
+ ```bash
375
+ USE_TEST_MODE=true npm start
376
+ ```
377
+
378
+ ### Extending the Server
379
+
380
+ 1. Create a new module directory (e.g. `tasks/`)
381
+ 2. Implement tool handlers in separate files
382
+ 3. Export tool definitions from the module's `index.js`
383
+ 4. Import and add tools to the `TOOLS` array in main `index.js`
384
+ 5. Add tests in `test/`
385
+ 6. Update `docs/quickrefs/tools-reference.md`
386
+
387
+ ## Documentation
388
+
389
+ | Guide | Description |
390
+ |-------|-------------|
391
+ | [Getting Started](docs/how-to/getting-started/connect-outlook-to-claude.md) | Install, configure, and authenticate — start here |
392
+ | [Azure Setup Guide](docs/guides/azure-setup.md) | Azure account creation, app registration, permissions, and secrets |
393
+ | [How-To Guides](docs/how-to/index.md) | 27 practical guides for email, calendar, contacts, and settings |
394
+ | [Troubleshooting & FAQ](docs/how-to/getting-started/verify-your-connection.md#common-connection-problems) | Common problems, re-authentication, and frequently asked questions |
395
+ | [Tools Reference](docs/quickrefs/tools-reference.md) | All 20 tools with parameters |
396
+ | [AI Agent Guide](docs/how-to/ai-agents/using-outlook-assistant-in-agents.md) | Tool selection and workflow patterns for AI agents |
397
+
398
+ Full documentation: [docs/](docs/README.md)
399
+
400
+ ## Known Limitations
401
+
402
+ - **Personal account search**: Free-text `query` and `kqlQuery` rely on Microsoft's `$search` API, which has limited support on personal Outlook.com accounts. Outlook Assistant mitigates this with progressive search fallback (trying OData filters automatically), but for the most direct results, use structured filters (`from`, `subject`, `to`, `receivedAfter`).
403
+ - **Focused Inbox**: Only available on work/school Microsoft 365 accounts.
404
+ - **Shared mailboxes**: Require `Mail.Read.Shared` permission and a work/school account.
405
+ - **Meeting room search**: Requires `Place.Read.All` permission with admin consent (work/school accounts only).
406
+ - **Export default path**: Exports save to the system temp directory by default. Use `savePath` or `outputDir` to specify a different location.
407
+
408
+ ## Contributing
409
+
410
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
411
+
412
+ ## Security
413
+
414
+ For security concerns, please see our [Security Policy](SECURITY.md). Do not open public issues for vulnerabilities.
415
+
416
+ ## Changelog
417
+
418
+ See [CHANGELOG.md](CHANGELOG.md) for version history.
419
+
420
+ ## About
421
+
422
+ Built and maintained by [Little Bear Apps](https://littlebearapps.com). Outlook Assistant is open source under the [MIT License](LICENSE).