@softeria/ms-365-mcp-server 0.27.0 → 0.27.1
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 +2 -2
- package/dist/generated/client.js +1 -1
- package/dist/lib/microsoft-auth.js +13 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -308,13 +308,13 @@ registration:
|
|
|
308
308
|
4. **Get Credentials**:
|
|
309
309
|
|
|
310
310
|
- Copy the **Application (client) ID** from Overview page
|
|
311
|
-
- Go to Certificates & secrets → New client secret → Copy the secret value
|
|
311
|
+
- Go to Certificates & secrets → New client secret → Copy the secret value (optional for public apps)
|
|
312
312
|
|
|
313
313
|
5. **Configure Environment Variables**:
|
|
314
314
|
Create a `.env` file in your project root:
|
|
315
315
|
```env
|
|
316
316
|
MS365_MCP_CLIENT_ID=your-azure-ad-app-client-id-here
|
|
317
|
-
MS365_MCP_CLIENT_SECRET=your-
|
|
317
|
+
MS365_MCP_CLIENT_SECRET=your-secret-here # Optional for public apps
|
|
318
318
|
MS365_MCP_TENANT_ID=common
|
|
319
319
|
```
|
|
320
320
|
|
package/dist/generated/client.js
CHANGED
|
@@ -3041,7 +3041,7 @@ const microsoft_graph_searchRequest = z.object({
|
|
|
3041
3041
|
"This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional."
|
|
3042
3042
|
).nullish(),
|
|
3043
3043
|
entityTypes: z.array(z.union([microsoft_graph_entityType, z.object({}).partial().strict()])).describe(
|
|
3044
|
-
"One or more types of resources expected in the response. Possible values are: event, message, driveItem, externalItem, site, list, listItem, drive, chatMessage, person, acronym, bookmark. Use the Prefer: include-unknown-enum-members request header to get the following
|
|
3044
|
+
"One or more types of resources expected in the response. Possible values are: event, message, driveItem, externalItem, site, list, listItem, drive, chatMessage, person, acronym, bookmark. Use the Prefer: include-unknown-enum-members request header to get the following members in this evolvable enum: chatMessage, person, acronym, bookmark. See known limitations for those combinations of two or more entity types that are supported in the same search request. Required."
|
|
3045
3045
|
).optional(),
|
|
3046
3046
|
fields: z.array(z.string().nullable()).describe(
|
|
3047
3047
|
"Contains the fields to be returned for each resource object specified in entityTypes, allowing customization of the fields returned by default; otherwise, including additional fields such as custom managed properties from SharePoint and OneDrive, or custom fields in externalItem from the content that Microsoft 365 Copilot connectors bring in. The fields property can use the semantic labels applied to properties. For example, if a property is labeled as title, you can retrieve it using the following syntax: label_title. Optional."
|
|
@@ -18,9 +18,11 @@ async function exchangeCodeForToken(code, redirectUri, clientId, clientSecret, t
|
|
|
18
18
|
grant_type: "authorization_code",
|
|
19
19
|
code,
|
|
20
20
|
redirect_uri: redirectUri,
|
|
21
|
-
client_id: clientId
|
|
22
|
-
client_secret: clientSecret
|
|
21
|
+
client_id: clientId
|
|
23
22
|
});
|
|
23
|
+
if (clientSecret) {
|
|
24
|
+
params.append("client_secret", clientSecret);
|
|
25
|
+
}
|
|
24
26
|
if (codeVerifier) {
|
|
25
27
|
params.append("code_verifier", codeVerifier);
|
|
26
28
|
}
|
|
@@ -39,17 +41,20 @@ async function exchangeCodeForToken(code, redirectUri, clientId, clientSecret, t
|
|
|
39
41
|
return response.json();
|
|
40
42
|
}
|
|
41
43
|
async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId = "common") {
|
|
44
|
+
const params = new URLSearchParams({
|
|
45
|
+
grant_type: "refresh_token",
|
|
46
|
+
refresh_token: refreshToken,
|
|
47
|
+
client_id: clientId
|
|
48
|
+
});
|
|
49
|
+
if (clientSecret) {
|
|
50
|
+
params.append("client_secret", clientSecret);
|
|
51
|
+
}
|
|
42
52
|
const response = await fetch(`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`, {
|
|
43
53
|
method: "POST",
|
|
44
54
|
headers: {
|
|
45
55
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
46
56
|
},
|
|
47
|
-
body:
|
|
48
|
-
grant_type: "refresh_token",
|
|
49
|
-
refresh_token: refreshToken,
|
|
50
|
-
client_id: clientId,
|
|
51
|
-
client_secret: clientSecret
|
|
52
|
-
})
|
|
57
|
+
body: params
|
|
53
58
|
});
|
|
54
59
|
if (!response.ok) {
|
|
55
60
|
const error = await response.text();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softeria/ms-365-mcp-server",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|