@north7/entraaware 0.0.2 → 0.0.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.
Files changed (2) hide show
  1. package/build/index.js +13 -4
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -3,7 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
5
  import { Client } from "@microsoft/microsoft-graph-client";
6
- import { ClientSecretCredential } from "@azure/identity";
6
+ import { ClientSecretCredential, DefaultAzureCredential } from "@azure/identity";
7
7
  import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials/index.js";
8
8
  // Initialize clients
9
9
  let graphClient = null;
@@ -11,7 +11,7 @@ let azureCredential = null;
11
11
  // Create server instance
12
12
  const server = new McpServer({
13
13
  name: "EntraAware",
14
- version: "0.0.1",
14
+ version: "0.0.3",
15
15
  capabilities: {
16
16
  resources: {},
17
17
  tools: {},
@@ -29,8 +29,17 @@ function getCredentials() {
29
29
  }
30
30
  function getAzureCredential() {
31
31
  if (!azureCredential) {
32
- const { tenantId, clientId, clientSecret } = getCredentials();
33
- azureCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);
32
+ try {
33
+ // First try to create a DefaultAzureCredential that can use Azure CLI or other authentication methods
34
+ azureCredential = new DefaultAzureCredential();
35
+ console.error("Using DefaultAzureCredential - will try Azure CLI if environment variables not set");
36
+ }
37
+ catch (error) {
38
+ // Fall back to ClientSecretCredential if DefaultAzureCredential fails
39
+ console.error("DefaultAzureCredential failed, falling back to ClientSecretCredential");
40
+ const { tenantId, clientId, clientSecret } = getCredentials();
41
+ azureCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);
42
+ }
34
43
  }
35
44
  return azureCredential;
36
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north7/entraaware",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "build/index.js",
6
6
  "bin": {