@softeria/ms-365-mcp-server 0.190.3 → 0.190.4
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 +2 -0
- package/dist/__tests__/graph-tools.test.js +27 -1
- package/dist/graph-tools.js +7 -2
- package/dist/mcp-instructions.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -895,6 +895,8 @@ When running as an MCP server, the following options can be used:
|
|
|
895
895
|
|
|
896
896
|
The account tools (`login`, `logout`, `verify-login`, `list-accounts`, `select-account`, `remove-account`) follow the same filters: `--enabled-tools` applies to them, every `--preset` includes them, and `--read-only` or `MS365_MCP_OAUTH_TOKEN` keeps only `verify-login` and `list-accounts`.
|
|
897
897
|
|
|
898
|
+
`--read-only` keeps `download-bytes-to-file` (stdio, or HTTP with `--http-local-file-tools`), since it only reads from Microsoft 365. It tells clients that it writes files (`readOnlyHint: false`), so they can ask before running it.
|
|
899
|
+
|
|
898
900
|
Environment variables:
|
|
899
901
|
|
|
900
902
|
- `READ_ONLY=true|1`: Alternative to --read-only flag
|
|
@@ -3508,7 +3508,7 @@ describe("graph-tools", () => {
|
|
|
3508
3508
|
});
|
|
3509
3509
|
});
|
|
3510
3510
|
describe("utility tools in read-only mode", () => {
|
|
3511
|
-
it("
|
|
3511
|
+
it("keeps read-only utility tools and skips write ones", async () => {
|
|
3512
3512
|
mockEndpoints.length = 0;
|
|
3513
3513
|
mockEndpointsJson = [];
|
|
3514
3514
|
const server = createMockServer();
|
|
@@ -3516,6 +3516,32 @@ describe("graph-tools", () => {
|
|
|
3516
3516
|
registerGraphTools(server, {}, { readOnly: true });
|
|
3517
3517
|
expect(server.tools.has("download-bytes")).toBe(true);
|
|
3518
3518
|
expect(server.tools.has("parse-teams-url")).toBe(true);
|
|
3519
|
+
expect(server.tools.has("get-upload-url")).toBe(false);
|
|
3520
|
+
});
|
|
3521
|
+
it("keeps download-bytes-to-file, but tells clients it writes files", async () => {
|
|
3522
|
+
mockEndpoints.length = 0;
|
|
3523
|
+
mockEndpointsJson = [];
|
|
3524
|
+
const server = createMockServer();
|
|
3525
|
+
const { registerGraphTools } = await loadModule();
|
|
3526
|
+
registerGraphTools(server, {}, { readOnly: true });
|
|
3527
|
+
const call = server.tool.mock.calls.find((c) => c[0] === "download-bytes-to-file");
|
|
3528
|
+
expect(call?.[3]).toEqual({
|
|
3529
|
+
title: "download-bytes-to-file",
|
|
3530
|
+
readOnlyHint: false,
|
|
3531
|
+
destructiveHint: false,
|
|
3532
|
+
openWorldHint: true
|
|
3533
|
+
});
|
|
3534
|
+
});
|
|
3535
|
+
});
|
|
3536
|
+
describe("utility tool annotations", () => {
|
|
3537
|
+
it("sends destructiveHint only for download-bytes-to-file", async () => {
|
|
3538
|
+
mockEndpoints.length = 0;
|
|
3539
|
+
mockEndpointsJson = [];
|
|
3540
|
+
const server = createMockServer();
|
|
3541
|
+
const { registerGraphTools } = await loadModule();
|
|
3542
|
+
registerGraphTools(server, {}, {});
|
|
3543
|
+
const withHint = server.tool.mock.calls.filter((c) => "destructiveHint" in c[3]).map((c) => c[0]);
|
|
3544
|
+
expect(withHint).toEqual(["download-bytes-to-file"]);
|
|
3519
3545
|
});
|
|
3520
3546
|
});
|
|
3521
3547
|
describe("destructive operations require confirm: true", () => {
|
package/dist/graph-tools.js
CHANGED
|
@@ -635,7 +635,7 @@ async function executeUtilityTool(utility, ctx, params) {
|
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
function isUtilityToolAvailable(utility, options) {
|
|
638
|
-
if (options.readOnly && !utility.readOnlyHint) return false;
|
|
638
|
+
if (options.readOnly && !utility.readOnlyHint && !utility.allowedInReadOnly) return false;
|
|
639
639
|
if (options.httpMode && utility.stdioOnly) return false;
|
|
640
640
|
if (options.scopeMode === "app" && utility.meOnly) return false;
|
|
641
641
|
if (utility.enabled && !utility.enabled()) return false;
|
|
@@ -1513,7 +1513,11 @@ const UTILITY_TOOLS = [
|
|
|
1513
1513
|
// sits past the cap. That keeps the hint for the reading LLM while letting
|
|
1514
1514
|
// get-download-url own the high-signal "drive"/"sharepoint" search terms.
|
|
1515
1515
|
description: "Write authenticated Microsoft Graph byte content to a local file on the server, returning { path, contentType, bytesWritten } instead of base64. An out-of-band way to save mail attachments and meeting recordings. With --enable-attachment-urls in HTTP mode, prefer get-download-url to hand their bytes to an external downloader or converter. Also handles profile photos and Teams hosted content. Writes to an absolute outputPath and never overwrites an existing file. stdio mode, or HTTP with --http-local-file-tools. For OneDrive or SharePoint file content, get-download-url is preferred \u2014 it returns a pre-authenticated URL for fully out-of-band download without the server fetching the bytes.",
|
|
1516
|
-
|
|
1516
|
+
// Writes to the local disk, so clients must not see it as read-only. It only
|
|
1517
|
+
// creates new files, and it only reads from Microsoft 365, so --read-only keeps it.
|
|
1518
|
+
readOnlyHint: false,
|
|
1519
|
+
destructiveHint: false,
|
|
1520
|
+
allowedInReadOnly: true,
|
|
1517
1521
|
openWorldHint: true,
|
|
1518
1522
|
stdioOnly: true,
|
|
1519
1523
|
buildSchema: (ctx) => {
|
|
@@ -1935,6 +1939,7 @@ function registerUtilityToolWithMcp(server, utility, ctx) {
|
|
|
1935
1939
|
{
|
|
1936
1940
|
title: utility.name,
|
|
1937
1941
|
readOnlyHint: utility.readOnlyHint ?? true,
|
|
1942
|
+
...utility.destructiveHint !== void 0 ? { destructiveHint: utility.destructiveHint } : {},
|
|
1938
1943
|
openWorldHint: utility.openWorldHint ?? true
|
|
1939
1944
|
},
|
|
1940
1945
|
async (params) => executeUtilityTool(utility, ctx, params)
|
package/dist/mcp-instructions.js
CHANGED
|
@@ -14,7 +14,7 @@ function buildGeneralMcpInstructions(opts) {
|
|
|
14
14
|
parts.push(
|
|
15
15
|
"App mode: there is no signed-in user, so /me paths do not work. Name the user in /users/{user-id} paths with a UPN or object id."
|
|
16
16
|
);
|
|
17
|
-
if (opts.readOnly) parts.push("This server is read-only;
|
|
17
|
+
if (opts.readOnly) parts.push("This server is read-only; writes to Microsoft 365 are disabled.");
|
|
18
18
|
else
|
|
19
19
|
parts.push(
|
|
20
20
|
"Mail reply, reply-all and forward tools (including their drafts and shared mailboxes): Graph puts comment into an HTML body, so plain-text line breaks are usually lost; use <br> for line breaks or <p> for paragraphs."
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softeria/ms-365-mcp-server",
|
|
3
3
|
"mcpName": "io.github.Softeria/ms-365-mcp-server",
|
|
4
|
-
"version": "0.190.
|
|
4
|
+
"version": "0.190.4",
|
|
5
5
|
"description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|