@softeria/ms-365-mcp-server 0.180.2 → 0.180.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
@@ -553,7 +553,8 @@ With these configured, the server will use your custom Azure app instead of the
553
553
  > **Note**: `.env` is read from the directory the server is started in, and the MCP client decides what
554
554
  > that is. Only `MS365_MCP_CLIENT_ID`, `MS365_MCP_CLIENT_SECRET`, `MS365_MCP_TENANT_ID` and
555
555
  > `MS365_MCP_CLOUD_TYPE` are read from it. Every other variable listed above must be set in your shell
556
- > or MCP client config; anything else found in a `.env` is ignored with a warning on stderr.
556
+ > or MCP client config - `READ_ONLY`, `ENABLED_TOOLS` and `ENABLED_TOOLS_FILE` included, so a `.env`
557
+ > cannot restrict the tools either. Any of them found in a `.env` is ignored with a warning on stderr.
557
558
 
558
559
  #### 3. Bring Your Own Token (BYOT)
559
560
 
package/dist/load-env.js CHANGED
@@ -7,6 +7,17 @@ const ENV_FILE_ALLOWLIST = [
7
7
  "MS365_MCP_TENANT_ID",
8
8
  "MS365_MCP_CLOUD_TYPE"
9
9
  ];
10
+ const UNPREFIXED_SERVER_VARIABLES = [
11
+ "READ_ONLY",
12
+ "ENABLED_TOOLS",
13
+ "ENABLED_TOOLS_FILE",
14
+ "LOG_LEVEL",
15
+ "SILENT"
16
+ ];
17
+ const RESTRICTING_VARIABLES = ["READ_ONLY", "ENABLED_TOOLS", "ENABLED_TOOLS_FILE"];
18
+ function joinNames(names) {
19
+ return names.length < 2 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
20
+ }
10
21
  function loadEnvFile(options = {}) {
11
22
  const file = options.path ?? path.resolve(process.cwd(), ".env");
12
23
  let fromFile = {};
@@ -27,15 +38,19 @@ function loadEnvFile(options = {}) {
27
38
  process.env[key] = value;
28
39
  applied.push(key);
29
40
  }
30
- const ignoredOwn = ignored.filter((key) => key.startsWith("MS365_MCP_"));
41
+ const ignoredOwn = ignored.filter(
42
+ (key) => key.startsWith("MS365_MCP_") || UNPREFIXED_SERVER_VARIABLES.includes(key)
43
+ );
31
44
  if (ignoredOwn.length > 0) {
45
+ const restricting = ignoredOwn.filter((key) => RESTRICTING_VARIABLES.includes(key));
32
46
  console.error(
33
- `[ms365-mcp] Ignored ${ignoredOwn.length} variable(s) from .env: ${[...ignoredOwn].sort().join(", ")}. Only ${ENV_FILE_ALLOWLIST.join(", ")} are read from .env - set anything else in your shell or MCP client config.`
47
+ `[ms365-mcp] Ignored ${ignoredOwn.length} variable(s) from .env: ${[...ignoredOwn].sort().join(", ")}. Only ${ENV_FILE_ALLOWLIST.join(", ")} are read from .env - set anything else in your shell or MCP client config.` + (restricting.length === 0 ? "" : ` ${joinNames(restricting.sort())} from .env ${restricting.length === 1 ? "does" : "do"} not restrict the tools.`)
34
48
  );
35
49
  }
36
50
  return { applied, ignored };
37
51
  }
38
52
  export {
39
53
  ENV_FILE_ALLOWLIST,
54
+ UNPREFIXED_SERVER_VARIABLES,
40
55
  loadEnvFile
41
56
  };
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.2",
4
+ "version": "0.180.3",
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",