@softeria/ms-365-mcp-server 0.193.1 → 0.193.3

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/README.md CHANGED
@@ -789,35 +789,36 @@ same tool results as before, except with `excludeResponse` (see below).
789
789
 
790
790
  - **File browser**, for `list-folder-files`: open folders, go back through the folder
791
791
  path, load more items and open files in the browser.
792
- - **Mail draft**, for `create-draft-email`, the reply, reply-all and forward drafts, and
793
- their shared mailbox versions: the draft's subject, its recipients with every address
794
- written out, and its body as the plain text Graph gives for it, which in practice writes
795
- out link and image addresses. It has a Send button and a link to edit it in Outlook.
796
- Ask for a draft to review a mail before it goes out; `send-mail` still sends straight away.
797
-
798
- The views get their data through the host, which calls this server's tools again, so they
799
- need no network access of their own. A click on Send is the user's confirmation, so the
800
- view sends with `confirm: true`. The mail draft reads the draft itself when it opens, so it
801
- shows the draft as Graph has it rather than what the model's call returned. Before it sends,
802
- it reads the draft again: if the draft changed since it was shown, the view shows the new
803
- version and waits for another click. With `MS365_MCP_BODY_FORMAT=html` the view shows only
804
- Graph's 255-character preview of the body, and has no Send button.
792
+ - **Mail draft**, for `create-draft-email`, reply, reply-all and forward drafts and their
793
+ shared mailbox versions: review the saved subject, recipient addresses, plain-text body,
794
+ and attachment inventory (including inline attachments). The view shows names and
795
+ available metadata, not attachment contents.
796
+
797
+ The views call existing tools through the host and need no network access of their own.
798
+ The mail view reads the saved draft and lists its attachments in the selected mailbox and
799
+ account. It follows continuation pages when pagination is enabled. A missing field, body
800
+ excerpt (including with `MS365_MCP_BODY_FORMAT=html`), or incomplete attachment inventory
801
+ is not treated as empty. Complete review and in-app Send need the matching draft-read,
802
+ attachment-list, and draft-send tools to be available.
803
+
804
+ The Send click supplies `confirm: true` only after re-reading the saved draft and its
805
+ attachment inventory. If either changed, the view shows the new review and waits for
806
+ another click. This is a freshness check, not an atomic conditional send. Direct mail tools
807
+ and their confirmation requirements are unchanged.
808
+
809
+ If the app cannot review the saved draft, use **Open in Outlook** when supported, or open
810
+ Drafts in the mailbox named by the view. A shared mailbox link requires Outlook access to
811
+ that mailbox. Manual Drafts instructions remain available while a read is pending.
805
812
 
806
813
  When the model passes `excludeResponse`, the tool's text answer is only `{"success":true}`,
807
814
  and the draft goes along as `structuredContent` for the view. The MCP Apps spec keeps
808
815
  `structuredContent` out of the model's context, but ChatGPT, and clients without MCP Apps
809
816
  that read it, give it to the model as well.
810
817
 
811
- A view only offers what this server registers. The Send button needs both
812
- `get-mail-message` and `send-draft-message` (for a shared mailbox,
813
- `get-shared-mailbox-message` and `send-shared-mailbox-draft`); when `--enabled-tools` or the
814
- allowed scopes leave one out, the mail draft has no Send button, and without the read tool
815
- it shows only the start of the body.
816
-
817
818
  - It has no effect with `--toon`, since the views read JSON results.
818
- - With `--discovery`, only tools published directly with `--eager-tools` show a view, and
819
- the Send button needs its tools published too, e.g.
820
- `--discovery --eager-tools create-draft-email,get-mail-message,send-draft-message`.
819
+ - With `--discovery`, only tools published directly with `--eager-tools` show a view. To
820
+ review and send a saved draft, also publish its read, attachment list and Send tools, e.g.
821
+ `--discovery --eager-tools create-draft-email,get-mail-message,list-mail-attachments,send-draft-message`.
821
822
 
822
823
  ## CLI Options
823
824
 
@@ -889,7 +890,7 @@ When running as an MCP server, the following options can be used:
889
890
  base64 JSON in a text block (see MS365_MCP_BLOB_OUTPUT below)
890
891
  --discovery Dynamic tool discovery: loads tools on demand to reduce initial token usage (see "Dynamic Tool Discovery" above)
891
892
  --enable-mcp-apps (experimental) Show the interactive MCP Apps views, a OneDrive/SharePoint file browser
892
- and a mail draft view with a Send button, in hosts that support them (see "MCP Apps" above)
893
+ and a mail draft review, in hosts that support them (see "MCP Apps" above)
893
894
  --public-url <url> Public base URL for OAuth when behind a reverse proxy (see Open WebUI section and docs/deployment.md)
894
895
  ```
895
896
 
@@ -2679,7 +2679,7 @@ describe("graph-tools", () => {
2679
2679
  async (_url, init) => {
2680
2680
  ranges.push(init.headers["Content-Range"]);
2681
2681
  uploaded += init.body.byteLength;
2682
- return new Response(null, { status: 202 });
2682
+ return new Response(null, { status: uploaded === size ? 201 : 200 });
2683
2683
  }
2684
2684
  )
2685
2685
  );
@@ -61,18 +61,16 @@
61
61
  border: 1px solid var(--color-border-tertiary, rgba(127, 127, 127, 0.25));
62
62
  border-radius: var(--border-radius-sm, 4px);
63
63
  }
64
+ #attachments,
65
+ #manual {
66
+ margin-top: 8px;
67
+ overflow-wrap: anywhere;
68
+ }
64
69
  .actions {
65
70
  display: flex;
66
71
  gap: 8px;
67
72
  margin-top: 8px;
68
73
  }
69
- .primary {
70
- border: 1px solid transparent;
71
- background: var(--color-text-primary, CanvasText);
72
- color: var(--color-background-primary, Canvas);
73
- padding: 4px 16px;
74
- font-weight: var(--font-weight-semibold, 600);
75
- }
76
74
  .tool {
77
75
  border: 1px solid var(--color-border-secondary, rgba(127, 127, 127, 0.4));
78
76
  background: none;
@@ -88,11 +86,15 @@
88
86
  </style>
89
87
  </head>
90
88
  <body>
91
- <h1 id="subject">Mail draft</h1>
89
+ <h1>Mail draft</h1>
90
+ <p id="subject" hidden></p>
92
91
  <div id="fields" class="fields"></div>
92
+ <p id="body-label" hidden></p>
93
93
  <div id="body" hidden></div>
94
+ <div id="attachments" hidden></div>
95
+ <p id="manual" hidden></p>
94
96
  <div class="actions">
95
- <button id="send" class="primary" type="button" hidden>Send</button>
97
+ <button id="send" class="tool" type="button" hidden disabled>Send</button>
96
98
  <button id="open" class="tool" type="button" hidden>Open in Outlook</button>
97
99
  </div>
98
100
  <p id="status" role="status">Loading...</p>
@@ -100,10 +102,10 @@
100
102
  __MCP_APP_CONFIG__
101
103
  </script>
102
104
  <script>
103
- __MCP_APP_BRIDGE__
105
+ __MCP_APP_BRIDGE__;
104
106
  </script>
105
107
  <script>
106
- __MCP_APP_SCRIPT__
108
+ __MCP_APP_SCRIPT__;
107
109
  </script>
108
110
  </body>
109
111
  </html>