@softeria/ms-365-mcp-server 0.174.1 → 0.174.2
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 +18 -18
- package/README.md +6 -3
- package/bin/generate-presets-md.ts +3 -1
- package/dist/cli.js +1 -1
- package/dist/graph-tools.js +13 -8
- package/dist/server.js +13 -1
- package/package.json +1 -2
package/PRESETS.md
CHANGED
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
## Summary
|
|
6
6
|
|
|
7
|
-
| Preset
|
|
8
|
-
|
|
|
9
|
-
| `all`
|
|
10
|
-
| `calendar`
|
|
11
|
-
| `contacts`
|
|
12
|
-
| `excel`
|
|
13
|
-
| `files`
|
|
14
|
-
| `mail`
|
|
15
|
-
| `onedrive`
|
|
16
|
-
| `onenote`
|
|
17
|
-
| `outlook`
|
|
18
|
-
| `personal`
|
|
19
|
-
| `search`
|
|
20
|
-
| `tasks`
|
|
21
|
-
| `teams`
|
|
22
|
-
| `teams-write` | 11 | required | Teams send-only: send/reply in chats and channels, list chats/teams/channels by name, activity notifications - no message reading |
|
|
23
|
-
| `users`
|
|
24
|
-
| `work`
|
|
7
|
+
| Preset | Tools | Org mode | Description |
|
|
8
|
+
| ----------------------------- | ----: | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| [`all`](#all) | 361 | | All available tools |
|
|
10
|
+
| [`calendar`](#calendar) | 47 | | Calendar and event management |
|
|
11
|
+
| [`contacts`](#contacts) | 15 | | Outlook contacts management |
|
|
12
|
+
| [`excel`](#excel) | 25 | | Excel spreadsheet operations |
|
|
13
|
+
| [`files`](#files) | 25 | | OneDrive file and folder operations |
|
|
14
|
+
| [`mail`](#mail) | 49 | | Email operations (read, send, manage folders, attachments) |
|
|
15
|
+
| [`onedrive`](#onedrive) | 23 | | OneDrive app only: drive and file operations, excluding Excel |
|
|
16
|
+
| [`onenote`](#onenote) | 28 | | OneNote notebook operations |
|
|
17
|
+
| [`outlook`](#outlook) | 96 | | Outlook app only: mail, calendar and contacts |
|
|
18
|
+
| [`personal`](#personal) | 175 | | Personal productivity tools (mail, calendar, files, contacts, tasks, notes, search) |
|
|
19
|
+
| [`search`](#search) | 7 | | Microsoft Search capabilities |
|
|
20
|
+
| [`tasks`](#tasks) | 34 | | Task and planning tools (To Do, Planner) |
|
|
21
|
+
| [`teams`](#teams) | 73 | required | Teams app only: chats, channels, meetings and presence |
|
|
22
|
+
| [`teams-write`](#teams-write) | 11 | required | Teams send-only: send/reply in chats and channels, list chats/teams/channels by name, activity notifications - no message reading |
|
|
23
|
+
| [`users`](#users) | 11 | required | User directory access |
|
|
24
|
+
| [`work`](#work) | 184 | required | Organization/work tools (Teams, SharePoint, shared mailboxes, search) |
|
|
25
25
|
|
|
26
26
|
## `all`
|
|
27
27
|
|
package/README.md
CHANGED
|
@@ -690,15 +690,18 @@ npx @softeria/ms-365-mcp-server --org-mode --discovery \
|
|
|
690
690
|
|
|
691
691
|
`--eager-tools` accepts comma-separated **exact** Graph or utility tool names,
|
|
692
692
|
not a regular expression or preset. `MS365_MCP_EAGER_TOOLS` is the environment
|
|
693
|
-
fallback; the CLI wins.
|
|
694
|
-
|
|
693
|
+
fallback; the CLI wins. An empty or whitespace-only environment value is treated
|
|
694
|
+
as unset, including without discovery; an explicitly empty CLI option is still
|
|
695
|
+
invalid. The option requires `--discovery`. Empty entries and
|
|
696
|
+
unknown names fail startup, including in HTTP mode. Duplicate names are registered once.
|
|
695
697
|
|
|
696
698
|
Direct tools use the same schemas, annotations and execution handlers as normal
|
|
697
699
|
mode. They also remain searchable and executable through discovery. Existing
|
|
698
700
|
`--preset`, `--enabled-tools`, `--allowed-scopes`, `--read-only`, organization-mode
|
|
699
701
|
and transport restrictions apply first: an eager selection cannot enable a
|
|
700
702
|
filtered-out tool or add permissions. Recognized but unavailable tools are
|
|
701
|
-
omitted with a
|
|
703
|
+
omitted with a diagnostic logged once per server instance. HTTP still excludes
|
|
704
|
+
server-local file tools.
|
|
702
705
|
|
|
703
706
|
Select a small set: exposing many generated Graph schemas can consume substantial
|
|
704
707
|
model context. This option does not shrink individual schemas. Without
|
|
@@ -33,7 +33,9 @@ export async function renderPresetsMarkdown(): Promise<string> {
|
|
|
33
33
|
for (const entry of catalog) {
|
|
34
34
|
const org = entry.requiresOrgMode ? 'required' : '';
|
|
35
35
|
const desc = entry.description.replace(/\|/g, '\\|');
|
|
36
|
-
lines.push(
|
|
36
|
+
lines.push(
|
|
37
|
+
`| [\`${entry.name}\`](#${entry.name}) | ${entry.tools.length} | ${org} | ${desc} |`
|
|
38
|
+
);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
lines.push('');
|
package/dist/cli.js
CHANGED
|
@@ -130,7 +130,7 @@ function parseArgs() {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
delete options.enabledToolsFile;
|
|
133
|
-
const eagerValue = options.eagerTools ?? process.env.MS365_MCP_EAGER_TOOLS;
|
|
133
|
+
const eagerValue = options.eagerTools ?? (process.env.MS365_MCP_EAGER_TOOLS?.trim() || void 0);
|
|
134
134
|
if (eagerValue !== void 0) {
|
|
135
135
|
if (!options.discovery) throw new Error("--eager-tools requires --discovery");
|
|
136
136
|
const names = String(eagerValue).split(",").map((name) => name.trim());
|
package/dist/graph-tools.js
CHANGED
|
@@ -2597,6 +2597,14 @@ function scoreDiscoveryQuery(query, index) {
|
|
|
2597
2597
|
ranked.sort((a, b) => b.score - a.score);
|
|
2598
2598
|
return ranked;
|
|
2599
2599
|
}
|
|
2600
|
+
function validateEagerToolNames(names) {
|
|
2601
|
+
const knownNames = /* @__PURE__ */ new Set([
|
|
2602
|
+
...allEndpoints.map((t) => t.alias),
|
|
2603
|
+
...UTILITY_TOOLS.map((t) => t.name)
|
|
2604
|
+
]);
|
|
2605
|
+
const unknown = names.filter((name) => !knownNames.has(name));
|
|
2606
|
+
if (unknown.length > 0) throw new Error(`Unknown eager tool names: ${unknown.join(", ")}`);
|
|
2607
|
+
}
|
|
2600
2608
|
function registerDiscoveryTools(server, graphClient, options = {}) {
|
|
2601
2609
|
const {
|
|
2602
2610
|
readOnly = false,
|
|
@@ -2610,12 +2618,7 @@ function registerDiscoveryTools(server, graphClient, options = {}) {
|
|
|
2610
2618
|
userFields: userFieldsValue
|
|
2611
2619
|
} = options;
|
|
2612
2620
|
const eagerNames = new Set(options.eagerTools ?? []);
|
|
2613
|
-
|
|
2614
|
-
...allEndpoints.map((t) => t.alias),
|
|
2615
|
-
...UTILITY_TOOLS.map((t) => t.name)
|
|
2616
|
-
]);
|
|
2617
|
-
const unknown = [...eagerNames].filter((name) => !knownNames.has(name));
|
|
2618
|
-
if (unknown.length > 0) throw new Error(`Unknown eager tool names: ${unknown.join(", ")}`);
|
|
2621
|
+
validateEagerToolNames([...eagerNames]);
|
|
2619
2622
|
const userFields = parseUserFields(userFieldsValue);
|
|
2620
2623
|
let enabledToolsRegex;
|
|
2621
2624
|
if (enabledTools) {
|
|
@@ -2673,7 +2676,8 @@ function registerDiscoveryTools(server, graphClient, options = {}) {
|
|
|
2673
2676
|
});
|
|
2674
2677
|
continue;
|
|
2675
2678
|
}
|
|
2676
|
-
|
|
2679
|
+
if (options.onUnavailableEagerTool) options.onUnavailableEagerTool(name);
|
|
2680
|
+
else logger.info(`Eager tool ${name} is unavailable under the current filters or transport`);
|
|
2677
2681
|
} catch (error) {
|
|
2678
2682
|
logger.error(`Failed to register eager tool ${name}: ${error.message}`);
|
|
2679
2683
|
}
|
|
@@ -2866,5 +2870,6 @@ export {
|
|
|
2866
2870
|
registerDiscoveryTools,
|
|
2867
2871
|
registerGraphTools,
|
|
2868
2872
|
rewriteMentionShorthand,
|
|
2869
|
-
scoreDiscoveryQuery
|
|
2873
|
+
scoreDiscoveryQuery,
|
|
2874
|
+
validateEagerToolNames
|
|
2870
2875
|
};
|
package/dist/server.js
CHANGED
|
@@ -18,7 +18,11 @@ import {
|
|
|
18
18
|
import { getCloudEndpoints } from "./cloud-config.js";
|
|
19
19
|
import { dumpError } from "./crash-logging.js";
|
|
20
20
|
import GraphClient from "./graph-client.js";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
registerDiscoveryTools,
|
|
23
|
+
registerGraphTools,
|
|
24
|
+
validateEagerToolNames
|
|
25
|
+
} from "./graph-tools.js";
|
|
22
26
|
import { configureAttachmentMinting } from "./lib/attachment-minting.js";
|
|
23
27
|
import { AttachmentTicketStore } from "./lib/attachment-tickets.js";
|
|
24
28
|
import { ATTACHMENT_ROUTE, loadAttachmentUrlConfig } from "./lib/attachment-url-config.js";
|
|
@@ -155,6 +159,13 @@ class MicrosoftGraphServer {
|
|
|
155
159
|
this.httpServers = [];
|
|
156
160
|
// Two-leg PKCE: stores client's code_challenge and server's code_verifier, keyed by OAuth state
|
|
157
161
|
this.pkceStore = /* @__PURE__ */ new Map();
|
|
162
|
+
this.reportedUnavailableEagerTools = /* @__PURE__ */ new Set();
|
|
163
|
+
this.reportUnavailableEagerTool = (name) => {
|
|
164
|
+
if (this.reportedUnavailableEagerTools.has(name)) return;
|
|
165
|
+
this.reportedUnavailableEagerTools.add(name);
|
|
166
|
+
logger.info(`Eager tool ${name} is unavailable under the current filters or transport`);
|
|
167
|
+
};
|
|
168
|
+
if (options.eagerTools?.length) validateEagerToolNames(options.eagerTools);
|
|
158
169
|
this.authManager = authManager;
|
|
159
170
|
this.options = options;
|
|
160
171
|
this.graphClient = null;
|
|
@@ -193,6 +204,7 @@ class MicrosoftGraphServer {
|
|
|
193
204
|
const registrationOptions = {
|
|
194
205
|
readOnly: this.options.readOnly,
|
|
195
206
|
eagerTools: this.options.eagerTools,
|
|
207
|
+
onUnavailableEagerTool: this.reportUnavailableEagerTool,
|
|
196
208
|
enabledTools: this.options.enabledTools,
|
|
197
209
|
orgMode: this.options.orgMode,
|
|
198
210
|
authManager: this.authManager,
|
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.174.
|
|
4
|
+
"version": "0.174.2",
|
|
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",
|
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"@vitest/coverage-v8": "^4.1.8",
|
|
69
69
|
"eslint": "^9.31.0",
|
|
70
70
|
"globals": "^16.3.0",
|
|
71
|
-
"patch-package": "^8.0.1",
|
|
72
71
|
"prettier": "^3.5.3",
|
|
73
72
|
"semantic-release": "^25.0.2",
|
|
74
73
|
"tsup": "^8.5.0",
|