@softeria/ms-365-mcp-server 0.3.4 → 0.4.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.
Files changed (49) hide show
  1. package/.github/workflows/build.yml +3 -0
  2. package/.github/workflows/npm-publish.yml +2 -0
  3. package/README.md +4 -15
  4. package/bin/generate-graph-client.mjs +59 -0
  5. package/bin/{download-openapi.mjs → modules/download-openapi.mjs} +10 -20
  6. package/bin/modules/extract-descriptions.mjs +48 -0
  7. package/bin/modules/generate-mcp-tools.mjs +36 -0
  8. package/bin/modules/simplified-openapi.mjs +78 -0
  9. package/dist/auth-tools.js +80 -0
  10. package/dist/auth.js +219 -0
  11. package/dist/cli.js +21 -0
  12. package/dist/endpoints.json +375 -0
  13. package/dist/generated/client.js +14683 -0
  14. package/dist/generated/endpoint-types.js +1 -0
  15. package/dist/generated/hack.js +37 -0
  16. package/dist/graph-client.js +254 -0
  17. package/dist/graph-tools.js +98 -0
  18. package/dist/index.js +39 -0
  19. package/dist/logger.js +33 -0
  20. package/dist/server.js +32 -0
  21. package/{src/version.mjs → dist/version.js} +0 -2
  22. package/package.json +12 -9
  23. package/src/{auth-tools.mjs → auth-tools.ts} +7 -5
  24. package/src/{auth.mjs → auth.ts} +60 -30
  25. package/src/{cli.mjs → cli.ts} +9 -1
  26. package/src/endpoints.json +375 -0
  27. package/src/generated/README.md +51 -0
  28. package/src/generated/client.ts +24916 -0
  29. package/src/generated/endpoint-types.ts +27 -0
  30. package/src/generated/hack.ts +50 -0
  31. package/src/{graph-client.mjs → graph-client.ts} +53 -18
  32. package/src/graph-tools.ts +174 -0
  33. package/{index.mjs → src/index.ts} +6 -6
  34. package/src/{logger.mjs → logger.ts} +1 -1
  35. package/src/{server.mjs → server.ts} +16 -9
  36. package/src/version.ts +9 -0
  37. package/test/{auth-tools.test.js → auth-tools.test.ts} +41 -38
  38. package/test/{cli.test.js → cli.test.ts} +3 -3
  39. package/test/{graph-api.test.js → graph-api.test.ts} +5 -5
  40. package/test/test-hack.ts +17 -0
  41. package/tsconfig.json +16 -0
  42. package/src/dynamic-tools.mjs +0 -442
  43. package/src/openapi-helpers.mjs +0 -187
  44. package/src/param-mapper.mjs +0 -30
  45. package/test/dynamic-tools.test.js +0 -852
  46. package/test/mappings.test.js +0 -29
  47. package/test/mcp-server.test.js +0 -36
  48. package/test/openapi-helpers.test.js +0 -210
  49. package/test/param-mapper.test.js +0 -56
