@softeria/ms-365-mcp-server 0.189.0 → 0.190.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/PRESETS.md +15 -9
- package/dist/endpoints.json +35 -0
- package/dist/graph-tools.js +15 -1
- package/dist/lib/body-params.js +39 -0
- package/dist/lib/tool-schema.js +13 -0
- package/package.json +1 -1
- package/src/endpoints.json +35 -0
package/PRESETS.md
CHANGED
|
@@ -10,7 +10,7 @@ Every preset also includes the account tools (`login`, `logout`, `verify-login`,
|
|
|
10
10
|
|
|
11
11
|
| Preset | Mode | Tools | Scopes | Org mode | Description |
|
|
12
12
|
| ------------- | ---------------------------------------------------------------- | ---------: | -------: | -------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| `all` | [full](#all-full)<br>[read only](#all-read-only) |
|
|
13
|
+
| `all` | [full](#all-full)<br>[read only](#all-read-only) | 372<br>182 | 65<br>38 | -<br>- | All available tools |
|
|
14
14
|
| `calendar` | [full](#calendar-full)<br>[read only](#calendar-read-only) | 48<br>23 | 7<br>5 | -<br>- | Calendar and event management |
|
|
15
15
|
| `contacts` | [full](#contacts-full)<br>[read only](#contacts-read-only) | 15<br>7 | 1<br>1 | -<br>- | Outlook contacts management |
|
|
16
16
|
| `excel` | [full](#excel-full)<br>[read only](#excel-read-only) | 25<br>9 | 1<br>1 | -<br>- | Excel spreadsheet operations |
|
|
@@ -20,18 +20,18 @@ Every preset also includes the account tools (`login`, `logout`, `verify-login`,
|
|
|
20
20
|
| `onenote` | [full](#onenote-full)<br>[read only](#onenote-read-only) | 29<br>17 | 5<br>2 | -<br>- | OneNote notebook operations |
|
|
21
21
|
| `outlook` | [full](#outlook-full)<br>[read only](#outlook-read-only) | 97<br>37 | 8<br>6 | -<br>- | Outlook app only: mail, calendar and contacts |
|
|
22
22
|
| `personal` | [full](#personal-full)<br>[read only](#personal-read-only) | 178<br>74 | 20<br>15 | -<br>- | Personal productivity tools (mail, calendar, files, contacts, tasks, notes, search) |
|
|
23
|
-
| `search` | [full](#search-full)<br>[read only](#search-read-only) |
|
|
23
|
+
| `search` | [full](#search-full)<br>[read only](#search-read-only) | 8<br>8 | 8<br>8 | -<br>- | Microsoft Search capabilities |
|
|
24
24
|
| `tasks` | [full](#tasks-full)<br>[read only](#tasks-read-only) | 35<br>16 | 1<br>1 | -<br>- | Task and planning tools (To Do, Planner) |
|
|
25
25
|
| `teams` | [full](#teams-full)<br>[read only](#teams-read-only) | 73<br>43 | 31<br>18 | required<br>required | Teams app only: chats, channels, meetings and presence |
|
|
26
26
|
| `teams-write` | [full](#teams-write-full)<br>[read only](#teams-write-read-only) | 11<br>7 | 6<br>3 | required<br>required | Teams send-only: send/reply in chats and channels, list chats/teams/channels by name, activity notifications - no message reading |
|
|
27
27
|
| `users` | [full](#users-full)<br>[read only](#users-read-only) | 11<br>11 | 4<br>4 | required<br>required | User directory access |
|
|
28
|
-
| `work` | [full](#work-full)<br>[read only](#work-read-only) |
|
|
28
|
+
| `work` | [full](#work-full)<br>[read only](#work-read-only) | 192<br>112 | 55<br>33 | required<br>required | Organization/work tools (Teams, SharePoint, shared mailboxes, search) |
|
|
29
29
|
|
|
30
30
|
## `all` full
|
|
31
31
|
|
|
32
32
|
All available tools
|
|
33
33
|
|
|
34
|
-
Tools (
|
|
34
|
+
Tools (372):
|
|
35
35
|
|
|
36
36
|
- `accept-calendar-event`
|
|
37
37
|
- `add-calendar-event-attachment`
|
|
@@ -344,6 +344,7 @@ Tools (371):
|
|
|
344
344
|
- `reply-to-channel-message`
|
|
345
345
|
- `reply-to-chat-message`
|
|
346
346
|
- `reply-to-group-thread`
|
|
347
|
+
- `search-files`
|
|
347
348
|
- `search-onedrive-files`
|
|
348
349
|
- `search-query`
|
|
349
350
|
- `search-sharepoint-sites`
|
|
@@ -477,7 +478,7 @@ Scopes (65):
|
|
|
477
478
|
|
|
478
479
|
All available tools
|
|
479
480
|
|
|
480
|
-
Tools (
|
|
481
|
+
Tools (182):
|
|
481
482
|
|
|
482
483
|
- `copilot-retrieve`
|
|
483
484
|
- `download-bytes`
|
|
@@ -657,6 +658,7 @@ Tools (181):
|
|
|
657
658
|
- `list-webinar-sessions`
|
|
658
659
|
- `parse-teams-url`
|
|
659
660
|
- `read-mail-text`
|
|
661
|
+
- `search-files`
|
|
660
662
|
- `search-onedrive-files`
|
|
661
663
|
- `search-query`
|
|
662
664
|
- `search-sharepoint-sites`
|
|
@@ -1678,12 +1680,13 @@ Scopes (15):
|
|
|
1678
1680
|
|
|
1679
1681
|
Microsoft Search capabilities
|
|
1680
1682
|
|
|
1681
|
-
Tools (
|
|
1683
|
+
Tools (8):
|
|
1682
1684
|
|
|
1683
1685
|
- `copilot-retrieve`
|
|
1684
1686
|
- `download-bytes`
|
|
1685
1687
|
- `download-bytes-to-file`
|
|
1686
1688
|
- `get-download-url`
|
|
1689
|
+
- `search-files`
|
|
1687
1690
|
- `search-onedrive-files`
|
|
1688
1691
|
- `search-query`
|
|
1689
1692
|
- `search-sharepoint-sites`
|
|
@@ -1703,12 +1706,13 @@ Scopes (8):
|
|
|
1703
1706
|
|
|
1704
1707
|
Microsoft Search capabilities
|
|
1705
1708
|
|
|
1706
|
-
Tools (
|
|
1709
|
+
Tools (8):
|
|
1707
1710
|
|
|
1708
1711
|
- `copilot-retrieve`
|
|
1709
1712
|
- `download-bytes`
|
|
1710
1713
|
- `download-bytes-to-file`
|
|
1711
1714
|
- `get-download-url`
|
|
1715
|
+
- `search-files`
|
|
1712
1716
|
- `search-onedrive-files`
|
|
1713
1717
|
- `search-query`
|
|
1714
1718
|
- `search-sharepoint-sites`
|
|
@@ -2097,7 +2101,7 @@ Organization/work tools (Teams, SharePoint, shared mailboxes, search)
|
|
|
2097
2101
|
|
|
2098
2102
|
Requires `--org-mode`.
|
|
2099
2103
|
|
|
2100
|
-
Tools (
|
|
2104
|
+
Tools (192):
|
|
2101
2105
|
|
|
2102
2106
|
- `add-group-member`
|
|
2103
2107
|
- `add-group-owner`
|
|
@@ -2258,6 +2262,7 @@ Tools (191):
|
|
|
2258
2262
|
- `reply-to-channel-message`
|
|
2259
2263
|
- `reply-to-chat-message`
|
|
2260
2264
|
- `reply-to-group-thread`
|
|
2265
|
+
- `search-files`
|
|
2261
2266
|
- `search-query`
|
|
2262
2267
|
- `search-sharepoint-sites`
|
|
2263
2268
|
- `send-channel-message`
|
|
@@ -2355,7 +2360,7 @@ Organization/work tools (Teams, SharePoint, shared mailboxes, search)
|
|
|
2355
2360
|
|
|
2356
2361
|
Requires `--org-mode`.
|
|
2357
2362
|
|
|
2358
|
-
Tools (
|
|
2363
|
+
Tools (112):
|
|
2359
2364
|
|
|
2360
2365
|
- `copilot-retrieve`
|
|
2361
2366
|
- `download-bytes`
|
|
@@ -2466,6 +2471,7 @@ Tools (111):
|
|
|
2466
2471
|
- `list-webinar-sessions`
|
|
2467
2472
|
- `parse-teams-url`
|
|
2468
2473
|
- `read-mail-text`
|
|
2474
|
+
- `search-files`
|
|
2469
2475
|
- `search-query`
|
|
2470
2476
|
- `search-sharepoint-sites`
|
|
2471
2477
|
|
package/dist/endpoints.json
CHANGED
|
@@ -2574,6 +2574,41 @@
|
|
|
2574
2574
|
"ChannelMessage.Read.All"
|
|
2575
2575
|
]
|
|
2576
2576
|
},
|
|
2577
|
+
{
|
|
2578
|
+
"pathPattern": "/search/query",
|
|
2579
|
+
"method": "post",
|
|
2580
|
+
"toolName": "search-files",
|
|
2581
|
+
"descriptionOverride": "Find files by keyword across the OneDrive and SharePoint files the signed-in user can read, without knowing the site or drive. The search is KQL keyword matching, not semantic: give a few keywords, not a sentence. A hit's resource.parentReference.driveId and resource.id go to get-drive-item.",
|
|
2582
|
+
"presets": ["search", "work"],
|
|
2583
|
+
"readOnly": true,
|
|
2584
|
+
"workScopes": [["Sites.Read.All"], ["Files.Read.All"]],
|
|
2585
|
+
"queryParams": [],
|
|
2586
|
+
"fixedBody": {
|
|
2587
|
+
"requests": [
|
|
2588
|
+
{ "entityTypes": ["driveItem"], "query": { "queryString": "" }, "from": 0, "size": 10 }
|
|
2589
|
+
]
|
|
2590
|
+
},
|
|
2591
|
+
"bodyParams": {
|
|
2592
|
+
"queryString": {
|
|
2593
|
+
"target": ["requests", 0, "query", "queryString"],
|
|
2594
|
+
"type": "string",
|
|
2595
|
+
"required": true,
|
|
2596
|
+
"description": "Keywords to look for in file names, metadata and content, in KQL."
|
|
2597
|
+
},
|
|
2598
|
+
"size": {
|
|
2599
|
+
"target": ["requests", 0, "size"],
|
|
2600
|
+
"type": "integer",
|
|
2601
|
+
"minimum": 1,
|
|
2602
|
+
"description": "How many hits to return. Defaults to 10."
|
|
2603
|
+
},
|
|
2604
|
+
"from": {
|
|
2605
|
+
"target": ["requests", 0, "from"],
|
|
2606
|
+
"type": "integer",
|
|
2607
|
+
"minimum": 0,
|
|
2608
|
+
"description": "Offset of the first hit, 0 by default. While moreResultsAvailable is true, the next page starts at the previous from plus the previous size."
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2577
2612
|
{
|
|
2578
2613
|
"pathPattern": "/copilot/retrieval",
|
|
2579
2614
|
"method": "post",
|
package/dist/graph-tools.js
CHANGED
|
@@ -93,6 +93,7 @@ import {
|
|
|
93
93
|
targetsUserProfile,
|
|
94
94
|
userFieldEnforcement
|
|
95
95
|
} from "./lib/user-field-policy.js";
|
|
96
|
+
import { bodyParamSchemas, buildFixedBody } from "./lib/body-params.js";
|
|
96
97
|
import logger from "./logger.js";
|
|
97
98
|
import {
|
|
98
99
|
mcpAppResultWithoutBody,
|
|
@@ -2152,6 +2153,9 @@ async function executeGraphTool(tool, config, graphClient, params, authManager,
|
|
|
2152
2153
|
if (paramName === "fileName" && config?.blobOutput) continue;
|
|
2153
2154
|
if (paramName === "name" && config?.nameFilter) continue;
|
|
2154
2155
|
if (paramName === "token" && config?.deltaToken) continue;
|
|
2156
|
+
if (config?.bodyParams && Object.prototype.hasOwnProperty.call(config.bodyParams, paramName)) {
|
|
2157
|
+
continue;
|
|
2158
|
+
}
|
|
2155
2159
|
if ([
|
|
2156
2160
|
"account",
|
|
2157
2161
|
"confirm",
|
|
@@ -2430,7 +2434,14 @@ async function executeGraphTool(tool, config, graphClient, params, authManager,
|
|
|
2430
2434
|
...acceptFallback ? { acceptFallback } : {}
|
|
2431
2435
|
};
|
|
2432
2436
|
if (config?.fixedBody) {
|
|
2433
|
-
|
|
2437
|
+
const built = buildFixedBody(config.fixedBody, config.bodyParams ?? {}, params);
|
|
2438
|
+
if ("error" in built) {
|
|
2439
|
+
return {
|
|
2440
|
+
content: [{ type: "text", text: JSON.stringify({ error: built.error }) }],
|
|
2441
|
+
isError: true
|
|
2442
|
+
};
|
|
2443
|
+
}
|
|
2444
|
+
body = built.body;
|
|
2434
2445
|
}
|
|
2435
2446
|
if (config?.blobOutput && isBlobOutputEnabled()) {
|
|
2436
2447
|
options.forceBinary = true;
|
|
@@ -2723,6 +2734,9 @@ function registerGraphToolWithMcp(server, tool, endpointConfig, graphClient, opt
|
|
|
2723
2734
|
}
|
|
2724
2735
|
}
|
|
2725
2736
|
}
|
|
2737
|
+
if (endpointConfig?.bodyParams) {
|
|
2738
|
+
Object.assign(paramSchema, bodyParamSchemas(endpointConfig.bodyParams));
|
|
2739
|
+
}
|
|
2726
2740
|
const pathParamMatches = tool.path.matchAll(/:([a-zA-Z]+)/g);
|
|
2727
2741
|
for (const match of pathParamMatches) {
|
|
2728
2742
|
const pathParamName = match[1];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
function bodyParamSchema(config) {
|
|
3
|
+
let schema;
|
|
4
|
+
if (config.type === "integer") {
|
|
5
|
+
const whole = z.number().int().min(config.minimum ?? Number.MIN_SAFE_INTEGER);
|
|
6
|
+
schema = z.union([whole, z.string().regex(/^\d+$/).transform(Number).pipe(whole)]);
|
|
7
|
+
} else {
|
|
8
|
+
schema = z.string();
|
|
9
|
+
if (config.required) schema = schema.min(1);
|
|
10
|
+
}
|
|
11
|
+
schema = schema.describe(config.description);
|
|
12
|
+
return config.required ? schema : schema.optional();
|
|
13
|
+
}
|
|
14
|
+
function bodyParamSchemas(bodyParams) {
|
|
15
|
+
return Object.fromEntries(
|
|
16
|
+
Object.entries(bodyParams).map(([name, config]) => [name, bodyParamSchema(config)])
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function buildFixedBody(fixedBody, bodyParams, params) {
|
|
20
|
+
const body = structuredClone(fixedBody);
|
|
21
|
+
const schemas = bodyParamSchemas(bodyParams);
|
|
22
|
+
for (const [name, config] of Object.entries(bodyParams)) {
|
|
23
|
+
const parsed = schemas[name].safeParse(params[name]);
|
|
24
|
+
if (!parsed.success) {
|
|
25
|
+
return { error: `Invalid ${name}: ${parsed.error.issues.map((i) => i.message).join("; ")}` };
|
|
26
|
+
}
|
|
27
|
+
if (parsed.data === void 0) continue;
|
|
28
|
+
let node = body;
|
|
29
|
+
for (const step of config.target.slice(0, -1)) {
|
|
30
|
+
node = node[step];
|
|
31
|
+
}
|
|
32
|
+
node[config.target[config.target.length - 1]] = parsed.data;
|
|
33
|
+
}
|
|
34
|
+
return { body };
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
bodyParamSchemas,
|
|
38
|
+
buildFixedBody
|
|
39
|
+
};
|
package/dist/lib/tool-schema.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { queryParameterSchema } from "./query-parameter-schema.js";
|
|
3
3
|
import { tidyToolJsonSchema, zodToToolJsonSchema } from "../normalize-tool-schema.js";
|
|
4
4
|
import { isDestructiveOperation } from "./destructive-ops.js";
|
|
5
|
+
import { bodyParamSchemas } from "./body-params.js";
|
|
5
6
|
import { ACCEPT_VALUE_JSON_SCHEMA } from "./media-type.js";
|
|
6
7
|
import {
|
|
7
8
|
isFetchAllPagesApplicable,
|
|
@@ -70,6 +71,18 @@ function describeToolSchema(tool, config, ctx = {}) {
|
|
|
70
71
|
}
|
|
71
72
|
];
|
|
72
73
|
});
|
|
74
|
+
if (config?.bodyParams) {
|
|
75
|
+
for (const [name, schema] of Object.entries(bodyParamSchemas(config.bodyParams))) {
|
|
76
|
+
const { inner, optional } = unwrapOptional(schema);
|
|
77
|
+
params.push({
|
|
78
|
+
name,
|
|
79
|
+
in: "Query",
|
|
80
|
+
required: !optional,
|
|
81
|
+
description: schema.description ?? inner.description,
|
|
82
|
+
schema: toParamJsonSchema(inner)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
73
86
|
if (isDestructiveOperation(tool.method, config)) {
|
|
74
87
|
params.push({
|
|
75
88
|
name: "confirm",
|
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.
|
|
4
|
+
"version": "0.190.0",
|
|
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",
|
package/src/endpoints.json
CHANGED
|
@@ -2574,6 +2574,41 @@
|
|
|
2574
2574
|
"ChannelMessage.Read.All"
|
|
2575
2575
|
]
|
|
2576
2576
|
},
|
|
2577
|
+
{
|
|
2578
|
+
"pathPattern": "/search/query",
|
|
2579
|
+
"method": "post",
|
|
2580
|
+
"toolName": "search-files",
|
|
2581
|
+
"descriptionOverride": "Find files by keyword across the OneDrive and SharePoint files the signed-in user can read, without knowing the site or drive. The search is KQL keyword matching, not semantic: give a few keywords, not a sentence. A hit's resource.parentReference.driveId and resource.id go to get-drive-item.",
|
|
2582
|
+
"presets": ["search", "work"],
|
|
2583
|
+
"readOnly": true,
|
|
2584
|
+
"workScopes": [["Sites.Read.All"], ["Files.Read.All"]],
|
|
2585
|
+
"queryParams": [],
|
|
2586
|
+
"fixedBody": {
|
|
2587
|
+
"requests": [
|
|
2588
|
+
{ "entityTypes": ["driveItem"], "query": { "queryString": "" }, "from": 0, "size": 10 }
|
|
2589
|
+
]
|
|
2590
|
+
},
|
|
2591
|
+
"bodyParams": {
|
|
2592
|
+
"queryString": {
|
|
2593
|
+
"target": ["requests", 0, "query", "queryString"],
|
|
2594
|
+
"type": "string",
|
|
2595
|
+
"required": true,
|
|
2596
|
+
"description": "Keywords to look for in file names, metadata and content, in KQL."
|
|
2597
|
+
},
|
|
2598
|
+
"size": {
|
|
2599
|
+
"target": ["requests", 0, "size"],
|
|
2600
|
+
"type": "integer",
|
|
2601
|
+
"minimum": 1,
|
|
2602
|
+
"description": "How many hits to return. Defaults to 10."
|
|
2603
|
+
},
|
|
2604
|
+
"from": {
|
|
2605
|
+
"target": ["requests", 0, "from"],
|
|
2606
|
+
"type": "integer",
|
|
2607
|
+
"minimum": 0,
|
|
2608
|
+
"description": "Offset of the first hit, 0 by default. While moreResultsAvailable is true, the next page starts at the previous from plus the previous size."
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2577
2612
|
{
|
|
2578
2613
|
"pathPattern": "/copilot/retrieval",
|
|
2579
2614
|
"method": "post",
|