@bitefoundry/outlook 0.2.0 → 0.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.
package/docs/MCP.md CHANGED
@@ -1,147 +1,147 @@
1
- # `outlook` MCP Server
2
-
3
- `outlook mcp` (alias `mcp-server`) runs a [Model Context Protocol](https://modelcontextprotocol.io/) server over **stdio** using newline-delimited JSON-RPC 2.0. It exposes pure **Microsoft Outlook** capabilities (**Mail**, **Calendar**, **Microsoft To Do**, and **Contacts & Entra Directory**) to MCP-capable agents such as Claude Desktop, Claude Code, and OpenAI Codex.
4
-
5
- ## Requirements
6
-
7
- 1. Install or build the `outlook` binary:
8
- ```bash
9
- npm install -g @bitefoundry/outlook
10
- # or from source:
11
- cargo build --release
12
- ```
13
- 2. Authenticate once (the MCP server never prompts interactively on stdin):
14
- ```bash
15
- outlook login
16
- ```
17
- Or configure `OUTLOOK_ACCESS_TOKEN` / `OUTLOOK_TOKEN_FILE` (+ optional `OUTLOOK_TOKEN_REFRESH_CMD`), or rely on the automatic M365 shared-session bootstrap from `teams-cli` / `TEAMS_TOKEN_FILE` (`OUTLOOK_SHARE_M365_AUTH=true`).
18
- 3. Ensure `outlook` (e.g. `target/release/outlook.exe` on Windows or on `PATH`) is accessible to your MCP host.
19
-
20
- ## Starting manually
21
-
22
- ```bash
23
- outlook mcp # stdio: one JSON-RPC 2.0 object per line
24
- outlook mcp-server # alias
25
- ```
26
-
27
- `stdout` is strictly reserved for single-line JSON-RPC 2.0 responses; diagnostics and startup warnings are written to `stderr` only.
28
-
29
- ## Client configuration
30
-
31
- ### Claude Desktop
32
-
33
- `claude_desktop_config.json`:
34
-
35
- ```json
36
- {
37
- "mcpServers": {
38
- "outlook": {
39
- "command": "outlook",
40
- "args": ["mcp"]
41
- }
42
- }
43
- }
44
- ```
45
-
46
- On Windows with an explicit executable path:
47
-
48
- ```json
49
- {
50
- "mcpServers": {
51
- "outlook": {
52
- "command": "C:\\Users\\me\\source\\outlook\\target\\release\\outlook.exe",
53
- "args": ["mcp"]
54
- }
55
- }
56
- }
57
- ```
58
-
59
- ### Claude Code
60
-
61
- ```bash
62
- claude mcp add outlook -- outlook mcp
63
- # or with an explicit binary path:
64
- claude mcp add outlook -- C:\Users\me\source\outlook\target\release\outlook.exe mcp
65
- ```
66
-
67
- ### OpenAI Codex
68
-
69
- `~/.codex/config.toml`:
70
-
71
- ```toml
72
- [mcp_servers.outlook]
73
- command = "outlook"
74
- args = ["mcp"]
75
- ```
76
-
77
- ## Protocol
78
-
79
- - **Transport**: JSON-RPC 2.0 over stdio, **newline-delimited JSON** (one JSON object per line, no `Content-Length` headers; maximum `8 MiB` per request line).
80
- - **Supported `protocolVersion`s**: `2024-11-05`, `2025-03-26`, `2025-06-18` (unknown versions fall back to `2025-06-18`).
81
- - **`serverInfo`**: The server name is `outlook` and the version matches `CARGO_PKG_VERSION`.
82
- - **Startup**: `initialize` responds immediately; on an empty cache, initial mail folder bootstrap runs asynchronously in the background.
83
- - **Notifications**: requests without `id` or methods starting with `notifications/` (such as `notifications/initialized`) emit no response.
84
- - **`ping`**: returns `{}`.
85
- - **Error codes**: `-32700` parse error, `-32600` invalid JSON-RPC envelope (or oversized line > `8 MiB`), `-32601` method not found.
86
- - **`tools/call`**: returns `{ "content": [{ "type": "text", "text": "<pretty JSON>" }], "isError": false }` on success, or `"isError": true` with an error message (including JWT `scp`/`roles` permission diagnostics on `403`) on validation/Graph failures.
87
-
88
- ## Microsoft Outlook Tools (23)
89
-
90
- Mail `folder` arguments accept a canonical folder ID, display name/prefix, or well-known alias (`inbox`, `sent`, `drafts`, `archive`, `trash`, `junk`). To Do `list` arguments accept a list ID, display name, or `'tasks'` / `'defaultList'`.
91
-
92
- | # | Tool | Domain | Arguments | Returns |
93
- | --- | --- | --- | --- | --- |
94
- | 1 | `whoami` | Auth | *(none)* | `{ "authenticated": bool, "user_id": ..., "email": ..., "auth_mode": ..., "auth_source": ..., "scopes": [...] }` |
95
- | 2 | `list_mail_folders` | Mail | `limit?` (1..200, default 50), `cursor?`, `refresh?` (bool), `offline?` (bool) | `{ "folders": [...], "returned": n, "has_more": bool, "next_cursor": string\|null }` |
96
- | 3 | `list_messages` | Mail | `folder?` (default `'inbox'`), `limit?` (1..200), `cursor?`, `unread?`, `flagged?`, `focused?`, `offline?`, `compact?` (default `true`) | `{ "folder": {...}, "messages": [...], "returned": n, "has_more": bool\|null, "next_cursor": string\|null }` |
97
- | 4 | `get_message` | Mail | `message_id` (req), `mark_read?`, `offline?`, `compact?` (default `true`) | `{ "message": {...} }` (compact includes `omitted`, `hint`) |
98
- | 5 | `send_mail` | Mail | `to` (`string[]`, req), `subject` (req), `body` (Markdown, req), `cc?`, `bcc?`, `importance?` (`low\|normal\|high`), `attachments?`, `save_to_sent_items?` | `{ "ok": true, "to": [...], "subject": "..." }` |
99
- | 6 | `reply_mail` | Mail | `message_id` (req), `body` (req), `reply_all?` | `{ "ok": true, "message_id": "...", "reply_all": bool }` |
100
- | 7 | `forward_mail` | Mail | `message_id` (req), `to` (`string[]`, req), `comment?` | `{ "ok": true, "message_id": "...", "to": [...] }` |
101
- | 8 | `update_message` | Mail | `message_id` (req), `is_read?`, `flagged?`, `destination_folder?` | `{ "ok": true, "message_id": "...", "is_read": ..., "flagged": ..., "moved": ... }` |
102
- | 9 | `delete_message` | Mail | `message_id` (req), `confirm` (must be literal `true`) | `{ "ok": true, "message_id": "..." }` |
103
- | 10 | `download_attachment` | Mail | `message_id` (req), `attachment_index?` (>=0), `attachment?` (ID/name/index), `output_dir?`, `offline?` | `{ "ok": true, "message_id": "...", "attachment_id": "...", "path": "...", "file_name": "...", "mime_type": "...", "size_bytes": n, "is_image": bool }` |
104
- | 11 | `search_mail` | Mail | `query` (req), `folder?`, `limit?` (1..200), `cursor?`, `offline?` | `{ "query": "...", "hits": [...] }` (offline) or `{ "query": "...", "messages": [...], "returned": n, "has_more": bool, "next_cursor": string\|null }` (online, no 100-item cap) |
105
- | 12 | `list_events` | Calendar | `from?` (`ISO-8601\|YYYY-MM-DD`), `to?`, `days?` (1..365), `limit?` (1..200), `offline?` | `{ "start": "...", "end": "...", "events": [...], "returned": n, "has_more": bool }` |
106
- | 13 | `create_event` | Calendar | `subject` (req), `start` (req), `end` (req), `time_zone?`, `is_all_day?`, `location?`, `body?`, `attendees?`, `is_online_meeting?` | `{ "ok": true, "event": {...} }` |
107
- | 14 | `respond_event` | Calendar | `event_id` (req), `response` (`accept\|tentative\|decline`, req), `comment?` | `{ "ok": true, "event_id": "...", "response": "..." }` |
108
- | 15 | `delete_event` | Calendar | `event_id` (req), `confirm` (must be literal `true`) | `{ "ok": true, "event_id": "..." }` |
109
- | 16 | `list_todo_lists` | To Do | `limit?` (1..200, default 50), `cursor?`, `refresh?`, `offline?` | `{ "lists": [...], "returned": n, "has_more": bool, "next_cursor": string\|null }` |
110
- | 17 | `list_tasks` | To Do | `list?`, `include_completed?`, `limit?` (1..200), `offline?` | `{ "list": {...}, "list_id": "...", "tasks": [...], "returned": n, "has_more": bool }` |
111
- | 18 | `create_task` | To Do | `title` (req), `list?`, `notes?`, `due?` (`YYYY-MM-DD\|ISO-8601`), `importance?` (`low\|normal\|high`) | `{ "ok": true, "task": {...} }` |
112
- | 19 | `complete_task` | To Do | `task_id` (req), `list?`, `completed?` (default `true`) | `{ "ok": true, "task": {...} }` |
113
- | 20 | `search_contacts` | Contacts | `query?`, `limit?` (1..200), `offline?` | `{ "contacts": [...], "directory": { "status": "ok\|forbidden\|error\|not_queried", "error": string\|null } }` |
114
- | 21 | `update_draft` | Mail | `message_id` (req), `subject?`, `body?` (Markdown), `body_html?` (HTML) | `{ "ok": true, "message_id": "..." }` |
115
- | 22 | `update_event` | Calendar | `event_id` (req), `subject?`, `start?`, `end?` | `{ "ok": true, "event": {...} }` |
116
- | 23 | `update_task` | To Do | `task_id` (req), `list?` (default `'tasks'`), `title?`, `due?` | `{ "ok": true, "task": {...} }` |
117
-
118
- ### Destructive tool guard (`confirm: true`)
119
-
120
- `delete_message` and `delete_event` require `"confirm": true` as a literal JSON boolean. Omitting `confirm`, passing `false`, `"true"`, or `1` is rejected during argument validation before any Graph API call is made.
121
-
122
- ### Example JSON-RPC session
123
-
124
- ```json
125
- {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"agent","version":"1.0"}}}
126
- {"jsonrpc":"2.0","method":"notifications/initialized"}
127
- {"jsonrpc":"2.0","id":2,"method":"tools/list"}
128
- {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_messages","arguments":{"folder":"inbox","unread":true,"limit":20}}}
129
- {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"send_mail","arguments":{"to":["alice@contoso.com"],"subject":"Release v0.1.0","body":"Build **passed**!"}}}
130
- {"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"create_event","arguments":{"subject":"Design Sync","start":"2026-11-20T09:00:00Z","end":"2026-11-20T10:00:00Z","is_online_meeting":true}}}
131
- {"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"delete_message","arguments":{"message_id":"AAMkAGI2...","confirm":true}}}
132
- ```
133
-
134
- ## Notes and limitations
135
-
136
- - `send_mail` `attachments` paths and `download_attachment` `output_dir` paths are resolved on the host running `outlook mcp`, not on a remote MCP client.
137
- - Pass `"offline": true` on read/search tools (`list_mail_folders`, `list_messages`, `get_message`, `search_mail`, `list_events`, `list_todo_lists`, `list_tasks`, `search_contacts`) to query the local SQLite cache (`cache.db`) without network calls.
138
- - `list_messages` and `get_message` default to `"compact": true`. Pass `"compact": false` to return full cached fields, HTML bodies, and attachment metadata (`content_bytes_b64` is never included; use `download_attachment` to retrieve attachment bytes). Compact `get_message` responses include `omitted` (`attachments` is the known count, `0` when the message has no attachments, or `null` when attachment metadata has not been fetched yet; `fields` lists omitted scalar fields) and a follow-up `hint`.
139
- - `next_cursor` is an opaque pagination token valid only for the same tool, `folder`, `query`, and filter combination (`limit` and `compact` may change between pages). Reusing a cursor with a different tool, folder, query, or filter fails before any network call with `invalid cursor: issued for a different command, folder, query or filter`.
140
- - `update_message` accepts read and flag changes or a destination folder. An unsupported argument such as `subject` fails validation before any write. Use `update_draft` for a draft's subject or body.
141
-
142
- ## Partial edits
143
-
144
- - **Drafts.** `update_draft` checks the message's current draft status in Graph. A subject-only edit preserves the stored HTML and attachments. To replace the body, send either `body` for rendered Markdown or `body_html` for the supplied HTML. The HTML value can include existing CID references that you want to keep. [Microsoft Graph message update](https://learn.microsoft.com/en-us/graph/api/message-update?view=graph-rest-1.0)
145
- - **Calendar.** `update_event` sends only the supplied subject, start, and end. It leaves the body, attendees, meeting link, and recurrence out of the PATCH. A wall-clock value such as `2026-11-23T09:00` uses the original zone for that endpoint. An RFC3339 timestamp represents an instant and is converted to UTC. For a recurring event in a non-UTC zone, use wall-clock values to keep the series in its original zone. For all-day events, use `YYYY-MM-DD` in the original zone and provide an exclusive end date. Graph may send meeting updates and can reject occurrences moved across their neighbors. [Microsoft Graph event update](https://learn.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0) · [Event time zones](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0)
146
- - **To Do.** `update_task` sends only the supplied title and due date. The checklist, body, recurrence, and completion state stay outside the PATCH. A due date of `2026-11-25` means midnight UTC on that date. A due timestamp must be RFC3339 and is converted to UTC. [Microsoft Graph To Do update](https://learn.microsoft.com/en-us/graph/api/todotask-update?view=graph-rest-1.0)
147
- - `search_mail` with `"offline": false` (default) queries Microsoft Graph KQL `$search` and caches matched messages into SQLite.
1
+ # `outlook` MCP Server
2
+
3
+ `outlook mcp` (alias `mcp-server`) runs a [Model Context Protocol](https://modelcontextprotocol.io/) server over **stdio** using newline-delimited JSON-RPC 2.0. It exposes pure **Microsoft Outlook** capabilities (**Mail**, **Calendar**, **Microsoft To Do**, and **Contacts & Entra Directory**) to MCP-capable agents such as Claude Desktop, Claude Code, and OpenAI Codex.
4
+
5
+ ## Requirements
6
+
7
+ 1. Install or build the `outlook` binary:
8
+ ```bash
9
+ npm install -g @bitefoundry/outlook
10
+ # or from source:
11
+ cargo build --release
12
+ ```
13
+ 2. Authenticate once (the MCP server never prompts interactively on stdin):
14
+ ```bash
15
+ outlook login
16
+ ```
17
+ Or configure `OUTLOOK_ACCESS_TOKEN` / `OUTLOOK_TOKEN_FILE` (+ optional `OUTLOOK_TOKEN_REFRESH_CMD`), or rely on the automatic M365 shared-session bootstrap from `teams-cli` / `TEAMS_TOKEN_FILE` (`OUTLOOK_SHARE_M365_AUTH=true`).
18
+ 3. Ensure `outlook` (e.g. `target/release/outlook.exe` on Windows or on `PATH`) is accessible to your MCP host.
19
+
20
+ ## Starting manually
21
+
22
+ ```bash
23
+ outlook mcp # stdio: one JSON-RPC 2.0 object per line
24
+ outlook mcp-server # alias
25
+ ```
26
+
27
+ `stdout` is strictly reserved for single-line JSON-RPC 2.0 responses; diagnostics and startup warnings are written to `stderr` only.
28
+
29
+ ## Client configuration
30
+
31
+ ### Claude Desktop
32
+
33
+ `claude_desktop_config.json`:
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "outlook": {
39
+ "command": "outlook",
40
+ "args": ["mcp"]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ On Windows with an explicit executable path:
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "outlook": {
52
+ "command": "C:\\Users\\me\\source\\outlook\\target\\release\\outlook.exe",
53
+ "args": ["mcp"]
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ ### Claude Code
60
+
61
+ ```bash
62
+ claude mcp add outlook -- outlook mcp
63
+ # or with an explicit binary path:
64
+ claude mcp add outlook -- C:\Users\me\source\outlook\target\release\outlook.exe mcp
65
+ ```
66
+
67
+ ### OpenAI Codex
68
+
69
+ `~/.codex/config.toml`:
70
+
71
+ ```toml
72
+ [mcp_servers.outlook]
73
+ command = "outlook"
74
+ args = ["mcp"]
75
+ ```
76
+
77
+ ## Protocol
78
+
79
+ - **Transport**: JSON-RPC 2.0 over stdio, **newline-delimited JSON** (one JSON object per line, no `Content-Length` headers; maximum `8 MiB` per request line).
80
+ - **Supported `protocolVersion`s**: `2024-11-05`, `2025-03-26`, `2025-06-18` (unknown versions fall back to `2025-06-18`).
81
+ - **`serverInfo`**: The server name is `outlook` and the version matches `CARGO_PKG_VERSION`.
82
+ - **Startup**: `initialize` responds immediately; on an empty cache, initial mail folder bootstrap runs asynchronously in the background.
83
+ - **Notifications**: requests without `id` or methods starting with `notifications/` (such as `notifications/initialized`) emit no response.
84
+ - **`ping`**: returns `{}`.
85
+ - **Error codes**: `-32700` parse error, `-32600` invalid JSON-RPC envelope (or oversized line > `8 MiB`), `-32601` method not found.
86
+ - **`tools/call`**: returns `{ "content": [{ "type": "text", "text": "<pretty JSON>" }], "isError": false }` on success, or `"isError": true` with an error message (including JWT `scp`/`roles` permission diagnostics on `403`) on validation/Graph failures.
87
+
88
+ ## Microsoft Outlook Tools (23)
89
+
90
+ Mail `folder` arguments accept a canonical folder ID, display name/prefix, or well-known alias (`inbox`, `sent`, `drafts`, `archive`, `trash`, `junk`). To Do `list` arguments accept a list ID, display name, or `'tasks'` / `'defaultList'`.
91
+
92
+ | # | Tool | Domain | Arguments | Returns |
93
+ | --- | --- | --- | --- | --- |
94
+ | 1 | `whoami` | Auth | *(none)* | `{ "authenticated": bool, "user_id": ..., "email": ..., "auth_mode": ..., "auth_source": ..., "scopes": [...] }` |
95
+ | 2 | `list_mail_folders` | Mail | `limit?` (1..200, default 50), `cursor?`, `refresh?` (bool), `offline?` (bool) | `{ "folders": [...], "returned": n, "has_more": bool, "next_cursor": string\|null }` |
96
+ | 3 | `list_messages` | Mail | `folder?` (default `'inbox'`), `limit?` (1..200), `cursor?`, `unread?`, `flagged?`, `focused?`, `offline?`, `compact?` (default `true`) | `{ "folder": {...}, "messages": [...], "returned": n, "has_more": bool\|null, "next_cursor": string\|null }` |
97
+ | 4 | `get_message` | Mail | `message_id` (exact ID, req), `mark_read?`, `offline?`, `compact?` (default `true`) | `{ "message": {...} }` (compact includes `omitted`, `hint`) |
98
+ | 5 | `send_mail` | Mail | `to` (`string[]`, req), `subject` (req), `body` (Markdown, req), `cc?`, `bcc?`, `importance?` (`low\|normal\|high`), `attachments?`, `save_to_sent_items?` | `{ "ok": true, "to": [...], "subject": "..." }` |
99
+ | 6 | `reply_mail` | Mail | `message_id` (req), `body` (req), `reply_all?` | `{ "ok": true, "message_id": "...", "reply_all": bool }` |
100
+ | 7 | `forward_mail` | Mail | `message_id` (req), `to` (`string[]`, req), `comment?` | `{ "ok": true, "message_id": "...", "to": [...] }` |
101
+ | 8 | `update_message` | Mail | `message_id` (req), `is_read?`, `flagged?`, `destination_folder?`, `compact?` (default `true`) | `{ "ok": true, "message_id": "...", "is_read": ..., "flagged": ..., "moved": { "id": "...", "folder_id": "..." }\|null }` (`compact: false` returns full public message) |
102
+ | 9 | `delete_message` | Mail | `message_id` (req), `confirm` (must be literal `true`) | `{ "ok": true, "message_id": "..." }` |
103
+ | 10 | `download_attachment` | Mail | `message_id` (req), `attachment_index?` (>=0), `attachment?` (ID/name/index), `output_dir?`, `offline?` | `{ "ok": true, "message_id": "...", "attachment_id": "...", "path": "...", "file_name": "...", "mime_type": "...", "size_bytes": n, "is_image": bool }` |
104
+ | 11 | `search_mail` | Mail | `query` (req), `folder?`, `limit?` (1..200), `cursor?`, `compact?` (default `true`), `offline?` | `{ "query": "...", "hits": [...] }` (offline) or `{ "query": "...", "messages": [...], "returned": n, "has_more": bool, "next_cursor": string\|null }` (online, compact by default, no 100-item cap) |
105
+ | 12 | `list_events` | Calendar | `from?` (`ISO-8601\|YYYY-MM-DD`), `to?`, `days?` (1..365), `limit?` (1..200), `compact?` (default `true`), `offline?` | `{ "start": "...", "end": "...", "events": [...], "returned": n, "has_more": bool }` (compact omits `body_html`) |
106
+ | 13 | `create_event` | Calendar | `subject` (req), `start` (req), `end` (req), `time_zone?`, `is_all_day?`, `location?`, `body?`, `attendees?`, `is_online_meeting?` | `{ "ok": true, "event": {...} }` |
107
+ | 14 | `respond_event` | Calendar | `event_id` (req), `response` (`accept\|tentative\|decline`, req), `comment?` | `{ "ok": true, "event_id": "...", "response": "..." }` |
108
+ | 15 | `delete_event` | Calendar | `event_id` (req), `confirm` (must be literal `true`) | `{ "ok": true, "event_id": "..." }` |
109
+ | 16 | `list_todo_lists` | To Do | `limit?` (1..200, default 50), `cursor?`, `refresh?`, `offline?` | `{ "lists": [...], "returned": n, "has_more": bool, "next_cursor": string\|null }` |
110
+ | 17 | `list_tasks` | To Do | `list?`, `include_completed?`, `limit?` (1..200), `offline?` | `{ "list": {...}, "list_id": "...", "tasks": [...], "returned": n, "has_more": bool }` |
111
+ | 18 | `create_task` | To Do | `title` (req), `list?`, `notes?`, `due?` (`YYYY-MM-DD\|ISO-8601`), `importance?` (`low\|normal\|high`) | `{ "ok": true, "task": {...} }` |
112
+ | 19 | `complete_task` | To Do | `task_id` (req), `list?`, `completed?` (default `true`) | `{ "ok": true, "task": {...} }` |
113
+ | 20 | `search_contacts` | Contacts | `query?`, `limit?` (1..200), `offline?` | `{ "contacts": [...], "directory": { "status": "ok\|forbidden\|error\|not_queried", "error": string\|null } }` |
114
+ | 21 | `update_draft` | Mail | `message_id` (req), `subject?`, `body?` (Markdown), `body_html?` (HTML) | `{ "ok": true, "message_id": "..." }` |
115
+ | 22 | `update_event` | Calendar | `event_id` (req), `subject?`, `start?`, `end?` | `{ "ok": true, "event": {...} }` |
116
+ | 23 | `update_task` | To Do | `task_id` (req), `list?` (default `'tasks'`), `title?`, `due?` | `{ "ok": true, "task": {...} }` |
117
+
118
+ ### Destructive tool guard (`confirm: true`)
119
+
120
+ `delete_message` and `delete_event` require `"confirm": true` as a literal JSON boolean. Omitting `confirm`, passing `false`, `"true"`, or `1` is rejected during argument validation before any Graph API call is made.
121
+
122
+ ### Example JSON-RPC session
123
+
124
+ ```json
125
+ {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"agent","version":"1.0"}}}
126
+ {"jsonrpc":"2.0","method":"notifications/initialized"}
127
+ {"jsonrpc":"2.0","id":2,"method":"tools/list"}
128
+ {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_messages","arguments":{"folder":"inbox","unread":true,"limit":20}}}
129
+ {"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"send_mail","arguments":{"to":["alice@contoso.com"],"subject":"Release v0.1.0","body":"Build **passed**!"}}}
130
+ {"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"create_event","arguments":{"subject":"Design Sync","start":"2026-11-20T09:00:00Z","end":"2026-11-20T10:00:00Z","is_online_meeting":true}}}
131
+ {"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"name":"delete_message","arguments":{"message_id":"AAMkAGI2...","confirm":true}}}
132
+ ```
133
+
134
+ ## Notes and limitations
135
+
136
+ - `send_mail` `attachments` paths and `download_attachment` `output_dir` paths are resolved on the host running `outlook mcp`, not on a remote MCP client.
137
+ - Pass `"offline": true` on read/search tools (`list_mail_folders`, `list_messages`, `get_message`, `search_mail`, `list_events`, `list_todo_lists`, `list_tasks`, `search_contacts`) to query the local SQLite cache (`cache.db`) without network calls.
138
+ - `list_messages`, `get_message`, `search_mail` (online), and `list_events` default to `"compact": true` and reject unknown arguments. Pass `"compact": false` to return full cached fields, HTML bodies, and attachment metadata (`content_bytes_b64` is never included; use `download_attachment` to retrieve attachment bytes). `get_message` requires an exact `message_id`; subject and ID-prefix resolution are available only in CLI `outlook read --offline` (online callers should find IDs with `search_mail` first). Compact `get_message` responses include `omitted` (`attachments` is the known count, `0` when the message has no attachments, or `null` when attachment metadata has not been fetched yet; `fields` lists omitted scalar fields) and a follow-up `hint`.
139
+ - `next_cursor` is an opaque pagination token valid only for the same tool, `folder`, `query`, and filter combination (`limit` and `compact` may change between pages). Reusing a cursor with a different tool, folder, query, or filter fails before any network call with `invalid cursor: issued for a different command, folder, query or filter`.
140
+ - `update_message` accepts read and flag changes or a destination folder. An unsupported argument such as `subject` fails validation before any write. Use `update_draft` for a draft's subject or body.
141
+
142
+ ## Partial edits
143
+
144
+ - **Drafts.** `update_draft` checks the message's current draft status in Graph. A subject-only edit preserves the stored HTML and attachments. To replace the body, send either `body` for rendered Markdown or `body_html` for the supplied HTML. The HTML value can include existing CID references that you want to keep. [Microsoft Graph message update](https://learn.microsoft.com/en-us/graph/api/message-update?view=graph-rest-1.0)
145
+ - **Calendar.** `update_event` sends only the supplied subject, start, and end. It leaves the body, attendees, meeting link, and recurrence out of the PATCH. A wall-clock value such as `2026-11-23T09:00` uses the original zone for that endpoint. An RFC3339 timestamp represents an instant and is converted to UTC. For a recurring event in a non-UTC zone, use wall-clock values to keep the series in its original zone. For all-day events, use `YYYY-MM-DD` in the original zone and provide an exclusive end date. Graph may send meeting updates and can reject occurrences moved across their neighbors. [Microsoft Graph event update](https://learn.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0) · [Event time zones](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0)
146
+ - **To Do.** `update_task` sends only the supplied title and due date. The checklist, body, recurrence, and completion state stay outside the PATCH. A due date of `2026-11-25` means midnight UTC on that date. A due timestamp must be RFC3339 and is converted to UTC. [Microsoft Graph To Do update](https://learn.microsoft.com/en-us/graph/api/todotask-update?view=graph-rest-1.0)
147
+ - `search_mail` with `"offline": false` (default) queries Microsoft Graph KQL `$search` and caches matched messages into SQLite.