@softeria/ms-365-mcp-server 0.13.0 → 0.13.2

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/.releaserc.json CHANGED
@@ -3,10 +3,7 @@
3
3
  "plugins": [
4
4
  "@semantic-release/commit-analyzer",
5
5
  "@semantic-release/release-notes-generator",
6
- ["@semantic-release/exec", {
7
- "prepareCmd": "npm run build"
8
- }],
9
6
  "@semantic-release/npm",
10
7
  "@semantic-release/github"
11
8
  ]
12
- }
9
+ }
package/README.md CHANGED
@@ -77,11 +77,7 @@ To access work/school features (Teams, SharePoint, etc.), enable organization mo
77
77
  "mcpServers": {
78
78
  "ms365": {
79
79
  "command": "npx",
80
- "args": [
81
- "-y",
82
- "@softeria/ms-365-mcp-server",
83
- "--org-mode"
84
- ]
80
+ "args": ["-y", "@softeria/ms-365-mcp-server", "--org-mode"]
85
81
  }
86
82
  }
87
83
  }
@@ -113,10 +109,7 @@ Edit the config file under Settings > Developer:
113
109
  "mcpServers": {
114
110
  "ms365": {
115
111
  "command": "npx",
116
- "args": [
117
- "-y",
118
- "@softeria/ms-365-mcp-server"
119
- ]
112
+ "args": ["-y", "@softeria/ms-365-mcp-server"]
120
113
  }
121
114
  }
122
115
  }
@@ -142,9 +135,9 @@ The server supports three authentication methods:
142
135
  For interactive authentication via device code:
143
136
 
144
137
  - **MCP client login**:
145
- - Call the `login` tool (auto-checks existing token)
146
- - If needed, get URL+code, visit in browser
147
- - Use `verify-login` tool to confirm
138
+ - Call the `login` tool (auto-checks existing token)
139
+ - If needed, get URL+code, visit in browser
140
+ - Use `verify-login` tool to confirm
148
141
  - **CLI login**:
