@softeria/ms-365-mcp-server 0.9.9 → 0.9.12

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 CHANGED
@@ -21,19 +21,23 @@ API.
21
21
  ## Supported Services & Tools
22
22
 
23
23
  **Email (Outlook)**
24
- <sub>list-mail-messages, list-mail-folders, list-mail-folder-messages, get-mail-message, send-mail, delete-mail-message</sub>
24
+ <sub>list-mail-messages, list-mail-folders, list-mail-folder-messages, get-mail-message, send-mail,
25
+ delete-mail-message</sub>
25
26
 
26
27
  **Calendar**
27
- <sub>list-calendars, list-calendar-events, get-calendar-event, get-calendar-view, create-calendar-event, update-calendar-event, delete-calendar-event</sub>
28
+ <sub>list-calendars, list-calendar-events, get-calendar-event, get-calendar-view, create-calendar-event,
29
+ update-calendar-event, delete-calendar-event</sub>
28
30
 
29
31
  **OneDrive & SharePoint Files**
30
- <sub>list-drives, get-drive-root-item, list-folder-files, download-onedrive-file-content, upload-file-content, upload-new-file, delete-onedrive-file</sub>
32
+ <sub>list-drives, get-drive-root-item, list-folder-files, download-onedrive-file-content, upload-file-content,
33
+ upload-new-file, delete-onedrive-file</sub>
31
34
 
32
35
  **Excel Operations**
33
36
  <sub>list-excel-worksheets, get-excel-range, create-excel-chart, format-excel-range, sort-excel-range</sub>
34
37
 
35
38
  **OneNote**
36
- <sub>list-onenote-notebooks, list-onenote-notebook-sections, list-onenote-section-pages, get-onenote-page-content, create-onenote-page</sub>
39
+ <sub>list-onenote-notebooks, list-onenote-notebook-sections, list-onenote-section-pages, get-onenote-page-content,
40
+ create-onenote-page</sub>
37
41
 
38
42
  **To Do Tasks**
39
43
  <sub>list-todo-task-lists, list-todo-tasks, get-todo-task, create-todo-task, update-todo-task, delete-todo-task</sub>
@@ -42,13 +46,19 @@ API.
42
46
  <sub>list-planner-tasks, get-planner-plan, list-plan-tasks, get-planner-task, create-planner-task</sub>
43
47
 
44
48
  **Contacts**
45
- <sub>list-outlook-contacts, get-outlook-contact, create-outlook-contact, update-outlook-contact, delete-outlook-contact</sub>
49
+ <sub>list-outlook-contacts, get-outlook-contact, create-outlook-contact, update-outlook-contact,
50
+ delete-outlook-contact</sub>
46
51
 
47
52
  **Teams & Chats** (Work/School accounts only)
48
- <sub>list-chats, get-chat, list-chat-messages, get-chat-message, send-chat-message, list-chat-message-replies, reply-to-chat-message, list-joined-teams, get-team, list-team-channels, get-team-channel, list-channel-messages, get-channel-message, send-channel-message, list-team-members</sub>
53
+ <sub>list-chats, get-chat, list-chat-messages, get-chat-message, send-chat-message, list-chat-message-replies,
54
+ reply-to-chat-message, list-joined-teams, get-team, list-team-channels, get-team-channel, list-channel-messages,
55
+ get-channel-message, send-channel-message, list-team-members</sub>
49
56
 
50
57
  **SharePoint Sites** (Work/School accounts only)
51
- <sub>search-sharepoint-sites, get-sharepoint-site, get-sharepoint-site-by-path, list-sharepoint-site-drives, get-sharepoint-site-drive-by-id, list-sharepoint-site-items, get-sharepoint-site-item, list-sharepoint-site-lists, get-sharepoint-site-list, list-sharepoint-site-list-items, get-sharepoint-site-list-item, get-sharepoint-sites-delta</sub>
58
+ <sub>search-sharepoint-sites, get-sharepoint-site, get-sharepoint-site-by-path, list-sharepoint-site-drives,
59
+ get-sharepoint-site-drive-by-id, list-sharepoint-site-items, get-sharepoint-site-item, list-sharepoint-site-lists,
60
+ get-sharepoint-site-list, list-sharepoint-site-list-items, get-sharepoint-site-list-item,
61
+ get-sharepoint-sites-delta</sub>
52
62
 
53
63
  **User Profile**
54
64
  <sub>get-current-user</sub>
@@ -147,6 +157,7 @@ The following options can be used when running ms-365-mcp-server directly from t
147
157
  --login Login using device code flow
148
158
  --logout Log out and clear saved credentials
149
159
  --verify-login Verify login without starting the server
