@softeria/ms-365-mcp-server 0.148.1 → 0.149.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/bin/modules/generate-mcp-tools.mjs +12 -1
- package/dist/endpoints.json +18 -0
- package/dist/generated/client.js +33 -0
- package/dist/graph-tools.js +7 -1
- package/dist/lib/param-descriptions.js +4 -0
- package/dist/lib/tool-schema.js +11 -1
- package/package.json +1 -1
- package/src/endpoints.json +18 -0
|
@@ -2,6 +2,17 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Converts single-quoted `path:` strings that contain function-style OData segments with
|
|
7
|
+
* quoted parameters (e.g. `range(address=':address')`) into template literals, so the
|
|
8
|
+
* nested single quotes no longer break the generated TypeScript. A function may take
|
|
9
|
+
* several parameters, quoted or not, in any order:
|
|
10
|
+
* `getAllTranscripts(userId=':userId',startDateTime=:startDateTime)`.
|
|
11
|
+
*/
|
|
12
|
+
export function fixFunctionStylePaths(clientCode) {
|
|
13
|
+
return clientCode.replace(/(path:\s*)'(\/[^']*\([^)]*=':[\w]+'[^)]*\)[^']*)'/g, '$1`$2`');
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
export function generateMcpTools(openapiTrimmedFile, clientFilePath) {
|
|
6
17
|
try {
|
|
7
18
|
console.log(
|
|
@@ -47,7 +58,7 @@ export function generateMcpTools(openapiTrimmedFile, clientFilePath) {
|
|
|
47
58
|
// to backticks (template literal) so single quotes can remain inside.
|
|
48
59
|
// Match: path: '/...range(param=':value')...',
|
|
49
60
|
// Replace with: path: `/...range(param=':value')...`,
|
|
50
|
-
clientCode = clientCode
|
|
61
|
+
clientCode = fixFunctionStylePaths(clientCode);
|
|
51
62
|
|
|
52
63
|
// openapi-zod-client emits z.instanceof(File) for `format: binary` bodies; MCP
|
|
53
64
|
// transports JSON so no caller produces File. Body marshaller decodes the string.
|
package/dist/endpoints.json
CHANGED
|
@@ -2140,6 +2140,24 @@
|
|
|
2140
2140
|
"acceptType": "text/vtt",
|
|
2141
2141
|
"llmTip": "Returns the transcript content in WebVTT format with speaker identification and timestamps."
|
|
2142
2142
|
},
|
|
2143
|
+
{
|
|
2144
|
+
"pathPattern": "/me/adhocCalls/getAllTranscripts(userId='{userId}',startDateTime={startDateTime},endDateTime={endDateTime})",
|
|
2145
|
+
"method": "get",
|
|
2146
|
+
"toolName": "list-adhoc-call-transcripts",
|
|
2147
|
+
"presets": ["teams", "work"],
|
|
2148
|
+
"workScopes": ["CallTranscripts.Read.All"],
|
|
2149
|
+
"skipEncoding": ["startDateTime", "endDateTime"],
|
|
2150
|
+
"llmTip": "Lists transcripts of ad hoc calls (PSTN, 1:1 and group calls) started by the signed-in user. Use this for calls that have no calendar event and no online meeting, e.g. recordings named 'Anruf mit ...'. userId must be the signed-in user's object id (from get-current-user), not an email. startDateTime and endDateTime are required ISO 8601 UTC timestamps such as 2026-08-01T00:00:00Z. Each item carries callId and id (the transcript id) for get-adhoc-call-transcript-content; contentCorrelationId ends with the yyyyMMdd_HHmmss stamp that also appears in the recording file name in OneDrive. Do not use $filter, $orderby or $top."
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
"pathPattern": "/me/adhocCalls/{adhocCall-id}/transcripts/{callTranscript-id}/content",
|
|
2154
|
+
"method": "get",
|
|
2155
|
+
"toolName": "get-adhoc-call-transcript-content",
|
|
2156
|
+
"presets": ["teams", "work"],
|
|
2157
|
+
"workScopes": ["CallTranscripts.Read.All"],
|
|
2158
|
+
"acceptType": "text/vtt",
|
|
2159
|
+
"llmTip": "Returns the transcript of an ad hoc call as WebVTT with speaker tags and timestamps. Take adhocCallId (the callId) and callTranscriptId (the id) from list-adhoc-call-transcripts; copy both exactly. On 403 SpeakerAttributionNotAllowed retry with Accept set to application/vnd.microsoft.graph.transcript+text."
|
|
2160
|
+
},
|
|
2143
2161
|
{
|
|
2144
2162
|
"pathPattern": "/me/onlineMeetings/{onlineMeeting-id}/recordings",
|
|
2145
2163
|
"method": "get",
|
package/dist/generated/client.js
CHANGED
|
@@ -7696,6 +7696,39 @@ from the default calendar of a group.`,
|
|
|
7696
7696
|
],
|
|
7697
7697
|
response: z.void()
|
|
7698
7698
|
},
|
|
7699
|
+
{
|
|
7700
|
+
method: "get",
|
|
7701
|
+
path: "/me/adhocCalls/:adhocCallId/transcripts/:callTranscriptId/content",
|
|
7702
|
+
alias: "get-adhoc-call-transcript-content",
|
|
7703
|
+
description: `The content of the transcript. Read-only.`,
|
|
7704
|
+
requestFormat: "json",
|
|
7705
|
+
response: z.void()
|
|
7706
|
+
},
|
|
7707
|
+
{
|
|
7708
|
+
method: "get",
|
|
7709
|
+
path: `/me/adhocCalls/getAllTranscripts(userId=':userId',startDateTime=:startDateTime,endDateTime=:endDateTime)`,
|
|
7710
|
+
alias: "list-adhoc-call-transcripts",
|
|
7711
|
+
description: `List adhoc call transcripts.`,
|
|
7712
|
+
requestFormat: "json",
|
|
7713
|
+
parameters: [
|
|
7714
|
+
{
|
|
7715
|
+
name: "userId",
|
|
7716
|
+
type: "Path",
|
|
7717
|
+
schema: z.string().describe("Path parameter: userId")
|
|
7718
|
+
},
|
|
7719
|
+
{
|
|
7720
|
+
name: "startDateTime",
|
|
7721
|
+
type: "Path",
|
|
7722
|
+
schema: z.string().describe("Path parameter: startDateTime")
|
|
7723
|
+
},
|
|
7724
|
+
{
|
|
7725
|
+
name: "endDateTime",
|
|
7726
|
+
type: "Path",
|
|
7727
|
+
schema: z.string().describe("Path parameter: endDateTime")
|
|
7728
|
+
}
|
|
7729
|
+
],
|
|
7730
|
+
response: z.void()
|
|
7731
|
+
},
|
|
7699
7732
|
{
|
|
7700
7733
|
method: "get",
|
|
7701
7734
|
path: "/me/calendar/calendarPermissions",
|
package/dist/graph-tools.js
CHANGED
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
CONFIRM_PARAM_DESCRIPTION,
|
|
43
43
|
TIMEZONE_PARAM_DESCRIPTION,
|
|
44
44
|
EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION,
|
|
45
|
+
getAcceptParamDescription,
|
|
45
46
|
getAccountParamDescription,
|
|
46
47
|
getFetchAllPagesParamDescription
|
|
47
48
|
} from "./lib/param-descriptions.js";
|
|
@@ -968,6 +969,8 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
|
|
|
968
969
|
const encodedValue = encodeURIComponent(paramValue).replace(/%3D/g, "=");
|
|
969
970
|
path2 = path2.replace(`{${paramName}}`, encodedValue).replace(`:${paramName}`, encodedValue).replace(`{${camelCaseParamName}}`, encodedValue).replace(`:${camelCaseParamName}`, encodedValue);
|
|
970
971
|
logger.info(`Path param fallback: replaced :${camelCaseParamName} with encoded value`);
|
|
972
|
+
} else if (paramName.toLowerCase() === "accept" && config?.acceptType) {
|
|
973
|
+
headers["Accept"] = `${paramValue}`;
|
|
971
974
|
} else if (isOdataParam) {
|
|
972
975
|
queryParams[fixedParamName] = `${paramValue}`;
|
|
973
976
|
logger.info(`OData param fallback: forwarded ${fixedParamName}=${paramValue}`);
|
|
@@ -1053,7 +1056,7 @@ async function executeGraphTool(tool, config, graphClient, params, authManager)
|
|
|
1053
1056
|
headers["Content-Type"] = config.contentType;
|
|
1054
1057
|
logger.info(`Setting custom Content-Type: ${config.contentType}`);
|
|
1055
1058
|
}
|
|
1056
|
-
if (config?.acceptType) {
|
|
1059
|
+
if (config?.acceptType && !headers["Accept"]) {
|
|
1057
1060
|
headers["Accept"] = config.acceptType;
|
|
1058
1061
|
logger.info(`Setting custom Accept: ${config.acceptType}`);
|
|
1059
1062
|
}
|
|
@@ -1318,6 +1321,9 @@ function registerGraphTools(server, graphClient, readOnly = false, enabledToolsP
|
|
|
1318
1321
|
paramSchema[pathParamName] = z.string().describe(describePathParam(pathParamName));
|
|
1319
1322
|
}
|
|
1320
1323
|
}
|
|
1324
|
+
if (endpointConfig?.acceptType && paramSchema["Accept"] === void 0) {
|
|
1325
|
+
paramSchema["Accept"] = z.string().describe(getAcceptParamDescription(endpointConfig.acceptType)).optional();
|
|
1326
|
+
}
|
|
1321
1327
|
if (isFetchAllPagesApplicable(tool)) {
|
|
1322
1328
|
const maxPages = getMaxPages();
|
|
1323
1329
|
paramSchema["fetchAllPages"] = z.boolean().describe(getFetchAllPagesParamDescription(maxPages)).optional();
|
|
@@ -39,6 +39,9 @@ const COUNT_PARAM_DESCRIPTION = "Set true to enable advanced query mode (Consist
|
|
|
39
39
|
const CONFIRM_PARAM_DESCRIPTION = 'For destructive operations when the confirm gate is enabled (MS365_MCP_REQUIRE_CONFIRM=true; off by default). Set to true only after the user has explicitly approved this action. When the gate is on, calls without confirm: true return { error: "confirmation_required" } without touching user data.';
|
|
40
40
|
const TIMEZONE_PARAM_DESCRIPTION = 'IANA timezone name (e.g., "America/New_York", "Europe/London", "Asia/Tokyo") for calendar event times. If not specified, times are returned in UTC.';
|
|
41
41
|
const EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION = "When true, expands singleValueExtendedProperties on each event. Use this to retrieve custom extended properties (e.g., sync metadata) stored on calendar events.";
|
|
42
|
+
function getAcceptParamDescription(acceptType) {
|
|
43
|
+
return `Accept header for the response representation. Defaults to "${acceptType}". Only set this when Graph asks for a different format \u2014 e.g. a 403 SpeakerAttributionNotAllowed on transcript content names the media type to retry with.`;
|
|
44
|
+
}
|
|
42
45
|
function getAccountParamDescription(accountNames) {
|
|
43
46
|
const accountHint = accountNames.length > 0 ? `Known accounts: ${accountNames.join(", ")}. ` : "";
|
|
44
47
|
return `${accountHint}Microsoft account email to use for this request. Required when multiple accounts are configured. Use the list-accounts tool to discover all currently available accounts.`;
|
|
@@ -82,6 +85,7 @@ export {
|
|
|
82
85
|
TIMEZONE_PARAM_DESCRIPTION,
|
|
83
86
|
TOP_PARAM_DESCRIPTION,
|
|
84
87
|
TOP_UNSUPPORTED_DELTA_TOOLS,
|
|
88
|
+
getAcceptParamDescription,
|
|
85
89
|
getAccountParamDescription,
|
|
86
90
|
getFetchAllPagesParamDescription,
|
|
87
91
|
getMaxPages,
|
package/dist/lib/tool-schema.js
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
getAccountParamDescription,
|
|
10
10
|
CONFIRM_PARAM_DESCRIPTION,
|
|
11
11
|
TIMEZONE_PARAM_DESCRIPTION,
|
|
12
|
-
EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION
|
|
12
|
+
EXPAND_EXTENDED_PROPERTIES_PARAM_DESCRIPTION,
|
|
13
|
+
getAcceptParamDescription
|
|
13
14
|
} from "./param-descriptions.js";
|
|
14
15
|
function unwrapOptional(schema) {
|
|
15
16
|
const def = schema._def;
|
|
@@ -83,6 +84,15 @@ function describeToolSchema(tool, config, ctx = {}) {
|
|
|
83
84
|
schema: { type: "boolean" }
|
|
84
85
|
});
|
|
85
86
|
}
|
|
87
|
+
if (config?.acceptType && !params.some((p) => p.name.toLowerCase() === "accept")) {
|
|
88
|
+
params.push({
|
|
89
|
+
name: "Accept",
|
|
90
|
+
in: "Header",
|
|
91
|
+
required: false,
|
|
92
|
+
description: getAcceptParamDescription(config.acceptType),
|
|
93
|
+
schema: { type: "string" }
|
|
94
|
+
});
|
|
95
|
+
}
|
|
86
96
|
const llmTip = config?.llmTip;
|
|
87
97
|
return {
|
|
88
98
|
name: tool.alias,
|
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.
|
|
4
|
+
"version": "0.149.0",
|
|
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",
|
package/src/endpoints.json
CHANGED
|
@@ -2140,6 +2140,24 @@
|
|
|
2140
2140
|
"acceptType": "text/vtt",
|
|
2141
2141
|
"llmTip": "Returns the transcript content in WebVTT format with speaker identification and timestamps."
|
|
2142
2142
|
},
|
|
2143
|
+
{
|
|
2144
|
+
"pathPattern": "/me/adhocCalls/getAllTranscripts(userId='{userId}',startDateTime={startDateTime},endDateTime={endDateTime})",
|
|
2145
|
+
"method": "get",
|
|
2146
|
+
"toolName": "list-adhoc-call-transcripts",
|
|
2147
|
+
"presets": ["teams", "work"],
|
|
2148
|
+
"workScopes": ["CallTranscripts.Read.All"],
|
|
2149
|
+
"skipEncoding": ["startDateTime", "endDateTime"],
|
|
2150
|
+
"llmTip": "Lists transcripts of ad hoc calls (PSTN, 1:1 and group calls) started by the signed-in user. Use this for calls that have no calendar event and no online meeting, e.g. recordings named 'Anruf mit ...'. userId must be the signed-in user's object id (from get-current-user), not an email. startDateTime and endDateTime are required ISO 8601 UTC timestamps such as 2026-08-01T00:00:00Z. Each item carries callId and id (the transcript id) for get-adhoc-call-transcript-content; contentCorrelationId ends with the yyyyMMdd_HHmmss stamp that also appears in the recording file name in OneDrive. Do not use $filter, $orderby or $top."
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
"pathPattern": "/me/adhocCalls/{adhocCall-id}/transcripts/{callTranscript-id}/content",
|
|
2154
|
+
"method": "get",
|
|
2155
|
+
"toolName": "get-adhoc-call-transcript-content",
|
|
2156
|
+
"presets": ["teams", "work"],
|
|
2157
|
+
"workScopes": ["CallTranscripts.Read.All"],
|
|
2158
|
+
"acceptType": "text/vtt",
|
|
2159
|
+
"llmTip": "Returns the transcript of an ad hoc call as WebVTT with speaker tags and timestamps. Take adhocCallId (the callId) and callTranscriptId (the id) from list-adhoc-call-transcripts; copy both exactly. On 403 SpeakerAttributionNotAllowed retry with Accept set to application/vnd.microsoft.graph.transcript+text."
|
|
2160
|
+
},
|
|
2143
2161
|
{
|
|
2144
2162
|
"pathPattern": "/me/onlineMeetings/{onlineMeeting-id}/recordings",
|
|
2145
2163
|
"method": "get",
|