@softeria/ms-365-mcp-server 0.11.4 → 0.12.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.
package/dist/cli.js CHANGED
@@ -1,40 +1,39 @@
1
- import { Command } from 'commander';
2
- import { readFileSync } from 'fs';
3
- import path from 'path';
4
- import { fileURLToPath } from 'url';
1
+ import { Command } from "commander";
2
+ import { readFileSync } from "fs";
3
+ import path from "path";
4
+ import { fileURLToPath } from "url";
5
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
- const packageJsonPath = path.join(__dirname, '..', 'package.json');
7
- const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
6
+ const packageJsonPath = path.join(__dirname, "..", "package.json");
7
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
8
8
  const version = packageJson.version;
9
9
  const program = new Command();
10
- program
11
- .name('ms-365-mcp-server')
12
- .description('Microsoft 365 MCP Server')
13
- .version(version)
14
- .option('-v', 'Enable verbose logging')
15
- .option('--login', 'Login using device code flow')
16
- .option('--logout', 'Log out and clear saved credentials')
17
- .option('--verify-login', 'Verify login without starting the server')
18
- .option('--list-accounts', 'List all cached accounts')
19
- .option('--select-account <accountId>', 'Select a specific account by ID')
20
- .option('--remove-account <accountId>', 'Remove a specific account by ID')
21
- .option('--read-only', 'Start server in read-only mode, disabling write operations')
22
- .option('--http [port]', 'Use Streamable HTTP transport instead of stdio (optionally specify port, default: 3000)')
23
- .option('--enable-auth-tools', 'Enable login/logout tools when using HTTP mode (disabled by default in HTTP mode)')
24
- .option('--enabled-tools <pattern>', 'Filter tools using regex pattern (e.g., "excel|contact" to enable Excel and Contact tools)')
25
- .option('--force-work-scopes', 'Force inclusion of work account scopes during login (includes Teams, SharePoint, etc.)');
26
- export function parseArgs() {
27
- program.parse();
28
- const options = program.opts();
29
- if (process.env.READ_ONLY === 'true' || process.env.READ_ONLY === '1') {
30
- options.readOnly = true;
31
- }
32
- if (process.env.ENABLED_TOOLS) {
33
- options.enabledTools = process.env.ENABLED_TOOLS;
34
- }
35
- if (process.env.MS365_MCP_FORCE_WORK_SCOPES === 'true' ||
36
- process.env.MS365_MCP_FORCE_WORK_SCOPES === '1') {
37
- options.forceWorkScopes = true;
38
- }
39
- return options;
10
+ program.name("ms-365-mcp-server").description("Microsoft 365 MCP Server").version(version).option("-v", "Enable verbose logging").option("--login", "Login using device code flow").option("--logout", "Log out and clear saved credentials").option("--verify-login", "Verify login without starting the server").option("--list-accounts", "List all cached accounts").option("--select-account <accountId>", "Select a specific account by ID").option("--remove-account <accountId>", "Remove a specific account by ID").option("--read-only", "Start server in read-only mode, disabling write operations").option(
11
+ "--http [port]",
12
+ "Use Streamable HTTP transport instead of stdio (optionally specify port, default: 3000)"
13
+ ).option(
14
+ "--enable-auth-tools",
15
+ "Enable login/logout tools when using HTTP mode (disabled by default in HTTP mode)"
16
+ ).option(
17
+ "--enabled-tools <pattern>",
18
+ 'Filter tools using regex pattern (e.g., "excel|contact" to enable Excel and Contact tools)'
19
+ ).option(
20
+ "--force-work-scopes",
21
+ "Force inclusion of work account scopes during login (includes Teams, SharePoint, etc.)"
22
+ );
23
+ function parseArgs() {
24
+ program.parse();
25
+ const options = program.opts();
26
+ if (process.env.READ_ONLY === "true" || process.env.READ_ONLY === "1") {
27
+ options.readOnly = true;
28
+ }
29
+ if (process.env.ENABLED_TOOLS) {
30
+ options.enabledTools = process.env.ENABLED_TOOLS;
31
+ }
32
+ if (process.env.MS365_MCP_FORCE_WORK_SCOPES === "true" || process.env.MS365_MCP_FORCE_WORK_SCOPES === "1") {
33
+ options.forceWorkScopes = true;
34
+ }
35
+ return options;
40
36
  }
37
+ export {
38
+ parseArgs
39
+ };