160
+ --force-work-scopes Force inclusion of work account scopes during login (includes Teams, SharePoint, etc.)
150
161
  ```
151
162
 
152
163
  ### Server Options
@@ -166,8 +177,9 @@ Environment variables:
166
177
 
167
178
  - `READ_ONLY=true|1`: Alternative to --read-only flag
168
179
  - `ENABLED_TOOLS`: Filter tools using regex pattern (alternative to --enabled-tools flag)
180
+ - `MS365_MCP_FORCE_WORK_SCOPES=true|1`: Force inclusion of work account scopes (alternative to --force-work-scopes flag)
169
181
  - `LOG_LEVEL`: Set logging level (default: 'info')
170
- - `SILENT=true`: Disable console output
182
+ - `SILENT=true|1`: Disable console output
171
183
  - `MS365_MCP_CLIENT_ID`: Custom Azure app client ID (defaults to built-in app)
172
184
  - `MS365_MCP_TENANT_ID`: Custom tenant ID (defaults to 'common' for multi-tenant)
173
185
 
@@ -106,6 +106,14 @@ function flattenComplexSchemasRecursively(schemas) {
106
106
  for (const subSchema of schema.allOf) {
107
107
  if (subSchema.$ref && subSchema.$ref.startsWith('#/components/schemas/')) {
108
108
  const refName = subSchema.$ref.replace('#/components/schemas/', '');
109
+ if (schemaName === 'microsoft.graph.attendee') {
110
+ console.log(
111
+ `Processing ref ${refName} for attendee, exists: ${!!schemas[refName]}, has properties: ${!!schemas[refName]?.properties}`
112
+ );
113
+ if (schemas[refName]?.properties) {
114
+ console.log(`Properties in ${refName}:`, Object.keys(schemas[refName].properties));
115
+ }
116
+ }
109
117
  if (schemas[refName] && schemas[refName].properties) {
110
118
  Object.assign(flattened.properties, schemas[refName].properties);
111
119
  if (schemas[refName].required) {
@@ -146,6 +154,21 @@ function flattenComplexSchemasRecursively(schemas) {
146
154
 
147
155
  schemas[schemaName] = flattened;
148
156
  flattenedCount++;
157
+
158
+ if (schemaName === 'microsoft.graph.attendee') {
159
+ console.log('Ensuring attendee has all required properties from attendeeBase');
160
+ const attendeeBase = schemas['microsoft.graph.attendeeBase'];
161
+ if (attendeeBase && attendeeBase.properties) {
162
+ if (!flattened.properties.emailAddress && attendeeBase.properties.emailAddress) {
163
+ flattened.properties.emailAddress = attendeeBase.properties.emailAddress;
164
+ console.log('Added emailAddress property to attendee');
165
+ }
166
+ if (!flattened.properties.type && attendeeBase.properties.type) {
167
+ flattened.properties.type = attendeeBase.properties.type;
168
+ console.log('Added type property to attendee');
169
+ }
170
+ }
171
+ }
149
172
  } catch (error) {
150
173
  console.warn(`Warning: Could not flatten schema ${schemaName}:`, error.message);
151
174
  }
@@ -252,6 +275,21 @@ function flattenComplexSchemasRecursively(schemas) {
252
275
  });
253
276
 
254
277
  console.log(`Flattened ${flattenedCount} complex schemas`);
278
+
279
+ console.log('Second pass: Fixing inheritance dependencies...');
280
+ if (schemas['microsoft.graph.attendee'] && schemas['microsoft.graph.attendeeBase']) {
281
+ const attendee = schemas['microsoft.graph.attendee'];
282
+ const attendeeBase = schemas['microsoft.graph.attendeeBase'];
283
+
284
+ if (!attendee.properties.emailAddress && attendeeBase.properties?.emailAddress) {
285
+ attendee.properties.emailAddress = attendeeBase.properties.emailAddress;
286
+ console.log('Fixed: Added emailAddress to attendee from attendeeBase');
287
+ }
288
+ if (!attendee.properties.type && attendeeBase.properties?.type) {
289
+ attendee.properties.type = attendeeBase.properties.type;
290
+ console.log('Fixed: Added type to attendee from attendeeBase');
291
+ }
292
+ }
255
293
  }
256
294
 
257
295
  function simplifyAnyOfInPaths(paths) {
package/dist/cli.js CHANGED
@@ -18,7 +18,8 @@ program
18
18
  .option('--read-only', 'Start server in read-only mode, disabling write operations')
19
19
  .option('--http [port]', 'Use Streamable HTTP transport instead of stdio (optionally specify port, default: 3000)')
20
20
  .option('--enable-auth-tools', 'Enable login/logout tools when using HTTP mode (disabled by default in HTTP mode)')
21
- .option('--enabled-tools <pattern>', 'Filter tools using regex pattern (e.g., "excel|contact" to enable Excel and Contact tools)');
21
+ .option('--enabled-tools <pattern>', 'Filter tools using regex pattern (e.g., "excel|contact" to enable Excel and Contact tools)')
22
+ .option('--force-work-scopes', 'Force inclusion of work account scopes during login (includes Teams, SharePoint, etc.)');
22
23
  export function parseArgs() {
23
24
  program.parse();
24
25
  const options = program.opts();
@@ -28,5 +29,9 @@ export function parseArgs() {
28
29
  if (process.env.ENABLED_TOOLS) {
29
30
  options.enabledTools = process.env.ENABLED_TOOLS;
30
31
  }
32
+ if (process.env.MS365_MCP_FORCE_WORK_SCOPES === 'true' ||
33
+ process.env.MS365_MCP_FORCE_WORK_SCOPES === '1') {
34
+ options.forceWorkScopes = true;
35
+ }
31
36
  return options;
32
37
  }
@@ -131,12 +131,6 @@
131
131
  "toolName": "upload-file-content",
132
132
  "scopes": ["Files.ReadWrite"]
133
133
  },
134
- {
135
- "pathPattern": "/drives/{drive-id}/items/{driveItem-id}:/{filename}:/content",
136
- "method": "put",
137
- "toolName": "upload-new-file",
138
- "scopes": ["Files.ReadWrite"]
139
- },
140
134
  {
141
135
  "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/charts/add",
142
136
  "method": "post",
@@ -1,5 +1,6 @@
1
1
  import { makeApi, Zodios } from './hack.js';
2
2
  import { z } from 'zod';
3
+ const microsoft_graph_attendeeType = z.enum(['required', 'optional', 'resource']);
3
4
  const microsoft_graph_chatType = z.enum(['oneOnOne', 'group', 'meeting', 'unknownFutureValue']);
4
5
  const microsoft_graph_teamworkUserIdentityType = z.enum([
5
6
  'aadUser',
@@ -2607,7 +2608,12 @@ const microsoft_graph_responseStatus = z
2607
2608
  .partial()
2608
2609
  .strict();
2609
2610
  const microsoft_graph_attendee = z
2610
- .object({ proposedNewTime: microsoft_graph_timeSlot, status: microsoft_graph_responseStatus })
2611
+ .object({
2612
+ proposedNewTime: microsoft_graph_timeSlot,
2613
+ status: microsoft_graph_responseStatus,
2614
+ emailAddress: microsoft_graph_emailAddress,
2615
+ type: microsoft_graph_attendeeType
2616
+ })
2611
2617
  .partial()
2612
2618
  .strict();
2613
2619
  const microsoft_graph_importance = z.enum(['low', 'normal', 'high']);
@@ -10976,6 +10982,7 @@ const microsoft_graph_conversationMemberCollectionResponse = z
10976
10982
  .partial()
10977
10983
  .strict();
10978
10984
  export const schemas = {
10985
+ microsoft_graph_attendeeType,
10979
10986
  microsoft_graph_chatType,
10980
10987
  microsoft_graph_teamworkUserIdentityType,
10981
10988
  microsoft_graph_teamworkUserIdentity,
package/dist/index.js CHANGED
@@ -4,10 +4,12 @@ import logger from './logger.js';
4
4
  import AuthManager from './auth.js';
5
5
  import MicrosoftGraphServer from './server.js';
6
6
  import { version } from './version.js';
7
+ import { buildScopesFromEndpoints } from './auth.js';
7
8
  async function main() {
8
9
  try {
9
10
  const args = parseArgs();
10
- const authManager = new AuthManager();
11
+ const scopes = buildScopesFromEndpoints(args.forceWorkScopes);
12
+ const authManager = new AuthManager(undefined, scopes);
11
13
  await authManager.loadTokenCache();
12
14
  if (args.login) {
13
15
  await authManager.acquireTokenByDeviceCode();
package/dist/logger.js CHANGED
@@ -27,7 +27,7 @@ const logger = winston.createLogger({
27
27
  export const enableConsoleLogging = () => {
28
28
  logger.add(new winston.transports.Console({
29
29
  format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
30
- silent: process.env.SILENT === 'true',
30
+ silent: process.env.SILENT === 'true' || process.env.SILENT === '1',
31
31
  }));
32
32
  };
33
33
  export default logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.9.9",
3
+ "version": "0.9.12",
4
4
  "description": "Microsoft 365 MCP Server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -131,12 +131,6 @@
131
131
  "toolName": "upload-file-content",
132
132
  "scopes": ["Files.ReadWrite"]
133
133
  },
134
- {
135
- "pathPattern": "/drives/{drive-id}/items/{driveItem-id}:/{filename}:/content",
136
- "method": "put",
137
- "toolName": "upload-new-file",
138
- "scopes": ["Files.ReadWrite"]
139
- },
140
134
  {
141
135
  "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/charts/add",
142
136
  "method": "post",