149
142
  ```bash
150
143
  npx @softeria/ms-365-mcp-server --login
@@ -177,21 +170,24 @@ To use OAuth mode with custom Azure credentials (recommended for production), yo
177
170
  registration:
178
171
 
179
172
  1. **Create Azure AD App Registration**:
180
- - Go to [Azure Portal](https://portal.azure.com)
181
- - Navigate to Azure Active Directory → App registrations → New registration
182
- - Set name: "MS365 MCP Server"
183
173
 
184
- 2. **Configure Redirect URIs**:
185
- Add these redirect URIs for testing with MCP Inspector:
186
- - `http://localhost:6274/oauth/callback`
187
- - `http://localhost:6274/oauth/callback/debug`
188
- - `http://localhost:3000/callback` (optional, for server callback)
174
+ - Go to [Azure Portal](https://portal.azure.com)
175
+ - Navigate to Azure Active Directory App registrations → New registration
176
+ - Set name: "MS365 MCP Server"
189
177
 
190
- 3. **Get Credentials**:
191
- - Copy the **Application (client) ID** from Overview page
192
- - Go to Certificates & secrets → New client secret → Copy the secret value
178
+ 1. **Configure Redirect URIs**:
179
+ Add these redirect URIs for testing with MCP Inspector (`npm run inspector`):
193
180
 
194
- 4. **Configure Environment Variables**:
181
+ - `http://localhost:6274/oauth/callback`
182
+ - `http://localhost:6274/oauth/callback/debug`
183
+ - `http://localhost:3000/callback` (optional, for server callback)
184
+
185
+ 1. **Get Credentials**:
186
+
187
+ - Copy the **Application (client) ID** from Overview page
188
+ - Go to Certificates & secrets → New client secret → Copy the secret value
189
+
190
+ 1. **Configure Environment Variables**:
195
191
  Create a `.env` file in your project root:
196
192
  ```env
197
193
  MS365_MCP_CLIENT_ID=your-azure-ad-app-client-id-here
@@ -213,7 +209,7 @@ MS365_MCP_OAUTH_TOKEN=your_oauth_token npx @softeria/ms-365-mcp-server
213
209
  This method:
214
210
 
215
211
  - Bypasses the interactive authentication flows
216
- - Uses your pre-existing OAuth token for Microsoft Graph API requests
212
+ - Use your pre-existing OAuth token for Microsoft Graph API requests
217
213
  - Does not handle token refresh (token lifecycle management is your responsibility)
218
214
 
219
215
  > **Note**: HTTP mode requires authentication. For unauthenticated testing, use stdio mode with device code flow.
@@ -250,7 +246,7 @@ When running as an MCP server, the following options can be used:
250
246
  Environment variables:
251
247
 
252
248
  - `READ_ONLY=true|1`: Alternative to --read-only flag
253
- - `ENABLED_TOOLS`: Filter tools using regex pattern (alternative to --enabled-tools flag)
249
+ - `ENABLED_TOOLS`: Filter tools using a regex pattern (alternative to --enabled-tools flag)
254
250
  - `MS365_MCP_ORG_MODE=true|1`: Enable organization/work mode (alternative to --org-mode flag)
255
251
  - `MS365_MCP_FORCE_WORK_SCOPES=true|1`: Backwards compatibility for MS365_MCP_ORG_MODE
256
252
  - `LOG_LEVEL`: Set logging level (default: 'info')
@@ -259,6 +255,16 @@ Environment variables:
259
255
  - `MS365_MCP_TENANT_ID`: Custom tenant ID (defaults to 'common' for multi-tenant)
260
256
  - `MS365_MCP_OAUTH_TOKEN`: Pre-existing OAuth token for Microsoft Graph API (BYOT method)
261
257
 
258
+ ## Contributing
259
+
260
+ We welcome contributions! Before submitting a pull request, please ensure your changes meet our quality standards.
261
+
262
+ Run the verification script to check all code quality requirements:
263
+
264
+ ```bash
265
+ npm run verify
266
+ ```
267
+
262
268
  ## Support
263
269
 
264
270
  If you're having problems or need help:
@@ -24,8 +24,8 @@ function registerAuthTools(server, authManager) {
24
24
  };
25
25
  }
26
26
  }
27
- const text = await new Promise((r) => {
28
- authManager.acquireTokenByDeviceCode(r);
27
+ const text = await new Promise((resolve, reject) => {
28
+ authManager.acquireTokenByDeviceCode(resolve).catch(reject);
29
29
  });
30
30
  return {
31
31
  content: [
@@ -0,0 +1,43 @@
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ import tseslint from '@typescript-eslint/eslint-plugin';
4
+ import tsparser from '@typescript-eslint/parser';
5
+
6
+ export default [
7
+ js.configs.recommended,
8
+ {
9
+ files: ['**/*.{ts,tsx,js,mjs}'],
10
+ languageOptions: {
11
+ parser: tsparser,
12
+ parserOptions: {
13
+ ecmaVersion: 2022,
14
+ sourceType: 'module',
15
+ },
16
+ globals: {
17
+ ...globals.node,
18
+ ...globals.vitest,
19
+ ...globals.jest,
20
+ fs: 'readonly',
21
+ },
22
+ },
23
+ plugins: {
24
+ '@typescript-eslint': tseslint,
25
+ },
26
+ rules: {
27
+ ...tseslint.configs.recommended.rules,
28
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
29
+ '@typescript-eslint/no-explicit-any': 'warn',
30
+ 'no-console': 'off',
31
+ },
32
+ },
33
+ {
34
+ ignores: [
35
+ 'node_modules/**',
36
+ 'dist/**',
37
+ 'coverage/**',
38
+ 'bin/**',
39
+ 'src/generated/**',
40
+ '.venv/**',
41
+ ],
42
+ },
43
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softeria/ms-365-mcp-server",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Microsoft 365 MCP Server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,15 +9,18 @@
9
9
  },
10
10
  "scripts": {
11
11
  "generate": "node bin/generate-graph-client.mjs",
12
- "prebuild": "npm run generate",
12
+ "postinstall": "npm run generate",
13
13
  "build": "tsup",
14
14
  "test": "vitest run",
15
15
  "test:watch": "vitest",
16
16
  "dev": "tsx src/index.ts",
17
17
  "dev:http": "tsx --watch src/index.ts --http 3000 -v",
18
18
  "format": "prettier --write \"**/*.{ts,mts,js,mjs,json,md}\"",
19
- "inspect": "npx @modelcontextprotocol/inspector tsx src/index.ts",
20
- "prepublishOnly": "npm run build"
19
+ "format:check": "prettier --check \"**/*.{ts,mts,js,mjs,json,md}\"",
20
+ "lint": "eslint .",
21
+ "lint:fix": "eslint . --fix",
22
+ "verify": "npm run lint && npm run format:check && npm run build && npm run test",
23
+ "inspector": "npx @modelcontextprotocol/inspector tsx src/index.ts"
21
24
  },
22
25
  "keywords": [
23
26
  "microsoft",
@@ -49,6 +52,10 @@
49
52
  "@semantic-release/npm": "^12.0.2",
50
53
  "@types/express": "^5.0.3",
51
54
  "@types/node": "^22.15.15",
55
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
56
+ "@typescript-eslint/parser": "^8.38.0",
57
+ "eslint": "^9.31.0",
58
+ "globals": "^16.3.0",
52
59
  "prettier": "^3.5.3",
53
60
  "semantic-release": "^24.2.7",
54
61
  "tsup": "^8.5.0",