@chrischall/microsoft-teams-mcp 0.2.5 → 0.2.6

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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "MCP server for Microsoft Teams — read your chats, teams, channels, and their currently open messages",
10
- "version": "0.2.5"
10
+ "version": "0.2.6"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -15,7 +15,7 @@
15
15
  "displayName": "Microsoft Teams",
16
16
  "source": "./",
17
17
  "description": "MCP server for Microsoft Teams — read your chats, teams, channels, and their currently open messages, via your signed-in browser session",
18
- "version": "0.2.5",
18
+ "version": "0.2.6",
19
19
  "author": {
20
20
  "name": "Chris Hall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "microsoft-teams-mcp",
3
3
  "displayName": "Microsoft Teams",
4
- "version": "0.2.5",
4
+ "version": "0.2.6",
5
5
  "description": "Microsoft Teams for Claude — read your chats, teams, channels, and their currently open messages, using your signed-in browser session",
6
6
  "author": {
7
7
  "name": "Chris Hall",
package/dist/bundle.js CHANGED
@@ -24390,7 +24390,7 @@ var OAuthTokenRevocationRequestSchema = object({
24390
24390
  token_type_hint: string2().optional()
24391
24391
  }).strip();
24392
24392
 
24393
- // node_modules/@modelcontextprotocol/server/dist/src-BHSMhZ_W.mjs
24393
+ // node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs
24394
24394
  var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
24395
24395
  function stampErrorBrands(instance, ctor) {
24396
24396
  const brands = /* @__PURE__ */ new Set();
@@ -26633,7 +26633,8 @@ function build() {
26633
26633
  ListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),
26634
26634
  ReadResourceResultResponseSchema: wireResultResponse(union([ReadResourceResultSchema$1, InputRequiredResultSchema])),
26635
26635
  CompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),
26636
- DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)
26636
+ DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),
26637
+ SubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)
26637
26638
  };
26638
26639
  }
26639
26640
  var memo2;