@@ -0,0 +1,375 @@
1
+ [
2
+ {
3
+ "pathPattern": "/me/messages",
4
+ "method": "get",
5
+ "toolName": "list-mail-messages",
6
+ "scopes": [
7
+ "Mail.Read"
8
+ ]
9
+ },
10
+ {
11
+ "pathPattern": "/me/mailFolders",
12
+ "method": "get",
13
+ "toolName": "list-mail-folders",
14
+ "scopes": [
15
+ "Mail.Read"
16
+ ]
17
+ },
18
+ {
19
+ "pathPattern": "/me/mailFolders/{mailFolder-id}/messages",
20
+ "method": "get",
21
+ "toolName": "list-mail-folder-messages",
22
+ "scopes": [
23
+ "Mail.Read"
24
+ ]
25
+ },
26
+ {
27
+ "pathPattern": "/me/messages/{message-id}",
28
+ "method": "get",
29
+ "toolName": "get-mail-message",
30
+ "scopes": [
31
+ "Mail.Read"
32
+ ]
33
+ },
34
+ {
35
+ "pathPattern": "/me/sendMail",
36
+ "method": "post",
37
+ "toolName": "send-mail",
38
+ "scopes": [
39
+ "Mail.Send"
40
+ ]
41
+ },
42
+ {
43
+ "pathPattern": "/me/messages/{message-id}",
44
+ "method": "delete",
45
+ "toolName": "delete-mail-message",
46
+ "scopes": [
47
+ "Mail.ReadWrite"
48
+ ]
49
+ },
50
+ {
51
+ "pathPattern": "/me/events",
52
+ "method": "get",
53
+ "toolName": "list-calendar-events",
54
+ "scopes": [
55
+ "Calendars.Read"
56
+ ]
57
+ },
58
+ {
59
+ "pathPattern": "/me/events/{event-id}",
60
+ "method": "get",
61
+ "toolName": "get-calendar-event",
62
+ "scopes": [
63
+ "Calendars.Read"
64
+ ]
65
+ },
66
+ {
67
+ "pathPattern": "/me/events",
68
+ "method": "post",
69
+ "toolName": "create-calendar-event",
70
+ "scopes": [
71
+ "Calendars.ReadWrite"
72
+ ]
73
+ },
74
+ {
75
+ "pathPattern": "/me/events/{event-id}",
76
+ "method": "patch",
77
+ "toolName": "update-calendar-event",
78
+ "scopes": [
79
+ "Calendars.ReadWrite"
80
+ ]
81
+ },
82
+ {
83
+ "pathPattern": "/me/events/{event-id}",
84
+ "method": "delete",
85
+ "toolName": "delete-calendar-event",
86
+ "scopes": [
87
+ "Calendars.ReadWrite"
88
+ ]
89
+ },
90
+ {
91
+ "pathPattern": "/me/calendarView",
92
+ "method": "get",
93
+ "toolName": "get-calendar-view",
94
+ "scopes": [
95
+ "Calendars.Read"
96
+ ]
97
+ },
98
+ {
99
+ "pathPattern": "/me/calendars",
100
+ "method": "get",
101
+ "toolName": "list-calendars",
102
+ "scopes": [
103
+ "Calendars.Read"
104
+ ]
105
+ },
106
+ {
107
+ "pathPattern": "/drives",
108
+ "method": "get",
109
+ "toolName": "list-drives",
110
+ "scopes": [
111
+ "Files.Read"
112
+ ]
113
+ },
114
+ {
115
+ "pathPattern": "/drives/{drive-id}/root",
116
+ "method": "get",
117
+ "toolName": "get-drive-root-item",
118
+ "scopes": [
119
+ "Files.Read"
120
+ ]
121
+ },
122
+ {
123
+ "pathPattern": "/drives/{drive-id}/root",
124
+ "method": "get",
125
+ "toolName": "get-root-folder",
126
+ "scopes": [
127
+ "Files.Read"
128
+ ]
129
+ },
130
+ {
131
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/children",
132
+ "method": "get",
133
+ "toolName": "list-folder-files",
134
+ "scopes": [
135
+ "Files.Read"
136
+ ]
137
+ },
138
+ {
139
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/children/{driveItem-id1}/content",
140
+ "method": "get",
141
+ "toolName": "download-onedrive-file-content",
142
+ "scopes": [
143
+ "Files.Read"
144
+ ]
145
+ },
146
+ {
147
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}",
148
+ "method": "delete",
149
+ "toolName": "delete-onedrive-file",
150
+ "scopes": [
151
+ "Files.ReadWrite"
152
+ ]
153
+ },
154
+ {
155
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/charts/add",
156
+ "method": "post",
157
+ "toolName": "create-excel-chart",
158
+ "isExcelOp": true,
159
+ "scopes": [
160
+ "Files.ReadWrite"
161
+ ]
162
+ },
163
+ {
164
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/range()/format",
165
+ "method": "patch",
166
+ "toolName": "format-excel-range",
167
+ "isExcelOp": true,
168
+ "scopes": [
169
+ "Files.ReadWrite"
170
+ ]
171
+ },
172
+ {
173
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/range()/sort",
174
+ "method": "patch",
175
+ "toolName": "sort-excel-range",
176
+ "isExcelOp": true,
177
+ "scopes": [
178
+ "Files.ReadWrite"
179
+ ]
180
+ },
181
+ {
182
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/range(address='{address}')",
183
+ "method": "get",
184
+ "toolName": "get-excel-range",
185
+ "isExcelOp": true,
186
+ "scopes": [
187
+ "Files.Read"
188
+ ]
189
+ },
190
+ {
191
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets",
192
+ "method": "get",
193
+ "toolName": "list-excel-worksheets",
194
+ "isExcelOp": true,
195
+ "scopes": [
196
+ "Files.Read"
197
+ ]
198
+ },
199
+ {
200
+ "pathPattern": "/me/onenote/notebooks",
201
+ "method": "get",
202
+ "toolName": "list-onenote-notebooks",
203
+ "scopes": [
204
+ "Notes.Read"
205
+ ]
206
+ },
207
+ {
208
+ "pathPattern": "/me/onenote/notebooks/{notebook-id}/sections",
209
+ "method": "get",
210
+ "toolName": "list-onenote-notebook-sections",
211
+ "scopes": [
212
+ "Notes.Read"
213
+ ]
214
+ },
215
+ {
216
+ "pathPattern": "/me/onenote/notebooks/{notebook-id}/sections/{onenoteSection-id}/pages",
217
+ "method": "get",
218
+ "toolName": "list-onenote-section-pages",
219
+ "scopes": [
220
+ "Notes.Read"
221
+ ]
222
+ },
223
+ {
224
+ "pathPattern": "/me/onenote/pages/{onenotePage-id}/content",
225
+ "method": "get",
226
+ "toolName": "get-onenote-page-content",
227
+ "scopes": [
228
+ "Notes.Read"
229
+ ]
230
+ },
231
+ {
232
+ "pathPattern": "/me/onenote/pages",
233
+ "method": "post",
234
+ "toolName": "create-onenote-page",
235
+ "scopes": [
236
+ "Notes.Create"
237
+ ]
238
+ },
239
+ {
240
+ "pathPattern": "/me/todo/lists",
241
+ "method": "get",
242
+ "toolName": "list-todo-task-lists",
243
+ "scopes": [
244
+ "Tasks.Read"
245
+ ]
246
+ },
247
+ {
248
+ "pathPattern": "/me/todo/lists/{todoTaskList-id}/tasks",
249
+ "method": "get",
250
+ "toolName": "list-todo-tasks",
251
+ "scopes": [
252
+ "Tasks.Read"
253
+ ]
254
+ },
255
+ {
256
+ "pathPattern": "/me/todo/lists/{todoTaskList-id}/tasks/{todoTask-id}",
257
+ "method": "get",
258
+ "toolName": "get-todo-task",
259
+ "scopes": [
260
+ "Tasks.Read"
261
+ ]
262
+ },
263
+ {
264
+ "pathPattern": "/me/todo/lists/{todoTaskList-id}/tasks",
265
+ "method": "post",
266
+ "toolName": "create-todo-task",
267
+ "scopes": [
268
+ "Tasks.ReadWrite"
269
+ ]
270
+ },
271
+ {
272
+ "pathPattern": "/me/todo/lists/{todoTaskList-id}/tasks/{todoTask-id}",
273
+ "method": "patch",
274
+ "toolName": "update-todo-task",
275
+ "scopes": [
276
+ "Tasks.ReadWrite"
277
+ ]
278
+ },
279
+ {
280
+ "pathPattern": "/me/todo/lists/{todoTaskList-id}/tasks/{todoTask-id}",
281
+ "method": "delete",
282
+ "toolName": "delete-todo-task",
283
+ "scopes": [
284
+ "Tasks.ReadWrite"
285
+ ]
286
+ },
287
+ {
288
+ "pathPattern": "/me/planner/tasks",
289
+ "method": "get",
290
+ "toolName": "list-planner-tasks",
291
+ "scopes": [
292
+ "Tasks.Read"
293
+ ]
294
+ },
295
+ {
296
+ "pathPattern": "/planner/plans/{plannerPlan-id}",
297
+ "method": "get",
298
+ "toolName": "get-planner-plan",
299
+ "scopes": [
300
+ "Tasks.Read"
301
+ ]
302
+ },
303
+ {
304
+ "pathPattern": "/planner/plans/{plannerPlan-id}/tasks",
305
+ "method": "get",
306
+ "toolName": "list-plan-tasks",
307
+ "scopes": [
308
+ "Tasks.Read"
309
+ ]
310
+ },
311
+ {
312
+ "pathPattern": "/planner/tasks/{plannerTask-id}",
313
+ "method": "get",
314
+ "toolName": "get-planner-task",
315
+ "scopes": [
316
+ "Tasks.Read"
317
+ ]
318
+ },
319
+ {
320
+ "pathPattern": "/planner/tasks",
321
+ "method": "post",
322
+ "toolName": "create-planner-task",
323
+ "scopes": [
324
+ "Tasks.ReadWrite"
325
+ ]
326
+ },
327
+ {
328
+ "pathPattern": "/me/contacts",
329
+ "method": "get",
330
+ "toolName": "list-outlook-contacts",
331
+ "scopes": [
332
+ "Contacts.Read"
333
+ ]
334
+ },
335
+ {
336
+ "pathPattern": "/me/contacts/{contact-id}",
337
+ "method": "get",
338
+ "toolName": "get-outlook-contact",
339
+ "scopes": [
340
+ "Contacts.Read"
341
+ ]
342
+ },
343
+ {
344
+ "pathPattern": "/me/contacts",
345
+ "method": "post",
346
+ "toolName": "create-outlook-contact",
347
+ "scopes": [
348
+ "Contacts.ReadWrite"
349
+ ]
350
+ },
351
+ {
352
+ "pathPattern": "/me/contacts/{contact-id}",
353
+ "method": "patch",
354
+ "toolName": "update-outlook-contact",
355
+ "scopes": [
356
+ "Contacts.ReadWrite"
357
+ ]
358
+ },
359
+ {
360
+ "pathPattern": "/me/contacts/{contact-id}",
361
+ "method": "delete",
362
+ "toolName": "delete-outlook-contact",
363
+ "scopes": [
364
+ "Contacts.ReadWrite"
365
+ ]
366
+ },
367
+ {
368
+ "pathPattern": "/me",
369
+ "method": "get",
370
+ "toolName": "get-current-user",
371
+ "scopes": [
372
+ "User.Read"
373
+ ]
374
+ }
375
+ ]