@softeria/ms-365-mcp-server 0.4.1 → 0.4.3

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,9 +21,6 @@ A Model Context Protocol (MCP) server for interacting with Microsoft 365 service
21
21
  - To Do tasks and task lists
22
22
  - Planner plans and tasks
23
23
  - Outlook contacts
24
- - User management
25
- - Dynamic tools powered by Microsoft Graph OpenAPI spec
26
- - Built on the Model Context Protocol
27
24
 
28
25
  ## Quick Start Example
29
26
 
@@ -82,6 +79,31 @@ integration method.
82
79
 
83
80
  Tokens are cached securely in your OS credential store (fallback to file).
84
81
 
82
+ ## CLI Options
83
+
84
+ The following options can be used when running ms-365-mcp-server directly from the command line:
85
+
86
+ ```
87
+ --login Login using device code flow
88
+ --logout Log out and clear saved credentials
89
+ --verify-login Verify login without starting the server
90
+ ```
91
+
92
+ ### Server Options
93
+
94
+ When running as an MCP server, the following options can be used:
95
+
96
+ ```
97
+ -v Enable verbose logging
98
+ --read-only Start server in read-only mode, disabling write operations
99
+ ```
100
+
101
+ Environment variables:
102
+
103
+ - `READ_ONLY=true|1`: Alternative to --read-only flag
104
+ - `LOG_LEVEL`: Set logging level (default: 'info')
105
+ - `SILENT=true`: Disable console output
106
+
85
107
  ## License
86
108
 
87
109
  MIT © 2025 Softeria
@@ -6,6 +6,13 @@ export function createAndSaveSimplifiedOpenAPI(endpointsFile, openapiFile, opena
6
6
 
7
7
  const spec = fs.readFileSync(openapiFile, 'utf8');
8
8
  const openApiSpec = yaml.load(spec);
9
+
10
+ for (const endpoint of endpoints) {
11
+ if (!openApiSpec.paths[endpoint.pathPattern]) {
12
+ throw new Error(`Path "${endpoint.pathPattern}" not found in OpenAPI spec.`);
13
+ }
14
+ }
15
+
9
16
  for (const [key, value] of Object.entries(openApiSpec.paths)) {
10
17
  const e = endpoints.filter((ep) => ep.pathPattern === key);
11
18
  if (e.length === 0) {
package/dist/auth.js CHANGED
@@ -124,6 +124,7 @@ class AuthManager {
124
124
  };
125
125
  try {
126
126
  logger.info('Requesting device code...');
127
+ logger.info(`Scopes are: ${this.scopes.join(', ')}`);
127
128
  const response = await this.msalApp.acquireTokenByDeviceCode(deviceCodeRequest);
128
129
  logger.info('Device code login successful');
129
130
  this.accessToken = response?.accessToken || null;
package/dist/cli.js CHANGED
@@ -14,8 +14,13 @@ program
14
14
  .option('-v', 'Enable verbose logging')
15
15
  .option('--login', 'Login using device code flow')
16
16
  .option('--logout', 'Log out and clear saved credentials')
17
- .option('--verify-login', 'Verify login without starting the server');
17
+ .option('--verify-login', 'Verify login without starting the server')
18
+ .option('--read-only', 'Start server in read-only mode, disabling write operations');
18
19
  export function parseArgs() {
19
20
  program.parse();
20
- return program.opts();
21
+ const options = program.opts();
22
+ if (process.env.READ_ONLY === 'true' || process.env.READ_ONLY === '1') {
23
+ options.readOnly = true;
24
+ }
25
+ return options;
21
26
  }
@@ -104,7 +104,7 @@
104
104
  ]
105
105
  },
106
106
  {
107
- "pathPattern": "/drives",
107
+ "pathPattern": "/me/drives",
108
108
  "method": "get",
109
109
  "toolName": "list-drives",
110
110
  "scopes": [
@@ -196,6 +196,14 @@
196
196
  "Files.Read"
197
197
  ]
198
198
  },
199
+ {
200
+ "pathPattern": "/drives/{drive-id}/items/{driveItem-id}/children",
201
+ "method": "post",
202
+ "toolName": "create-folder",
203
+ "scopes": [
204
+ "Files.ReadWrite"
205
+ ]
206
+ },
199
207
  {
200
208
  "pathPattern": "/me/onenote/notebooks",
201
209
  "method": "get",