@@ -27141,6 +27142,9 @@ function isSpecRequestMethod(method) {
27141
27142
  function isSpecNotificationMethod(method) {
27142
27143
  return ALL_CODECS.some((codec2) => codec2.hasNotificationMethod(method));
27143
27144
  }
27145
+ function isExtensionReusedRequestMethod(method) {
27146
+ return method === "tasks/get" || method === "tasks/cancel";
27147
+ }
27144
27148
  var ALL_CODECS = [rev2025Codec, rev2026Codec];
27145
27149
  function isPlainObject$3(value) {
27146
27150
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -28118,6 +28122,8 @@ var Protocol = class {
28118
28122
  _transport;
28119
28123
  _requestMessageId = 0;
28120
28124
  _requestHandlers = /* @__PURE__ */ new Map();
28125
+ /** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
28126
+ _customSchemaRequestMethods = /* @__PURE__ */ new Set();
28121
28127
  _requestHandlerAbortControllers = /* @__PURE__ */ new Map();
28122
28128
  _notificationHandlers = /* @__PURE__ */ new Map();
28123
28129
  _responseHandlers = /* @__PURE__ */ new Map();
@@ -28401,7 +28407,7 @@ var Protocol = class {
28401
28407
  return;
28402
28408
  }
28403
28409
  }
28404
- if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method)) {
28410
+ if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {
28405
28411
  sendErrorResponse(ProtocolErrorCode.MethodNotFound, "Method not found");
28406
28412
  return;
28407
28413
  }
@@ -28534,8 +28540,11 @@ var Protocol = class {
28534
28540
  }
28535
28541
  request(request, schemaOrOptions, maybeOptions) {
28536
28542
  const codec2 = this._resolveOutboundCodec(request.method);
28543
+ if (isStandardSchema(schemaOrOptions)) {
28544
+ if (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec2, request.method);
28545
+ return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
28546
+ }
28537
28547
  this._assertOutboundRequestInEra(codec2, request.method);
28538
- if (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
28539
28548
  const validate2 = codecResultValidator(codec2, request.method);
28540
28549
  if (validate2 === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);
28541
28550
  return this._requestWithSchemaViaCodec(codec2, request, validate2, schemaOrOptions);
@@ -28779,6 +28788,8 @@ var Protocol = class {
28779
28788
  return maybeHandler(parsed.data, ctx);
28780
28789
  };
28781
28790
  else throw new TypeError("setRequestHandler: handler is required");
28791
+ if (typeof schemasOrHandler === "function") this._customSchemaRequestMethods.delete(method);
28792
+ else this._customSchemaRequestMethods.add(method);
28782
28793
  this._requestHandlers.set(method, this._wrapHandler(method, stored));
28783
28794
  }
28784
28795
  /**
@@ -28808,6 +28819,7 @@ var Protocol = class {
28808
28819
  */
28809
28820
  removeRequestHandler(method) {
28810
28821
  this._requestHandlers.delete(method);
28822
+ this._customSchemaRequestMethods.delete(method);
28811
28823
  }
28812
28824
  /**
28813
28825
  * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
@@ -36050,7 +36062,7 @@ var Ajv = import_ajv.Ajv;
36050
36062
  // node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
36051
36063
  import process2 from "node:process";
36052
36064
 
36053
- // node_modules/@modelcontextprotocol/server/dist/mcp-DYuW2ZSs.mjs
36065
+ // node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs
36054
36066
  var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
36055
36067
  function isCompletable(schema) {
36056
36068
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
@@ -36115,7 +36127,7 @@ var StdioListenRouter = class {
36115
36127
  _serverCapabilities;
36116
36128
  /**
36117
36129
  * The serving instance's identity, stamped onto the graceful-close
36118
- * results' `_meta` (the spec's `SubscriptionsListenResultMeta` extends
36130
+ * results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends
36119
36131
  * `ResultMetaObject`). Handed over together with the capabilities.
36120
36132
  */
36121
36133
  _serverInfo;
@@ -36447,6 +36459,11 @@ var Server = class extends Protocol {
36447
36459
  if (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
36448
36460
  if (this._capabilities.logging) this._registerLoggingHandler();
36449
36461
  }
36462
+ /** Attaches to the given transport; rejects while this instance is connected to another one. */
36463
+ async connect(transport) {
36464
+ if (this.transport !== void 0) throw new SdkError(SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
36465
+ await super.connect(transport);
36466
+ }
36450
36467
  /**
36451
36468
  * Registers the built-in `logging/setLevel` request handler.
36452
36469
  *
@@ -37000,21 +37017,41 @@ var Server = class extends Protocol {
37000
37017
  function discoverAdvertisedCapabilities(capabilities) {
37001
37018
  return { ...capabilities };
37002
37019
  }
37020
+ function toolInputElementCount(value, max) {
37021
+ let count = 0;
37022
+ const stack = [value];
37023
+ while (stack.length > 0) {
37024
+ const node2 = stack.pop();
37025
+ if (node2 === null || typeof node2 !== "object") continue;
37026
+ if (Array.isArray(node2)) for (const child of node2) {
37027
+ if (++count > max) return count;
37028
+ if (child !== null && typeof child === "object") stack.push(child);
37029
+ }
37030
+ else for (const key in node2) {
37031
+ if (!Object.prototype.hasOwnProperty.call(node2, key)) continue;
37032
+ if (++count > max) return count;
37033
+ const child = node2[key];
37034
+ if (child !== null && typeof child === "object") stack.push(child);
37035
+ }
37036
+ }
37037
+ return count;
37038
+ }
37039
+ function resolveMaxToolInputElements(value) {
37040
+ if (value === void 0 || value === Infinity) return void 0;
37041
+ if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
37042
+ return value;
37043
+ }
37003
37044
  var McpServer = class {
37004
37045
  /**
37005
37046
  * The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
37006
37047
  */
37007
37048
  server;
37049
+ _maxToolInputElements;
37008
37050
  _registeredResources = {};
37009
37051
  _registeredResourceTemplates = {};
37010
37052
  _registeredTools = {};
37011
37053
  _registeredPrompts = {};
37012
- /**
37013
- * Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
37014
- * registration-time scan and the pre-dispatch validation step share one
37015
- * conversion instead of paying it twice per request under the
37016
- * per-request-factory `createMcpHandler` model.
37017
- */
37054
+ /** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
37018
37055
  _toolInputSchemaJson = {};
37019
37056
  /**
37020
37057
  * The JSON-serialized `inputSchema` of a registered tool, or `undefined`
@@ -37039,6 +37076,7 @@ var McpServer = class {
37039
37076
  }
37040
37077
  constructor(serverInfo, options) {
37041
37078
  this.server = new Server(serverInfo, options);
37079
+ this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
37042
37080
  if (options?.capabilities?.tools) this.setToolRequestHandlers();
37043
37081
  if (options?.capabilities?.resources) this.setResourceRequestHandlers();
37044
37082
  if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
@@ -37111,7 +37149,7 @@ var McpServer = class {
37111
37149
  name,
37112
37150
  title: tool.title,
37113
37151
  description: tool.description,
37114
- inputSchema: tool.inputSchema ? standardSchemaToJsonSchema(tool.inputSchema, "input") : EMPTY_OBJECT_JSON_SCHEMA,
37152
+ inputSchema: tool.inputSchema ? convertListedInputSchema(name, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
37115
37153
  annotations: tool.annotations,
37116
37154
  icons: tool.icons,
37117
37155
  execution: tool.execution,
@@ -37156,6 +37194,7 @@ var McpServer = class {
37156
37194
  * Validates tool input arguments against the tool's input schema.
37157
37195
  */
37158
37196
  async validateToolInput(tool, args, toolName) {
37197
+ if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
37159
37198
  if (!tool.inputSchema) return;
37160
37199
  const parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});
37161
37200
  if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
@@ -37430,20 +37469,19 @@ var McpServer = class {
37430
37469
  }
37431
37470
  _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
37432
37471
  validateAndWarnToolName(name);
37433
- if (inputSchema !== void 0) try {
37434
- const json2 = standardSchemaToJsonSchema(inputSchema, "input");
37435
- this._toolInputSchemaJson[name] = json2;
37436
- const scan = scanXMcpHeaderDeclarations(json2);
37437
- if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
37438
- } catch {
37439
- }
37440
37472
  let currentHandler = handler;
37473
+ let outputSchemaJson;
37441
37474
  const registeredTool = {
37442
37475
  title,
37443
37476
  description,
37444
37477
  inputSchema,
37445
37478
  outputSchema,
37446
- outputSchemaJson: convertOutputSchemaJson(outputSchema),
37479
+ get outputSchemaJson() {
37480
+ return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
37481
+ },
37482
+ set outputSchemaJson(value) {
37483
+ outputSchemaJson = value;
37484
+ },
37447
37485
  annotations,
37448
37486
  icons,
37449
37487
  execution,
@@ -37570,6 +37608,12 @@ var EMPTY_OBJECT_JSON_SCHEMA = {
37570
37608
  type: "object",
37571
37609
  properties: {}
37572
37610
  };
37611
+ function convertListedInputSchema(name, inputSchema) {
37612
+ const json2 = standardSchemaToJsonSchema(inputSchema, "input");
37613
+ const scan = scanXMcpHeaderDeclarations(json2);
37614
+ if (!scan.valid) console.warn(`[mcp-sdk] tool '${name}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
37615
+ return json2;
37616
+ }
37573
37617
  function convertOutputSchemaJson(outputSchema) {
37574
37618
  if (outputSchema === void 0) return void 0;
37575
37619
  try {
@@ -37582,7 +37626,7 @@ function createPromptHandler(name, argsSchema, callback) {
37582
37626
  if (argsSchema) {
37583
37627
  const typedCallback = callback;
37584
37628
  return async (args, ctx) => {
37585
- const parseResult = await validateStandardSchema(argsSchema, args);
37629
+ const parseResult = await validateStandardSchema(argsSchema, args ?? {});
37586
37630
  if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name}: ${parseResult.error}`);
37587
37631
  return typedCallback(parseResult.data, ctx);
37588
37632
  };
@@ -38396,7 +38440,10 @@ function surfaceToolHints(server) {
38396
38440
  ));
38397
38441
  }
38398
38442
  async function createMcpServer(opts) {
38399
- const server = new McpServer({ name: opts.name, version: opts.version }, { supportedProtocolVersions: [...SERVER_PROTOCOL_VERSIONS] });
38443
+ const server = new McpServer({ name: opts.name, version: opts.version }, {
38444
+ supportedProtocolVersions: [...SERVER_PROTOCOL_VERSIONS],
38445
+ ...opts.maxToolInputElements !== void 0 ? { maxToolInputElements: opts.maxToolInputElements } : {}
38446
+ });
38400
38447
  if (opts.surfaceHints !== false)
38401
38448
  surfaceToolHints(server);
38402
38449
  if (opts.banner !== void 0) {
@@ -38620,7 +38667,7 @@ function toolAnnotations(opts = {}) {
38620
38667
 
38621
38668
  // src/version.ts
38622
38669
  var PACKAGE_NAME = "microsoft-teams-mcp";
38623
- var VERSION = "0.2.5";
38670
+ var VERSION = "0.2.6";
38624
38671
 
38625
38672
  // node_modules/@fetchproxy/protocol/dist/crypto.js
38626
38673
  var subtle = globalThis.crypto.subtle;
@@ -45148,7 +45195,7 @@ await runMcp({
45148
45195
  });
45149
45196
  /*! Bundled license information:
45150
45197
 
45151
- @modelcontextprotocol/server/dist/src-BHSMhZ_W.mjs:
45198
+ @modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs:
45152
45199
  (*!
45153
45200
  * content-type
45154
45201
  * Copyright(c) 2015 Douglas Christopher Wilson
package/dist/version.js CHANGED
@@ -10,4 +10,4 @@
10
10
  * line below and nowhere else — not even in prose.
11
11
  */
12
12
  export const PACKAGE_NAME = 'microsoft-teams-mcp';
13
- export const VERSION = '0.2.5'; // x-release-please-version
13
+ export const VERSION = '0.2.6'; // x-release-please-version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/microsoft-teams-mcp",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "mcpName": "io.github.chrischall/microsoft-teams-mcp",
5
5
  "description": "Microsoft Teams MCP server for Claude — developed and maintained by AI (Claude Code)",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -45,15 +45,15 @@
45
45
  "typecheck": "tsc -p tsconfig.check.json"
46
46
  },
47
47
  "dependencies": {
48
- "@chrischall/mcp-utils": "^2.13.0",
48
+ "@chrischall/mcp-utils": "^2.14.0",
49
49
  "@fetchproxy/protocol": "^3.4.1",
50
50
  "@fetchproxy/server": "^3.4.1",
51
- "@modelcontextprotocol/server": "^2.2.0",
51
+ "@modelcontextprotocol/server": "^2.3.0",
52
52
  "dotenv": "^18.0.1",
53
53
  "zod": "^4.6.5"
54
54
  },
55
55
  "devDependencies": {
56
- "@modelcontextprotocol/client": "^2.2.0",
56
+ "@modelcontextprotocol/client": "^2.3.0",
57
57
  "@types/node": "^26.0.0",
58
58
  "@vitest/coverage-v8": "^5.0.0",
59
59
  "esbuild": "^0.28.1",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/microsoft-teams-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.2.5",
9
+ "version": "0.2.6",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/microsoft-teams-mcp",
14
- "version": "0.2.5",
14
+ "version": "0.2.6",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },