@softeria/ms-365-mcp-server 0.180.0 → 0.180.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 +14 -8
- package/README.md +2 -0
- package/bin/generate-presets-md.ts +2 -0
- package/bin/modules/simplified-openapi.mjs +4 -1
- package/dist/auth-tools.js +69 -34
- package/dist/endpoints.json +12 -4
- package/dist/generated/client.js +1 -1
- package/dist/graph-tools.js +41 -1
- package/dist/server.js +7 -1
- package/dist/tool-categories.js +14 -1
- package/package.json +1 -1
- package/src/endpoints.json +12 -4
package/PRESETS.md
CHANGED
|
@@ -4,20 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
Tool and scope lists assume `--org-mode`; without it, personal accounts get fewer tools and scopes.
|
|
6
6
|
|
|
7
|
+
Every preset also includes the account tools (`login`, `logout`, `verify-login`, `list-accounts`, `select-account`, `remove-account`; only `verify-login` and `list-accounts` under `--read-only`). They are not listed or counted below.
|
|
8
|
+
|
|
7
9
|
## Summary
|
|
8
10
|
|
|
9
11
|
| Preset | Mode | Tools | Scopes | Org mode | Description |
|
|
10
12
|
| ------------- | ---------------------------------------------------------------- | ---------: | -------: | -------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
-
| `all` | [full](#all-full)<br>[read only](#all-read-only) |
|
|
13
|
+
| `all` | [full](#all-full)<br>[read only](#all-read-only) | 370<br>180 | 63<br>37 | -<br>- | All available tools |
|
|
12
14
|
| `calendar` | [full](#calendar-full)<br>[read only](#calendar-read-only) | 47<br>22 | 7<br>5 | -<br>- | Calendar and event management |
|
|
13
15
|
| `contacts` | [full](#contacts-full)<br>[read only](#contacts-read-only) | 15<br>7 | 1<br>1 | -<br>- | Outlook contacts management |
|
|
14
16
|
| `excel` | [full](#excel-full)<br>[read only](#excel-read-only) | 25<br>9 | 1<br>1 | -<br>- | Excel spreadsheet operations |
|
|
15
17
|
| `files` | [full](#files-full)<br>[read only](#files-read-only) | 25<br>14 | 3<br>2 | -<br>- | OneDrive file and folder operations |
|
|
16
|
-
| `mail` | [full](#mail-full)<br>[read only](#mail-read-only) |
|
|
18
|
+
| `mail` | [full](#mail-full)<br>[read only](#mail-read-only) | 50<br>19 | 5<br>3 | -<br>- | Email operations (read, send, manage folders, attachments) |
|
|
17
19
|
| `onedrive` | [full](#onedrive-full)<br>[read only](#onedrive-read-only) | 23<br>12 | 2<br>1 | -<br>- | OneDrive app only: drive and file operations, excluding Excel |
|
|
18
20
|
| `onenote` | [full](#onenote-full)<br>[read only](#onenote-read-only) | 29<br>17 | 3<br>1 | -<br>- | OneNote notebook operations |
|
|
19
|
-
| `outlook` | [full](#outlook-full)<br>[read only](#outlook-read-only) |
|
|
20
|
-
| `personal` | [full](#personal-full)<br>[read only](#personal-read-only) |
|
|
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
|
+
| `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) |
|
|
21
23
|
| `search` | [full](#search-full)<br>[read only](#search-read-only) | 7<br>7 | 8<br>8 | -<br>- | Microsoft Search capabilities |
|
|
22
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) |
|
|
23
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 |
|
|
@@ -29,7 +31,7 @@ Tool and scope lists assume `--org-mode`; without it, personal accounts get fewe
|
|
|
29
31
|
|
|
30
32
|
All available tools
|
|
31
33
|
|
|
32
|
-
Tools (
|
|
34
|
+
Tools (370):
|
|
33
35
|
|
|
34
36
|
- `accept-calendar-event`
|
|
35
37
|
- `add-calendar-event-attachment`
|
|
@@ -116,6 +118,7 @@ Tools (369):
|
|
|
116
118
|
- `delete-mail-attachment`
|
|
117
119
|
- `delete-mail-folder`
|
|
118
120
|
- `delete-mail-message`
|
|
121
|
+
- `delete-mail-message-skip-deleted-items`
|
|
119
122
|
- `delete-mail-rule`
|
|
120
123
|
- `delete-my-calendar-permission`
|
|
121
124
|
- `delete-onedrive-file`
|
|
@@ -963,7 +966,7 @@ Scopes (2):
|
|
|
963
966
|
|
|
964
967
|
Email operations (read, send, manage folders, attachments)
|
|
965
968
|
|
|
966
|
-
Tools (
|
|
969
|
+
Tools (50):
|
|
967
970
|
|
|
968
971
|
- `add-mail-attachment`
|
|
969
972
|
- `copy-mail-message`
|
|
@@ -981,6 +984,7 @@ Tools (49):
|
|
|
981
984
|
- `delete-mail-attachment`
|
|
982
985
|
- `delete-mail-folder`
|
|
983
986
|
- `delete-mail-message`
|
|
987
|
+
- `delete-mail-message-skip-deleted-items`
|
|
984
988
|
- `delete-mail-rule`
|
|
985
989
|
- `download-bytes`
|
|
986
990
|
- `download-bytes-to-file`
|
|
@@ -1187,7 +1191,7 @@ Scopes (1):
|
|
|
1187
1191
|
|
|
1188
1192
|
Outlook app only: mail, calendar and contacts
|
|
1189
1193
|
|
|
1190
|
-
Tools (
|
|
1194
|
+
Tools (97):
|
|
1191
1195
|
|
|
1192
1196
|
- `accept-calendar-event`
|
|
1193
1197
|
- `add-calendar-event-attachment`
|
|
@@ -1221,6 +1225,7 @@ Tools (96):
|
|
|
1221
1225
|
- `delete-mail-attachment`
|
|
1222
1226
|
- `delete-mail-folder`
|
|
1223
1227
|
- `delete-mail-message`
|
|
1228
|
+
- `delete-mail-message-skip-deleted-items`
|
|
1224
1229
|
- `delete-mail-rule`
|
|
1225
1230
|
- `delete-my-calendar-permission`
|
|
1226
1231
|
- `delete-outlook-contact`
|
|
@@ -1354,7 +1359,7 @@ Scopes (6):
|
|
|
1354
1359
|
|
|
1355
1360
|
Personal productivity tools (mail, calendar, files, contacts, tasks, notes, search)
|
|
1356
1361
|
|
|
1357
|
-
Tools (
|
|
1362
|
+
Tools (178):
|
|
1358
1363
|
|
|
1359
1364
|
- `accept-calendar-event`
|
|
1360
1365
|
- `add-calendar-event-attachment`
|
|
@@ -1408,6 +1413,7 @@ Tools (177):
|
|
|
1408
1413
|
- `delete-mail-attachment`
|
|
1409
1414
|
- `delete-mail-folder`
|
|
1410
1415
|
- `delete-mail-message`
|
|
1416
|
+
- `delete-mail-message-skip-deleted-items`
|
|
1411
1417
|
- `delete-mail-rule`
|
|
1412
1418
|
- `delete-my-calendar-permission`
|
|
1413
1419
|
- `delete-onedrive-file`
|
package/README.md
CHANGED
|
@@ -827,6 +827,8 @@ When running as an MCP server, the following options can be used:
|
|
|
827
827
|
--public-url <url> Public base URL for OAuth when behind a reverse proxy (see Open WebUI section and docs/deployment.md)
|
|
828
828
|
```
|
|
829
829
|
|
|
830
|
+
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`.
|
|
831
|
+
|
|
830
832
|
Environment variables:
|
|
831
833
|
|
|
832
834
|
- `READ_ONLY=true|1`: Alternative to --read-only flag
|
|
@@ -91,6 +91,8 @@ export async function renderPresetsMarkdown(): Promise<string> {
|
|
|
91
91
|
'',
|
|
92
92
|
'Tool and scope lists assume `--org-mode`; without it, personal accounts get fewer tools and scopes.',
|
|
93
93
|
'',
|
|
94
|
+
'Every preset also includes the account tools (`login`, `logout`, `verify-login`, `list-accounts`, `select-account`, `remove-account`; only `verify-login` and `list-accounts` under `--read-only`). They are not listed or counted below.',
|
|
95
|
+
'',
|
|
94
96
|
'## Summary',
|
|
95
97
|
'',
|
|
96
98
|
'| Preset | Mode | Tools | Scopes | Org mode | Description |',
|
|
@@ -10,8 +10,11 @@ export function createAndSaveSimplifiedOpenAPI(
|
|
|
10
10
|
const allEndpoints = JSON.parse(fs.readFileSync(endpointsFile, 'utf8'));
|
|
11
11
|
// Each spec is trimmed against only the endpoints targeting its version. Entries
|
|
12
12
|
// without an explicit apiVersion default to v1.0, so existing endpoints are unchanged.
|
|
13
|
+
// An entry with fixedBody shares another tool's operation (see EndpointConfig in
|
|
14
|
+
// src/graph-tools.ts), so it adds nothing to the spec.
|
|
13
15
|
const endpoints = allEndpoints.filter(
|
|
14
|
-
(endpoint) =>
|
|
16
|
+
(endpoint) =>
|
|
17
|
+
!endpoint.disabled && !endpoint.fixedBody && (endpoint.apiVersion ?? 'v1.0') === apiVersion
|
|
15
18
|
);
|
|
16
19
|
|
|
17
20
|
const spec = fs.readFileSync(openapiFile, 'utf8');
|
package/dist/auth-tools.js
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import logger from "./logger.js";
|
|
3
3
|
import { getRequestTokens } from "./request-context.js";
|
|
4
|
-
function
|
|
4
|
+
function readOnlyHintOf(args) {
|
|
5
|
+
const annotations = args.find(
|
|
6
|
+
(arg) => typeof arg === "object" && arg !== null && "readOnlyHint" in arg
|
|
7
|
+
);
|
|
8
|
+
return annotations?.readOnlyHint === true;
|
|
9
|
+
}
|
|
10
|
+
function registerAuthTools(mcpServer, authManager, options = {}) {
|
|
11
|
+
let enabledToolsRegex;
|
|
12
|
+
if (options.enabledTools) {
|
|
13
|
+
try {
|
|
14
|
+
enabledToolsRegex = new RegExp(options.enabledTools, "i");
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const server = {
|
|
19
|
+
tool: ((name, ...args) => {
|
|
20
|
+
if (options.readOnly && !readOnlyHintOf(args)) return void 0;
|
|
21
|
+
if (enabledToolsRegex && !enabledToolsRegex.test(name)) return void 0;
|
|
22
|
+
return mcpServer.tool.call(mcpServer, name, ...args);
|
|
23
|
+
})
|
|
24
|
+
};
|
|
5
25
|
server.tool(
|
|
6
26
|
"login",
|
|
7
27
|
"Authenticate with Microsoft account",
|
|
8
28
|
{
|
|
9
29
|
force: z.boolean().default(false).describe("Force a new login even if already logged in")
|
|
10
30
|
},
|
|
31
|
+
{ title: "login", readOnlyHint: false, openWorldHint: false },
|
|
11
32
|
async ({ force }) => {
|
|
12
33
|
try {
|
|
13
34
|
if (!force) {
|
|
@@ -70,47 +91,59 @@ function registerAuthTools(server, authManager) {
|
|
|
70
91
|
}
|
|
71
92
|
}
|
|
72
93
|
);
|
|
73
|
-
server.tool(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
server.tool(
|
|
95
|
+
"logout",
|
|
96
|
+
"Log out from Microsoft account",
|
|
97
|
+
{},
|
|
98
|
+
{ title: "logout", readOnlyHint: false, openWorldHint: false },
|
|
99
|
+
async () => {
|
|
100
|
+
try {
|
|
101
|
+
await authManager.logout();
|
|
102
|
+
return {
|
|
103
|
+
content: [
|
|
104
|
+
{
|
|
105
|
+
type: "text",
|
|
106
|
+
text: JSON.stringify({ message: "Logged out successfully" })
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
} catch {
|
|
111
|
+
return {
|
|
112
|
+
content: [
|
|
113
|
+
{
|
|
114
|
+
type: "text",
|
|
115
|
+
text: JSON.stringify({ error: "Logout failed" })
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
server.tool(
|
|
123
|
+
"verify-login",
|
|
124
|
+
"Check current Microsoft authentication status",
|
|
125
|
+
{},
|
|
126
|
+
{ title: "verify-login", readOnlyHint: true, openWorldHint: false },
|
|
127
|
+
async () => {
|
|
128
|
+
let testResult;
|
|
129
|
+
try {
|
|
130
|
+
testResult = await authManager.testLogin();
|
|
131
|
+
} catch (error) {
|
|
132
|
+
testResult = {
|
|
133
|
+
success: false,
|
|
134
|
+
message: `Login failed: ${error.message}`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
85
137
|
return {
|
|
86
138
|
content: [
|
|
87
139
|
{
|
|
88
140
|
type: "text",
|
|
89
|
-
text: JSON.stringify(
|
|
141
|
+
text: JSON.stringify(testResult)
|
|
90
142
|
}
|
|
91
143
|
]
|
|
92
144
|
};
|
|
93
145
|
}
|
|
94
|
-
|
|
95
|
-
server.tool("verify-login", "Check current Microsoft authentication status", {}, async () => {
|
|
96
|
-
let testResult;
|
|
97
|
-
try {
|
|
98
|
-
testResult = await authManager.testLogin();
|
|
99
|
-
} catch (error) {
|
|
100
|
-
testResult = {
|
|
101
|
-
success: false,
|
|
102
|
-
message: `Login failed: ${error.message}`
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
content: [
|
|
107
|
-
{
|
|
108
|
-
type: "text",
|
|
109
|
-
text: JSON.stringify(testResult)
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
};
|
|
113
|
-
});
|
|
146
|
+
);
|
|
114
147
|
server.tool(
|
|
115
148
|
"list-accounts",
|
|
116
149
|
"List all Microsoft accounts configured in this server. Use this to discover available account emails before making tool calls. Reflects accounts added mid-session via --login.",
|
|
@@ -164,6 +197,7 @@ function registerAuthTools(server, authManager) {
|
|
|
164
197
|
{
|
|
165
198
|
account: z.string().describe("Email address or account ID of the account to select")
|
|
166
199
|
},
|
|
200
|
+
{ title: "select-account", readOnlyHint: false, openWorldHint: false },
|
|
167
201
|
async ({ account }) => {
|
|
168
202
|
try {
|
|
169
203
|
await authManager.selectAccount(account);
|
|
@@ -196,6 +230,7 @@ function registerAuthTools(server, authManager) {
|
|
|
196
230
|
{
|
|
197
231
|
account: z.string().describe("Email address or account ID of the account to remove")
|
|
198
232
|
},
|
|
233
|
+
{ title: "remove-account", readOnlyHint: false, openWorldHint: false },
|
|
199
234
|
async ({ account }) => {
|
|
200
235
|
try {
|
|
201
236
|
const success = await authManager.removeAccount(account);
|
package/dist/endpoints.json
CHANGED
|
@@ -294,14 +294,22 @@
|
|
|
294
294
|
"presets": ["mail", "outlook", "personal"],
|
|
295
295
|
"scopes": ["Mail.ReadWrite"]
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
"pathPattern": "/me/messages/{message-id}/move",
|
|
299
|
+
"method": "post",
|
|
300
|
+
"toolName": "delete-mail-message",
|
|
301
|
+
"fixedBody": { "destinationId": "deleteditems" },
|
|
302
|
+
"descriptionOverride": "Delete an Outlook email message by its message ID, the way Delete in Outlook does: the message moves to the Deleted Items folder, where the user can see and restore it. Returns the moved message, which has a new id. A message already in Deleted Items stays there; to remove it from Deleted Items, use delete-mail-message-skip-deleted-items.",
|
|
303
|
+
"presets": ["mail", "outlook", "personal"],
|
|
304
|
+
"scopes": ["Mail.ReadWrite"]
|
|
305
|
+
},
|
|
297
306
|
{
|
|
298
307
|
"pathPattern": "/me/messages/{message-id}",
|
|
299
308
|
"method": "delete",
|
|
300
|
-
"toolName": "delete-mail-message",
|
|
301
|
-
"descriptionOverride": "Delete an Outlook email message by its message ID
|
|
309
|
+
"toolName": "delete-mail-message-skip-deleted-items",
|
|
310
|
+
"descriptionOverride": "Delete an Outlook email message by its message ID without moving it to Deleted Items, the way Shift+Delete in Outlook does: the message goes to Recoverable Items, is no longer shown in the mailbox, and the user can only restore it with Recover Deleted Items until the retention period ends. Also removes a message from Deleted Items. For an ordinary delete, use delete-mail-message.",
|
|
302
311
|
"presets": ["mail", "outlook", "personal"],
|
|
303
|
-
"scopes": ["Mail.ReadWrite"]
|
|
304
|
-
"llmTip": "Soft delete — moves to Deleted Items. To permanently delete, delete again from Deleted Items."
|
|
312
|
+
"scopes": ["Mail.ReadWrite"]
|
|
305
313
|
},
|
|
306
314
|
{
|
|
307
315
|
"pathPattern": "/me/messages/{message-id}/move",
|
package/dist/generated/client.js
CHANGED
|
@@ -10638,7 +10638,7 @@ having to fetch the entire set of messages from the server every time.`,
|
|
|
10638
10638
|
{
|
|
10639
10639
|
method: "delete",
|
|
10640
10640
|
path: "/me/messages/:messageId",
|
|
10641
|
-
alias: "delete-mail-message",
|
|
10641
|
+
alias: "delete-mail-message-skip-deleted-items",
|
|
10642
10642
|
description: `Delete eventMessage.`,
|
|
10643
10643
|
requestFormat: "json",
|
|
10644
10644
|
parameters: [
|
package/dist/graph-tools.js
CHANGED
|
@@ -84,12 +84,47 @@ import {
|
|
|
84
84
|
import logger from "./logger.js";
|
|
85
85
|
import { getRequestTokens } from "./request-context.js";
|
|
86
86
|
import { TOOL_CATEGORIES } from "./tool-categories.js";
|
|
87
|
-
const allEndpoints = [...api.endpoints, ...betaApi.endpoints];
|
|
88
87
|
const __filename = fileURLToPath(import.meta.url);
|
|
89
88
|
const __dirname = path.dirname(__filename);
|
|
90
89
|
const endpointsData = JSON.parse(
|
|
91
90
|
readFileSync(path.join(__dirname, "endpoints.json"), "utf8")
|
|
92
91
|
);
|
|
92
|
+
function generatedPathFor(pathPattern) {
|
|
93
|
+
return pathPattern.replace(
|
|
94
|
+
/\{([^}]+)\}/g,
|
|
95
|
+
(_, name) => `:${name.replace(/-([a-z])/g, (_m, c) => c.toUpperCase())}`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function deriveFixedBodyEndpoints(configs, generated, report) {
|
|
99
|
+
const derived = [];
|
|
100
|
+
for (const e of configs) {
|
|
101
|
+
if (!e.fixedBody || e.disabled) continue;
|
|
102
|
+
const source = e.apiVersion === "beta" ? generated.beta : generated.v1;
|
|
103
|
+
const wantedPath = generatedPathFor(e.pathPattern);
|
|
104
|
+
const base = source.find((t) => t.method === e.method.toLowerCase() && t.path === wantedPath);
|
|
105
|
+
if (!base) {
|
|
106
|
+
report(
|
|
107
|
+
`endpoints.json: ${e.toolName} has fixedBody but no generated operation for ${e.method.toUpperCase()} ${e.pathPattern}; tool not registered`
|
|
108
|
+
);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
derived.push({
|
|
112
|
+
...base,
|
|
113
|
+
alias: e.toolName,
|
|
114
|
+
parameters: (base.parameters ?? []).filter((p) => p.type !== "Body")
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return derived;
|
|
118
|
+
}
|
|
119
|
+
const allEndpoints = [
|
|
120
|
+
...api.endpoints,
|
|
121
|
+
...betaApi.endpoints,
|
|
122
|
+
...deriveFixedBodyEndpoints(
|
|
123
|
+
endpointsData,
|
|
124
|
+
{ v1: api.endpoints, beta: betaApi.endpoints },
|
|
125
|
+
(m) => logger.error(m)
|
|
126
|
+
)
|
|
127
|
+
];
|
|
93
128
|
function withApiVersionPrefix(description, config) {
|
|
94
129
|
return config?.apiVersion === "beta" ? `[beta] ${description}` : description;
|
|
95
130
|
}
|
|
@@ -2070,6 +2105,9 @@ async function executeGraphTool(tool, config, graphClient, params, authManager,
|
|
|
2070
2105
|
method: tool.method.toUpperCase(),
|
|
2071
2106
|
headers
|
|
2072
2107
|
};
|
|
2108
|
+
if (config?.fixedBody) {
|
|
2109
|
+
body = { ...config.fixedBody };
|
|
2110
|
+
}
|
|
2073
2111
|
if (config?.blobOutput && isBlobOutputEnabled()) {
|
|
2074
2112
|
options.forceBinary = true;
|
|
2075
2113
|
options.maxBytes = getBlobMaxBytes();
|
|
@@ -2987,7 +3025,9 @@ export {
|
|
|
2987
3025
|
UTILITY_TOOLS,
|
|
2988
3026
|
buildDiscoverySearchIndex,
|
|
2989
3027
|
buildToolsRegistry,
|
|
3028
|
+
deriveFixedBodyEndpoints,
|
|
2990
3029
|
filterMembersByName,
|
|
3030
|
+
generatedPathFor,
|
|
2991
3031
|
isDestructiveOperation,
|
|
2992
3032
|
isUtilityToolAvailable,
|
|
2993
3033
|
registerDiscoveryTools,
|
package/dist/server.js
CHANGED
|
@@ -214,7 +214,13 @@ class MicrosoftGraphServer {
|
|
|
214
214
|
);
|
|
215
215
|
const shouldRegisterAuthTools = !this.options.appMode && (!this.options.http || this.options.enableAuthTools);
|
|
216
216
|
if (shouldRegisterAuthTools) {
|
|
217
|
-
registerAuthTools(server, this.authManager
|
|
217
|
+
registerAuthTools(server, this.authManager, {
|
|
218
|
+
enabledTools: this.options.enabledTools,
|
|
219
|
+
// With MS365_MCP_OAUTH_TOKEN the token comes from outside, so there is
|
|
220
|
+
// nothing to log in to or switch between. verify-login still checks the
|
|
221
|
+
// token, and list-accounts says cached accounts can't be used (#512).
|
|
222
|
+
readOnly: this.options.readOnly || Boolean(process.env.MS365_MCP_OAUTH_TOKEN)
|
|
223
|
+
});
|
|
218
224
|
}
|
|
219
225
|
const registrationOptions = {
|
|
220
226
|
readOnly: this.options.readOnly,
|
package/dist/tool-categories.js
CHANGED
|
@@ -60,6 +60,14 @@ const PRESET_META = {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
const UNIVERSAL_UTILITY_TOOLS = ["download-bytes", "download-bytes-to-file"];
|
|
63
|
+
const ACCOUNT_TOOLS = [
|
|
64
|
+
"login",
|
|
65
|
+
"logout",
|
|
66
|
+
"verify-login",
|
|
67
|
+
"list-accounts",
|
|
68
|
+
"select-account",
|
|
69
|
+
"remove-account"
|
|
70
|
+
];
|
|
63
71
|
const SCOPED_UTILITY_TOOLS = {
|
|
64
72
|
"get-download-url": ["files", "onedrive", "personal", "work", "search"],
|
|
65
73
|
"get-upload-url": ["mail", "calendar", "outlook", "personal", "work"],
|
|
@@ -79,7 +87,11 @@ for (const [tool, presets] of Object.entries(SCOPED_UTILITY_TOOLS)) {
|
|
|
79
87
|
function getToolsForPreset(preset) {
|
|
80
88
|
if (preset === "all") {
|
|
81
89
|
const endpointNames2 = [...new Set(endpointEntries.map((e) => e.toolName))];
|
|
82
|
-
const utilityNames = [
|
|
90
|
+
const utilityNames = [
|
|
91
|
+
...UNIVERSAL_UTILITY_TOOLS,
|
|
92
|
+
...Object.keys(SCOPED_UTILITY_TOOLS),
|
|
93
|
+
...ACCOUNT_TOOLS
|
|
94
|
+
];
|
|
83
95
|
return [.../* @__PURE__ */ new Set([...endpointNames2, ...utilityNames])].sort();
|
|
84
96
|
}
|
|
85
97
|
const endpointNames = [
|
|
@@ -91,6 +103,7 @@ function getToolsForPreset(preset) {
|
|
|
91
103
|
return [
|
|
92
104
|
.../* @__PURE__ */ new Set([
|
|
93
105
|
...endpointNames,
|
|
106
|
+
...ACCOUNT_TOOLS,
|
|
94
107
|
...PRESET_META[preset]?.omitUniversalUtilities ? [] : UNIVERSAL_UTILITY_TOOLS,
|
|
95
108
|
...Object.entries(SCOPED_UTILITY_TOOLS).filter(([, presets]) => presets.includes(preset)).map(([name]) => name)
|
|
96
109
|
])
|
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.180.
|
|
4
|
+
"version": "0.180.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",
|
package/src/endpoints.json
CHANGED
|
@@ -294,14 +294,22 @@
|
|
|
294
294
|
"presets": ["mail", "outlook", "personal"],
|
|
295
295
|
"scopes": ["Mail.ReadWrite"]
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
"pathPattern": "/me/messages/{message-id}/move",
|
|
299
|
+
"method": "post",
|
|
300
|
+
"toolName": "delete-mail-message",
|
|
301
|
+
"fixedBody": { "destinationId": "deleteditems" },
|
|
302
|
+
"descriptionOverride": "Delete an Outlook email message by its message ID, the way Delete in Outlook does: the message moves to the Deleted Items folder, where the user can see and restore it. Returns the moved message, which has a new id. A message already in Deleted Items stays there; to remove it from Deleted Items, use delete-mail-message-skip-deleted-items.",
|
|
303
|
+
"presets": ["mail", "outlook", "personal"],
|
|
304
|
+
"scopes": ["Mail.ReadWrite"]
|
|
305
|
+
},
|
|
297
306
|
{
|
|
298
307
|
"pathPattern": "/me/messages/{message-id}",
|
|
299
308
|
"method": "delete",
|
|
300
|
-
"toolName": "delete-mail-message",
|
|
301
|
-
"descriptionOverride": "Delete an Outlook email message by its message ID
|
|
309
|
+
"toolName": "delete-mail-message-skip-deleted-items",
|
|
310
|
+
"descriptionOverride": "Delete an Outlook email message by its message ID without moving it to Deleted Items, the way Shift+Delete in Outlook does: the message goes to Recoverable Items, is no longer shown in the mailbox, and the user can only restore it with Recover Deleted Items until the retention period ends. Also removes a message from Deleted Items. For an ordinary delete, use delete-mail-message.",
|
|
302
311
|
"presets": ["mail", "outlook", "personal"],
|
|
303
|
-
"scopes": ["Mail.ReadWrite"]
|
|
304
|
-
"llmTip": "Soft delete — moves to Deleted Items. To permanently delete, delete again from Deleted Items."
|
|
312
|
+
"scopes": ["Mail.ReadWrite"]
|
|
305
313
|
},
|
|
306
314
|
{
|
|
307
315
|
"pathPattern": "/me/messages/{message-id}/move",
|