@chrischall/microsoft-teams-mcp 0.2.6 → 0.2.7

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.6"
10
+ "version": "0.2.7"
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.6",
18
+ "version": "0.2.7",
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.6",
4
+ "version": "0.2.7",
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
@@ -2335,11 +2335,23 @@ var require_websocket = __commonJS({
2335
2335
  this._isServer = false;
2336
2336
  this._redirects = 0;
2337
2337
  if (protocols === void 0) {
2338
- protocols = [];
2338
+ if (!options || options.protocols === void 0) {
2339
+ protocols = [];
2340
+ } else if (Array.isArray(options.protocols)) {
2341
+ protocols = options.protocols;
2342
+ } else {
2343
+ protocols = [options.protocols];
2344
+ }
2339
2345
  } else if (!Array.isArray(protocols)) {
2340
2346
  if (typeof protocols === "object" && protocols !== null) {
2341
2347
  options = protocols;
2342
- protocols = [];
2348
+ if (options.protocols === void 0) {
2349
+ protocols = [];
2350
+ } else if (Array.isArray(options.protocols)) {
2351
+ protocols = options.protocols;
2352
+ } else {
2353
+ protocols = [options.protocols];
2354
+ }
2343
2355
  } else {
2344
2356
  protocols = [protocols];
2345
2357
  }
@@ -2536,7 +2548,6 @@ var require_websocket = __commonJS({
2536
2548
  }
2537
2549
  return;
2538
2550
  }
2539
- this._readyState = _WebSocket.CLOSING;
2540
2551
  this._sender.close(code, data, !this._isServer, (err) => {
2541
2552
  if (err) return;
2542
2553
  this._closeFrameSent = true;
@@ -2544,6 +2555,7 @@ var require_websocket = __commonJS({
2544
2555
  this._socket.end();
2545
2556
  }
2546
2557
  });
2558
+ this._readyState = _WebSocket.CLOSING;
2547
2559
  setCloseTimer(this);
2548
2560
  }
2549
2561
  /**
@@ -2768,6 +2780,7 @@ var require_websocket = __commonJS({
2768
2780
  socketPath: void 0,
2769
2781
  hostname: void 0,
2770
2782
  protocol: void 0,
2783
+ protocols: void 0,
2771
2784
  timeout: void 0,
2772
2785
  method: "GET",
2773
2786
  host: void 0,
@@ -21514,8 +21527,8 @@ function currencyCode2(_params) {
21514
21527
  return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
21515
21528
  }
21516
21529
  function hash(alg, params) {
21517
- const enc6 = params?.enc ?? "hex";
21518
- const format = `${alg}_${enc6}`;
21530
+ const enc7 = params?.enc ?? "hex";
21531
+ const format = `${alg}_${enc7}`;
21519
21532
  const regex = regexes_exports[format];
21520
21533
  if (!regex)
21521
21534
  throw new Error(`Unrecognized hash format: ${format}`);
@@ -38667,7 +38680,7 @@ function toolAnnotations(opts = {}) {
38667
38680
 
38668
38681
  // src/version.ts
38669
38682
  var PACKAGE_NAME = "microsoft-teams-mcp";
38670
- var VERSION = "0.2.6";
38683
+ var VERSION = "0.2.7";
38671
38684
 
38672
38685
  // node_modules/@fetchproxy/protocol/dist/crypto.js
38673
38686
  var subtle = globalThis.crypto.subtle;
@@ -38871,6 +38884,60 @@ var KNOWN_CAPABILITIES = /* @__PURE__ */ new Set([
38871
38884
  "graphql",
38872
38885
  "write_cookies"
38873
38886
  ]);
38887
+ var ACCOUNT_KEY_FRAME = "account-key";
38888
+ var ACCOUNT_ATTEST_FRAME = "account-attest";
38889
+ var BRIDGE_ROLE_FRAME = "bridge-role";
38890
+ var BRIDGE_SERVE_FRAME = "bridge-serve";
38891
+ var ROOM_PING_FRAME = "room-ping";
38892
+ var ROOM_PONG_FRAME = "room-pong";
38893
+ var BRIDGE_ROLE_LABEL_MAX = 64;
38894
+ var ROOM_FRAME_ACCEPTS = Object.freeze({
38895
+ [BRIDGE_ROLE_FRAME]: BRIDGE_ROLE_FRAME,
38896
+ [BRIDGE_SERVE_FRAME]: BRIDGE_SERVE_FRAME,
38897
+ [ROOM_PING_FRAME]: ROOM_PING_FRAME,
38898
+ [ROOM_PONG_FRAME]: ROOM_PING_FRAME
38899
+ });
38900
+
38901
+ // node_modules/@fetchproxy/protocol/dist/mcp-id.js
38902
+ var ID_RE = /^([^:]+):([^:]+):([0-9a-f]{16})$/;
38903
+ function generateMcpId(serverName, version2) {
38904
+ if (serverName.includes(":")) {
38905
+ throw new Error(`serverName cannot contain ':': ${serverName}`);
38906
+ }
38907
+ if (version2.includes(":")) {
38908
+ throw new Error(`version cannot contain ':': ${version2}`);
38909
+ }
38910
+ const rand = randomHex(8);
38911
+ return `${serverName}:${version2}:${rand}`;
38912
+ }
38913
+ function isValidMcpId(id) {
38914
+ return typeof id === "string" && ID_RE.test(id);
38915
+ }
38916
+ function randomHex(bytes) {
38917
+ const arr = new Uint8Array(bytes);
38918
+ globalThis.crypto.getRandomValues(arr);
38919
+ return Array.from(arr, (b) => b.toString(16).padStart(2, "0")).join("");
38920
+ }
38921
+
38922
+ // node_modules/@fetchproxy/protocol/dist/account-attest.js
38923
+ var ACCOUNT_ATTEST_CONSENTS = Object.freeze([
38924
+ "silent",
38925
+ "confirm",
38926
+ "confirm-each"
38927
+ ]);
38928
+ var NO_SCOPE_DIGEST = "0".repeat(64);
38929
+ var ACCOUNT_ID_RE = /^[A-Za-z0-9_.\-]{1,128}$/;
38930
+ var HEX64_RE = /^[0-9a-f]{64}$/;
38931
+ var ACCOUNT_KID_RE = /^[0-9a-f]{16}$/;
38932
+ var enc2 = new TextEncoder();
38933
+
38934
+ // node_modules/@fetchproxy/protocol/dist/awaiting-approval.js
38935
+ var AWAITING_APPROVAL_REASON_PREFIX = "awaiting-approval:";
38936
+ function parseAwaitingApprovalReason(reason) {
38937
+ if (!reason.startsWith(AWAITING_APPROVAL_REASON_PREFIX))
38938
+ return null;
38939
+ return reason.slice(AWAITING_APPROVAL_REASON_PREFIX.length).trim();
38940
+ }
38874
38941
 
38875
38942
  // node_modules/@fetchproxy/protocol/dist/capability-availability.js
38876
38943
  var CAPABILITY_UNAVAILABLE_CODE = "capability_unavailable";
@@ -38896,27 +38963,6 @@ function parseUnsupportedCapabilityReason(reason) {
38896
38963
  return rest.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
38897
38964
  }
38898
38965
 
38899
- // node_modules/@fetchproxy/protocol/dist/mcp-id.js
38900
- var ID_RE = /^([^:]+):([^:]+):([0-9a-f]{16})$/;
38901
- function generateMcpId(serverName, version2) {
38902
- if (serverName.includes(":")) {
38903
- throw new Error(`serverName cannot contain ':': ${serverName}`);
38904
- }
38905
- if (version2.includes(":")) {
38906
- throw new Error(`version cannot contain ':': ${version2}`);
38907
- }
38908
- const rand = randomHex(8);
38909
- return `${serverName}:${version2}:${rand}`;
38910
- }
38911
- function isValidMcpId(id) {
38912
- return typeof id === "string" && ID_RE.test(id);
38913
- }
38914
- function randomHex(bytes) {
38915
- const arr = new Uint8Array(bytes);
38916
- globalThis.crypto.getRandomValues(arr);
38917
- return Array.from(arr, (b) => b.toString(16).padStart(2, "0")).join("");
38918
- }
38919
-
38920
38966
  // node_modules/@fetchproxy/protocol/dist/json-pointer.js
38921
38967
  function matchesDeclaredKey(requested, declared) {
38922
38968
  for (const decl of declared) {
@@ -39512,6 +39558,16 @@ function validateFrame(raw) {
39512
39558
  return { type: "extension-disconnected" };
39513
39559
  if (t === "peer-gone")
39514
39560
  return validatePeerGone(raw);
39561
+ if (t === ACCOUNT_KEY_FRAME)
39562
+ return validateAccountKey(raw);
39563
+ if (t === ACCOUNT_ATTEST_FRAME)
39564
+ return validateAccountAttest(raw);
39565
+ if (t === BRIDGE_ROLE_FRAME)
39566
+ return validateBridgeRole(raw);
39567
+ if (t === BRIDGE_SERVE_FRAME || t === ROOM_PING_FRAME || t === ROOM_PONG_FRAME) {
39568
+ assertExactFields(raw, TYPE_ONLY_FIELDS, t);
39569
+ return { type: t };
39570
+ }
39515
39571
  throw new ProtocolError3(`unknown frame type: ${String(t)}`);
39516
39572
  }
39517
39573
  function validateHello(raw) {
@@ -39715,6 +39771,165 @@ function validateHelloRejected(raw) {
39715
39771
  }
39716
39772
  return { type: "hello-rejected", mcpId: raw.mcpId, reason: raw.reason };
39717
39773
  }
39774
+ var DISPLAY_FORBIDDEN_RE = /[\u0000-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/;
39775
+ function assertExactFields(raw, allowed, label) {
39776
+ for (const k of Object.keys(raw)) {
39777
+ if (!allowed.includes(k)) {
39778
+ throw new ProtocolError3(`${label}: unexpected field ${JSON.stringify(k)}`);
39779
+ }
39780
+ }
39781
+ }
39782
+ function assertMatch(x, re, label, what) {
39783
+ assertString(x, label);
39784
+ if (!re.test(x))
39785
+ throw new ProtocolError3(`${label}: must be ${what}`);
39786
+ }
39787
+ function assertPositiveSafeInt(x, label) {
39788
+ if (typeof x !== "number" || !Number.isSafeInteger(x) || x <= 0) {
39789
+ throw new ProtocolError3(`${label}: expected positive safe integer`);
39790
+ }
39791
+ }
39792
+ function assertDisplayString(x, label, min, max) {
39793
+ assertString(x, label);
39794
+ if (x.length < min || x.length > max) {
39795
+ throw new ProtocolError3(`${label}: must be ${min}-${max} characters`);
39796
+ }
39797
+ if (DISPLAY_FORBIDDEN_RE.test(x)) {
39798
+ throw new ProtocolError3(`${label}: control or bidi-override character`);
39799
+ }
39800
+ }
39801
+ var ACCOUNT_KEY_FIELDS = [
39802
+ "type",
39803
+ "accountId",
39804
+ "slug",
39805
+ "displayName",
39806
+ "confirmedBy",
39807
+ "tokenId",
39808
+ "kid",
39809
+ "publicKey",
39810
+ "generation",
39811
+ "bridgedRegistrations"
39812
+ ];
39813
+ function validateAccountKey(raw) {
39814
+ const L = "account-key";
39815
+ assertMatch(raw.accountId, ACCOUNT_ID_RE, `${L}.accountId`, "an account id");
39816
+ assertMatch(raw.slug, ACCOUNT_ID_RE, `${L}.slug`, "a slug");
39817
+ assertDisplayString(raw.displayName, `${L}.displayName`, 0, 128);
39818
+ assertDisplayString(raw.confirmedBy, `${L}.confirmedBy`, 1, 256);
39819
+ assertMatch(raw.tokenId, ACCOUNT_ID_RE, `${L}.tokenId`, "a token id");
39820
+ assertMatch(raw.kid, ACCOUNT_KID_RE, `${L}.kid`, "16 lowercase hex");
39821
+ assertBase64Bytes(raw.publicKey, `${L}.publicKey`, 32);
39822
+ assertPositiveSafeInt(raw.generation, `${L}.generation`);
39823
+ const n = raw.bridgedRegistrations;
39824
+ if (typeof n !== "number" || !Number.isSafeInteger(n) || n < 0) {
39825
+ throw new ProtocolError3(`${L}.bridgedRegistrations: expected non-negative safe integer`);
39826
+ }
39827
+ assertExactFields(raw, ACCOUNT_KEY_FIELDS, L);
39828
+ return {
39829
+ type: ACCOUNT_KEY_FRAME,
39830
+ accountId: raw.accountId,
39831
+ slug: raw.slug,
39832
+ displayName: raw.displayName,
39833
+ confirmedBy: raw.confirmedBy,
39834
+ tokenId: raw.tokenId,
39835
+ kid: raw.kid,
39836
+ publicKey: raw.publicKey,
39837
+ generation: raw.generation,
39838
+ bridgedRegistrations: n
39839
+ };
39840
+ }
39841
+ var ACCOUNT_ATTEST_FIELDS = [
39842
+ "type",
39843
+ "mcpId",
39844
+ "accountId",
39845
+ "generation",
39846
+ "tokenId",
39847
+ "kid",
39848
+ "registrationId",
39849
+ "slug",
39850
+ "identityHash",
39851
+ "identityEd25519Pub",
39852
+ "scopeDigest",
39853
+ "consent",
39854
+ "notAfter",
39855
+ "sig"
39856
+ ];
39857
+ function validateAccountAttest(raw) {
39858
+ const L = "account-attest";
39859
+ if (!isValidMcpId(raw.mcpId))
39860
+ throw new ProtocolError3(`${L}.mcpId: invalid format`);
39861
+ assertMatch(raw.accountId, ACCOUNT_ID_RE, `${L}.accountId`, "an account id");
39862
+ assertPositiveSafeInt(raw.generation, `${L}.generation`);
39863
+ assertMatch(raw.tokenId, ACCOUNT_ID_RE, `${L}.tokenId`, "a token id");
39864
+ assertMatch(raw.kid, ACCOUNT_KID_RE, `${L}.kid`, "16 lowercase hex");
39865
+ assertMatch(raw.registrationId, ACCOUNT_ID_RE, `${L}.registrationId`, "a registration id");
39866
+ assertMatch(raw.slug, ACCOUNT_ID_RE, `${L}.slug`, "a slug");
39867
+ assertMatch(raw.identityHash, HEX64_RE, `${L}.identityHash`, "64 lowercase hex");
39868
+ assertBase64Bytes(raw.identityEd25519Pub, `${L}.identityEd25519Pub`, 32);
39869
+ assertMatch(raw.scopeDigest, HEX64_RE, `${L}.scopeDigest`, "64 lowercase hex");
39870
+ assertString(raw.consent, `${L}.consent`);
39871
+ const consent = raw.consent;
39872
+ const known = ACCOUNT_ATTEST_CONSENTS.find((c) => c === consent);
39873
+ if (known === void 0) {
39874
+ throw new ProtocolError3(`${L}.consent: must be one of ${ACCOUNT_ATTEST_CONSENTS.join(", ")}`);
39875
+ }
39876
+ assertPositiveSafeInt(raw.notAfter, `${L}.notAfter`);
39877
+ assertBase64Bytes(raw.sig, `${L}.sig`, 64);
39878
+ assertExactFields(raw, ACCOUNT_ATTEST_FIELDS, L);
39879
+ return {
39880
+ type: ACCOUNT_ATTEST_FRAME,
39881
+ mcpId: raw.mcpId,
39882
+ accountId: raw.accountId,
39883
+ generation: raw.generation,
39884
+ tokenId: raw.tokenId,
39885
+ kid: raw.kid,
39886
+ registrationId: raw.registrationId,
39887
+ slug: raw.slug,
39888
+ identityHash: raw.identityHash,
39889
+ identityEd25519Pub: raw.identityEd25519Pub,
39890
+ scopeDigest: raw.scopeDigest,
39891
+ consent: known,
39892
+ notAfter: raw.notAfter,
39893
+ sig: raw.sig
39894
+ };
39895
+ }
39896
+ var TYPE_ONLY_FIELDS = ["type"];
39897
+ var BRIDGE_ROLE_FIELDS = ["type", "role", "canServe", "serving"];
39898
+ var BRIDGE_ROLE_SERVING_FIELDS = ["label", "since"];
39899
+ function validateBridgeRole(raw) {
39900
+ const L = BRIDGE_ROLE_FRAME;
39901
+ const role = raw.role;
39902
+ if (role !== "serving" && role !== "standby") {
39903
+ throw new ProtocolError3(`${L}.role: must be one of serving, standby`);
39904
+ }
39905
+ const canServe = raw.canServe;
39906
+ assertBoolean(canServe, `${L}.canServe`);
39907
+ assertExactFields(raw, BRIDGE_ROLE_FIELDS, L);
39908
+ const serving = raw.serving;
39909
+ if (role === "serving") {
39910
+ if (serving !== void 0) {
39911
+ throw new ProtocolError3(`${L}.serving: must be absent when role is serving`);
39912
+ }
39913
+ return { type: BRIDGE_ROLE_FRAME, role, canServe };
39914
+ }
39915
+ if (serving === void 0) {
39916
+ throw new ProtocolError3(`${L}.serving: required when role is standby`);
39917
+ }
39918
+ assertObject(serving, `${L}.serving`);
39919
+ const label = serving.label;
39920
+ assertDisplayString(label, `${L}.serving.label`, 1, BRIDGE_ROLE_LABEL_MAX);
39921
+ const since = serving.since;
39922
+ if (typeof since !== "number" || !Number.isSafeInteger(since) || since < 0) {
39923
+ throw new ProtocolError3(`${L}.serving.since: expected non-negative safe integer (Unix ms)`);
39924
+ }
39925
+ assertExactFields(serving, BRIDGE_ROLE_SERVING_FIELDS, `${L}.serving`);
39926
+ return {
39927
+ type: BRIDGE_ROLE_FRAME,
39928
+ role,
39929
+ canServe,
39930
+ serving: { label, since }
39931
+ };
39932
+ }
39718
39933
  function validateInnerFrame(raw) {
39719
39934
  assertObject(raw, "inner");
39720
39935
  const t = raw.type;
@@ -40182,10 +40397,10 @@ function validateInnerResponse(raw) {
40182
40397
  }
40183
40398
 
40184
40399
  // node_modules/@fetchproxy/protocol/dist/pair-code.js
40185
- var enc2 = new TextEncoder();
40400
+ var enc3 = new TextEncoder();
40186
40401
  var PAIR_LABEL = "fetchproxy/4/pair";
40187
40402
  async function pairTranscript(mcpIdentityPub, extIdentityPub, mcpNonce, extNonce, mcpSessionPub) {
40188
- const label = enc2.encode(PAIR_LABEL);
40403
+ const label = enc3.encode(PAIR_LABEL);
40189
40404
  const parts = [mcpIdentityPub, extIdentityPub, mcpNonce, extNonce, mcpSessionPub];
40190
40405
  const out = new Uint8Array(label.length + 1 + parts.reduce((n, p) => n + p.length, 0));
40191
40406
  out.set(label, 0);
@@ -40206,7 +40421,7 @@ function digits(hash2) {
40206
40421
  }
40207
40422
 
40208
40423
  // node_modules/@fetchproxy/protocol/dist/seal.js
40209
- var enc3 = new TextEncoder();
40424
+ var enc4 = new TextEncoder();
40210
40425
  var dec = new TextDecoder();
40211
40426
  function randomIv() {
40212
40427
  const iv = new Uint8Array(12);
@@ -40219,14 +40434,14 @@ function base64Length(byteLength) {
40219
40434
  return Math.ceil(byteLength / 3) * 4;
40220
40435
  }
40221
40436
  function encodeInnerFrame(inner) {
40222
- return enc3.encode(JSON.stringify(inner));
40437
+ return enc4.encode(JSON.stringify(inner));
40223
40438
  }
40224
40439
  function plaintextOf(inner) {
40225
40440
  return inner instanceof Uint8Array ? inner : encodeInnerFrame(inner);
40226
40441
  }
40227
40442
  function sealedFrameWireBytes(mcpId, seq, inner) {
40228
40443
  const plaintext = plaintextOf(inner).length;
40229
- const envelope = enc3.encode(JSON.stringify({ type: "frame", mcpId, seq, iv: "", ciphertext: "" })).length;
40444
+ const envelope = enc4.encode(JSON.stringify({ type: "frame", mcpId, seq, iv: "", ciphertext: "" })).length;
40230
40445
  return envelope + IV_B64_BYTES + base64Length(plaintext + AES_GCM_TAG_BYTES);
40231
40446
  }
40232
40447
  var MAX_FRAME_BYTES = 42 * 1024 * 1024;
@@ -40566,14 +40781,23 @@ var FetchproxyHelloRejectedError = class extends Error {
40566
40781
  platform;
40567
40782
  /**
40568
40783
  * #418: the remedy, when the reason is one this package knows how to
40569
- * explain — today only `unsupported-capability`, which blames the browser
40570
- * rather than the MCP. `null` otherwise.
40784
+ * explain — `unsupported-capability`, which blames the browser rather than
40785
+ * the MCP, and (D12) `awaiting-approval`, which says to approve in the
40786
+ * browser. `null` otherwise.
40571
40787
  */
40572
40788
  hint;
40789
+ /**
40790
+ * D12: `true` only for an `awaiting-approval:` refusal — the extension has
40791
+ * queued an approval card and nobody is at the browser yet, so the same call
40792
+ * succeeds once the person approves. Every other refusal is the extension's
40793
+ * final answer, and retrying unchanged is refused the same way.
40794
+ */
40795
+ retryable;
40573
40796
  constructor(info) {
40574
40797
  const unavailable = parseUnsupportedCapabilityReason(info.reason);
40798
+ const awaiting = parseAwaitingApprovalReason(info.reason);
40575
40799
  const platform = info.platform ?? null;
40576
- const hint = unavailable !== null ? `${platform ? `this browser (${platform})` : "this browser"} cannot serve any of the capabilities this MCP needs (${unavailable.join(", ")}) \u2014 ContextMint Bridge checked for the browser APIs and they are missing. Nothing is wrong with the MCP or your pairing, and updating will not change it: use this MCP from a browser that provides them (for example Chrome).` : null;
40800
+ const hint = awaiting !== null ? `The extension is waiting for you to approve this MCP` + (awaiting !== "" ? ` (${awaiting})` : "") + ` \u2014 open ContextMint Bridge in your browser, approve it there, then retry. Nothing is wrong with the MCP or your sign-in.` : unavailable !== null ? `${platform ? `this browser (${platform})` : "this browser"} cannot serve any of the capabilities this MCP needs (${unavailable.join(", ")}) \u2014 ContextMint Bridge checked for the browser APIs and they are missing. Nothing is wrong with the MCP or your pairing, and updating will not change it: use this MCP from a browser that provides them (for example Chrome).` : null;
40577
40801
  super(`fetchproxy: the extension refused the connection for "${info.mcpId}": ${info.reason}. ` + (hint !== null ? hint : `This is the extension's own reason \u2014 it is not a timeout, and retrying unchanged will be refused the same way.`));
40578
40802
  this.name = "FetchproxyHelloRejectedError";
40579
40803
  this.mcpId = info.mcpId;
@@ -40581,6 +40805,7 @@ var FetchproxyHelloRejectedError = class extends Error {
40581
40805
  this.unavailableCapabilities = unavailable ?? [];
40582
40806
  this.platform = platform;
40583
40807
  this.hint = hint;
40808
+ this.retryable = awaiting !== null;
40584
40809
  Object.setPrototypeOf(this, new.target.prototype);
40585
40810
  }
40586
40811
  };
@@ -41133,7 +41358,7 @@ function originVerdict(origin, allowLocal) {
41133
41358
  }
41134
41359
  var HANDSHAKE_TIMEOUT_MS = 15e3;
41135
41360
  var MAX_PAYLOAD_BYTES = MAX_FRAME_BYTES;
41136
- var enc4 = new TextEncoder();
41361
+ var enc5 = new TextEncoder();
41137
41362
  var OWN_DECRYPT_FAILURES_BEFORE_REHANDSHAKE = 3;
41138
41363
  async function startHost(opts) {
41139
41364
  const allowLocalOrigins = envAllowsLocalOrigins();
@@ -41204,10 +41429,20 @@ async function startHost(opts) {
41204
41429
  let resolveOwnSession;
41205
41430
  let rejectOwnSession;
41206
41431
  let ownSessionReady;
41432
+ let ownRetryableRefusal = false;
41433
+ let ownSessionSettled = false;
41207
41434
  function resetSessionPromise() {
41435
+ ownRetryableRefusal = false;
41436
+ ownSessionSettled = false;
41208
41437
  ownSessionReady = new Promise((resolve, reject) => {
41209
- resolveOwnSession = resolve;
41210
- rejectOwnSession = reject;
41438
+ resolveOwnSession = (st) => {
41439
+ ownSessionSettled = true;
41440
+ resolve(st);
41441
+ };
41442
+ rejectOwnSession = (e) => {
41443
+ ownSessionSettled = true;
41444
+ reject(e);
41445
+ };
41211
41446
  });
41212
41447
  ownSessionReady.catch(() => {
41213
41448
  });
@@ -41474,13 +41709,15 @@ async function startHost(opts) {
41474
41709
  const extPub = fromB64(frame.extensionSessionPub);
41475
41710
  const shared = await ecdhX25519(held.priv, extPub);
41476
41711
  const salt = await transcriptHash(held.nonce, extNonce, held.pub, extPub);
41477
- const key = await hkdfSha256(shared, salt, enc4.encode(HKDF_SESSION_INFO), 32);
41712
+ const key = await hkdfSha256(shared, salt, enc5.encode(HKDF_SESSION_INFO), 32);
41478
41713
  if (extensionWs !== ws)
41479
41714
  return;
41480
41715
  ownSession = new SessionState(key);
41481
41716
  ownSessionInfo = sessionInfoFromHello(verifiedHello);
41482
41717
  ownDecryptFailures = 0;
41483
41718
  ownPendingPairCode = null;
41719
+ if (ownRetryableRefusal)
41720
+ resetSessionPromise();
41484
41721
  resolveOwnSession(ownSession);
41485
41722
  } else {
41486
41723
  const slot = peers.get(frame.mcpId);
@@ -41549,11 +41786,17 @@ async function startHost(opts) {
41549
41786
  }
41550
41787
  if (frame.type === "hello-rejected" && identified === "extension") {
41551
41788
  if (frame.mcpId === opts.ownMcpId) {
41552
- rejectOwnSession(new FetchproxyHelloRejectedError({
41789
+ const refusal = new FetchproxyHelloRejectedError({
41553
41790
  mcpId: frame.mcpId,
41554
41791
  reason: frame.reason,
41555
41792
  platform: extensionHello?.platform ?? null
41556
- }));
41793
+ });
41794
+ if (ownRetryableRefusal)
41795
+ resetSessionPromise();
41796
+ const settlesPending = !ownSessionSettled;
41797
+ rejectOwnSession(refusal);
41798
+ if (refusal.retryable && settlesPending)
41799
+ ownRetryableRefusal = true;
41557
41800
  } else {
41558
41801
  const slot = peers.get(frame.mcpId);
41559
41802
  if (slot?.helloFrame.accepts?.includes("hello-rejected")) {
@@ -41669,7 +41912,7 @@ async function startHost(opts) {
41669
41912
 
41670
41913
  // node_modules/@fetchproxy/server/dist/peer.js
41671
41914
  var PEER_DIAL_TIMEOUT_MS = 5e3;
41672
- var enc5 = new TextEncoder();
41915
+ var enc6 = new TextEncoder();
41673
41916
  function notSentError() {
41674
41917
  return new Error("fetchproxy: request not sent \u2014 the connection to the bridge host closed before it went out, so nothing reached the browser. It is safe to retry.");
41675
41918
  }
@@ -41769,7 +42012,9 @@ async function startPeer(opts) {
41769
42012
  let rejectFirstReady;
41770
42013
  let sessionPromise;
41771
42014
  let sessionPromiseSettled = false;
42015
+ let retryableRefusal = false;
41772
42016
  function resetSessionPromise() {
42017
+ retryableRefusal = false;
41773
42018
  sessionPromiseSettled = false;
41774
42019
  sessionPromise = new Promise((resolve, reject) => {
41775
42020
  resolveFirstReady = (st) => {
@@ -41866,6 +42111,8 @@ async function startPeer(opts) {
41866
42111
  raw = JSON.parse(data.toString());
41867
42112
  const frame = validateFrame(raw);
41868
42113
  if (frame.type === "hello" && frame.role === "extension") {
42114
+ if (retryableRefusal)
42115
+ resetSessionPromise();
41869
42116
  extensionHello = frame;
41870
42117
  const mintedKeypair = await generateSessionKeypair();
41871
42118
  const mintedHello = await buildServerHello({
@@ -41895,6 +42142,8 @@ async function startPeer(opts) {
41895
42142
  session = null;
41896
42143
  if (sessionPromiseSettled)
41897
42144
  resetSessionPromise();
42145
+ } else if (retryableRefusal) {
42146
+ resetSessionPromise();
41898
42147
  }
41899
42148
  extensionDisconnectListeners.forEach((cb) => cb());
41900
42149
  return;
@@ -41916,7 +42165,7 @@ async function startPeer(opts) {
41916
42165
  const extNonce = fromB64(authenticated.sessionNonce);
41917
42166
  const shared = await ecdhX25519(held.priv, extPub);
41918
42167
  const salt = await transcriptHash(held.nonce, extNonce, held.pub, extPub);
41919
- const sessionKey = await hkdfSha256(shared, salt, enc5.encode(HKDF_SESSION_INFO), 32);
42168
+ const sessionKey = await hkdfSha256(shared, salt, enc6.encode(HKDF_SESSION_INFO), 32);
41920
42169
  if (sessionEphemeral !== held) {
41921
42170
  console.warn(`[fetchproxy] ${opts.serverName}: dropping a session derived against an ephemeral that was superseded while it was being derived`);
41922
42171
  return;
@@ -41929,16 +42178,24 @@ async function startPeer(opts) {
41929
42178
  if (isRenegotiation) {
41930
42179
  renegotiateListeners.forEach((cb) => cb());
41931
42180
  } else {
42181
+ if (retryableRefusal)
42182
+ resetSessionPromise();
41932
42183
  resolveFirstReady(session);
41933
42184
  }
41934
42185
  return;
41935
42186
  }
41936
42187
  if (frame.type === "hello-rejected" && frame.mcpId === opts.mcpId) {
41937
- rejectFirstReady(new FetchproxyHelloRejectedError({
42188
+ const refusal = new FetchproxyHelloRejectedError({
41938
42189
  mcpId: frame.mcpId,
41939
42190
  reason: frame.reason,
41940
42191
  platform: extensionHello?.platform ?? null
41941
- }));
42192
+ });
42193
+ if (retryableRefusal)
42194
+ resetSessionPromise();
42195
+ const settlesPending = !sessionPromiseSettled;
42196
+ rejectFirstReady(refusal);
42197
+ if (refusal.retryable && settlesPending)
42198
+ retryableRefusal = true;
41942
42199
  }
41943
42200
  if (frame.type === "pair-pending" && frame.mcpId === opts.mcpId) {
41944
42201
  const hello2 = extensionHello;
@@ -42102,8 +42359,9 @@ function classifyFetchError(error62, code) {
42102
42359
 
42103
42360
  // node_modules/@fetchproxy/server/dist/classify-bridge-error.js
42104
42361
  function classifyBridgeError(err) {
42105
- if (err instanceof FetchproxyHelloRejectedError)
42106
- return "hello_rejected";
42362
+ if (err instanceof FetchproxyHelloRejectedError) {
42363
+ return err.retryable ? "awaiting_approval" : "hello_rejected";
42364
+ }
42107
42365
  if (err instanceof FetchproxySessionNotReadyError)
42108
42366
  return "session_not_ready";
42109
42367
  if (err instanceof FetchproxyTimeoutError)
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.6'; // x-release-please-version
13
+ export const VERSION = '0.2.7'; // 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.6",
3
+ "version": "0.2.7",
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,9 +45,9 @@
45
45
  "typecheck": "tsc -p tsconfig.check.json"
46
46
  },
47
47
  "dependencies": {
48
- "@chrischall/mcp-utils": "^2.14.0",
49
- "@fetchproxy/protocol": "^3.4.1",
50
- "@fetchproxy/server": "^3.4.1",
48
+ "@chrischall/mcp-utils": "^2.15.0",
49
+ "@fetchproxy/protocol": "^3.6.0",
50
+ "@fetchproxy/server": "^3.6.0",
51
51
  "@modelcontextprotocol/server": "^2.3.0",
52
52
  "dotenv": "^18.0.1",
53
53
  "zod": "^4.6.5"
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.6",
9
+ "version": "0.2.7",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/microsoft-teams-mcp",
14
- "version": "0.2.6",
14
+ "version": "0.2.7",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },