@softeria/ms-365-mcp-server 0.157.2 → 0.158.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 +74 -0
- package/dist/__tests__/graph-tools.test.js +407 -120
- package/dist/cli.js +13 -1
- package/dist/generated/client-beta.js +1 -0
- package/dist/generated/client.js +10 -1
- package/dist/graph-tools.js +250 -55
- package/dist/lib/attachment-tickets.js +11 -1
- package/dist/lib/select-projection.js +9 -8
- package/dist/lib/user-field-policy.js +69 -0
- package/dist/server.js +32 -43
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
import { mcpAuthRouter } from "@modelcontextprotocol/sdk/server/auth/router.js";
|
|
1
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { hostHeaderValidation } from "@modelcontextprotocol/sdk/server/middleware/hostHeaderValidation.js";
|
|
2
4
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
5
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
4
|
-
import { mcpAuthRouter } from "@modelcontextprotocol/sdk/server/auth/router.js";
|
|
5
6
|
import express from "express";
|
|
6
|
-
import helmet from "helmet";
|
|
7
7
|
import rateLimit from "express-rate-limit";
|
|
8
|
-
import
|
|
8
|
+
import helmet from "helmet";
|
|
9
|
+
import crypto from "node:crypto";
|
|
10
|
+
import { isIP, isIPv6 } from "node:net";
|
|
11
|
+
import { createAttachmentHandler } from "./attachment-route.js";
|
|
9
12
|
import { registerAuthTools } from "./auth-tools.js";
|
|
10
|
-
import { registerGraphTools, registerDiscoveryTools } from "./graph-tools.js";
|
|
11
|
-
import { buildMcpServerInstructions } from "./mcp-instructions.js";
|
|
12
|
-
import { installToolSchemaRefNormalization } from "./normalize-tool-schema.js";
|
|
13
|
-
import GraphClient from "./graph-client.js";
|
|
14
13
|
import {
|
|
15
14
|
buildScopesFromEndpoints,
|
|
16
15
|
parseAllowedScopes,
|
|
17
16
|
resolveAuthScopes
|
|
18
17
|
} from "./auth.js";
|
|
19
|
-
import {
|
|
18
|
+
import { getCloudEndpoints } from "./cloud-config.js";
|
|
19
|
+
import { dumpError } from "./crash-logging.js";
|
|
20
|
+
import GraphClient from "./graph-client.js";
|
|
21
|
+
import { registerDiscoveryTools, registerGraphTools } from "./graph-tools.js";
|
|
22
|
+
import { configureAttachmentMinting } from "./lib/attachment-minting.js";
|
|
23
|
+
import { AttachmentTicketStore } from "./lib/attachment-tickets.js";
|
|
24
|
+
import { ATTACHMENT_ROUTE, loadAttachmentUrlConfig } from "./lib/attachment-url-config.js";
|
|
20
25
|
import {
|
|
21
26
|
exchangeCodeForToken,
|
|
22
27
|
microsoftBearerTokenAuthMiddleware,
|
|
@@ -25,18 +30,13 @@ import {
|
|
|
25
30
|
toOAuthErrorResponse
|
|
26
31
|
} from "./lib/microsoft-auth.js";
|
|
27
32
|
import { isAllowedRedirectUri, parseAllowlist } from "./lib/redirect-uri-validation.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { getSecrets } from "./secrets.js";
|
|
33
|
-
import { getCloudEndpoints } from "./cloud-config.js";
|
|
34
|
-
import { requestContext } from "./request-context.js";
|
|
35
|
-
import { dumpError } from "./crash-logging.js";
|
|
36
|
-
import crypto from "node:crypto";
|
|
37
|
-
import { isIP, isIPv6 } from "node:net";
|
|
33
|
+
import logger, { enableConsoleLogging } from "./logger.js";
|
|
34
|
+
import { buildMcpServerInstructions } from "./mcp-instructions.js";
|
|
35
|
+
import { installToolSchemaRefNormalization } from "./normalize-tool-schema.js";
|
|
36
|
+
import { MicrosoftOAuthProvider } from "./oauth-provider.js";
|
|
38
37
|
import OboClient from "./obo-client.js";
|
|
39
|
-
import {
|
|
38
|
+
import { requestContext } from "./request-context.js";
|
|
39
|
+
import { getSecrets } from "./secrets.js";
|
|
40
40
|
const LOOPBACK_HOSTNAMES = ["localhost", "127.0.0.1", "[::1]"];
|
|
41
41
|
function isLoopbackHost(host) {
|
|
42
42
|
if (!host) return false;
|
|
@@ -187,32 +187,21 @@ class MicrosoftGraphServer {
|
|
|
187
187
|
if (shouldRegisterAuthTools) {
|
|
188
188
|
registerAuthTools(server, this.authManager);
|
|
189
189
|
}
|
|
190
|
+
const registrationOptions = {
|
|
191
|
+
readOnly: this.options.readOnly,
|
|
192
|
+
enabledTools: this.options.enabledTools,
|
|
193
|
+
orgMode: this.options.orgMode,
|
|
194
|
+
authManager: this.authManager,
|
|
195
|
+
multiAccount: this.multiAccount,
|
|
196
|
+
accountNames: this.accountNames,
|
|
197
|
+
allowedScopes: this.options.allowedScopes,
|
|
198
|
+
httpMode: this.hidesStdioOnlyTools(),
|
|
199
|
+
userFields: this.options.userFields
|
|
200
|
+
};
|
|
190
201
|
if (this.options.discovery) {
|
|
191
|
-
registerDiscoveryTools(
|
|
192
|
-
server,
|
|
193
|
-
this.graphClient,
|
|
194
|
-
this.options.readOnly,
|
|
195
|
-
this.options.orgMode,
|
|
196
|
-
this.authManager,
|
|
197
|
-
this.multiAccount,
|
|
198
|
-
this.accountNames,
|
|
199
|
-
this.options.enabledTools,
|
|
200
|
-
this.options.allowedScopes,
|
|
201
|
-
this.hidesStdioOnlyTools()
|
|
202
|
-
);
|
|
202
|
+
registerDiscoveryTools(server, this.graphClient, registrationOptions);
|
|
203
203
|
} else {
|
|
204
|
-
registerGraphTools(
|
|
205
|
-
server,
|
|
206
|
-
this.graphClient,
|
|
207
|
-
this.options.readOnly,
|
|
208
|
-
this.options.enabledTools,
|
|
209
|
-
this.options.orgMode,
|
|
210
|
-
this.authManager,
|
|
211
|
-
this.multiAccount,
|
|
212
|
-
this.accountNames,
|
|
213
|
-
this.options.allowedScopes,
|
|
214
|
-
this.hidesStdioOnlyTools()
|
|
215
|
-
);
|
|
204
|
+
registerGraphTools(server, this.graphClient, registrationOptions);
|
|
216
205
|
}
|
|
217
206
|
installToolSchemaRefNormalization(server);
|
|
218
207
|
return server;
|
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.158.1",
|
|
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",
|