@chrischall/microsoft-teams-mcp 0.6.0 → 0.6.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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "MCP server for Microsoft Teams — read any chat or channel, your unread messages, and their attachments, and send messages and reactions (each confirmed first)",
10
- "version": "0.6.0"
10
+ "version": "0.6.1"
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 any chat or channel, your unread messages, and their attachments, and send messages and reactions (each confirmed first), via your signed-in browser session",
18
- "version": "0.6.0",
18
+ "version": "0.6.1",
19
19
  "author": {
20
20
  "name": "Chris Hall"
21
21
  },
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "mcpServers": {
3
3
  "teams": {
4
- "command": "node",
5
- "args": ["${CLAUDE_PLUGIN_ROOT}/dist/bundle.js"]
4
+ "command": "npx",
5
+ "args": ["-y", "@chrischall/microsoft-teams-mcp"]
6
6
  }
7
7
  }
8
8
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "microsoft-teams-mcp",
3
3
  "displayName": "Microsoft Teams",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "description": "Microsoft Teams for Claude — read any chat or channel, your unread messages, and their attachments, and send messages and reactions (each confirmed first), using your signed-in browser session",
6
6
  "author": {
7
7
  "name": "Chris Hall",
package/README.md CHANGED
@@ -168,6 +168,7 @@ Everything is optional — by default the token is captured from your browser.
168
168
  | `TEAMS_TOKEN_CACHE` | `false` to keep the captured token in memory only. Defaults to on. |
169
169
  | `TEAMS_TOKEN_FILE` | Where the captured token is cached. Defaults to `~/.microsoft-teams-mcp/token.json`. |
170
170
  | `TEAMS_SUBSTRATE_TOKEN_FILE` | Where the captured Substrate search token is cached. Defaults to `~/.microsoft-teams-mcp/substrate-token.json`. `TEAMS_TOKEN_CACHE=false` keeps it in memory too. |
171
+ | `TEAMS_SHAREPOINT_TOKEN_FILE` | Where the captured SharePoint tokens (one per host, used to download shared files) are cached. Defaults to `~/.microsoft-teams-mcp/sharepoint-tokens.json`. `TEAMS_TOKEN_CACHE=false` keeps them in memory too. |
171
172
  | `TEAMS_TIME_ZONE` | Default IANA time zone (e.g. `America/New_York`) for the `tz` argument of `teams_read_conversation` and `teams_get_unread`: each message then carries `time_local` (ISO 8601 with offset) next to its UTC `time`. Unset means no `time_local` unless `tz` is passed; a name `Intl` does not know is reported as an error. |
172
173
  | `TEAMS_WS_PORT` | fetchproxy concentrator port. Defaults to `37149`, the fleet-wide shared port. |
173
174
  | `FETCHPROXY_WS_HOST` | Bind interface for the bridge (default `127.0.0.1`; a literal IP only, anything else is ignored). Keep on loopback — it exists for ONE topology: a hosted child in its own network namespace. |
package/dist/bundle.js CHANGED
@@ -248,6 +248,7 @@ __export(util_exports, {
248
248
  required: () => required,
249
249
  safeExtend: () => safeExtend,
250
250
  shallowClone: () => shallowClone,
251
+ sizeCaps: () => sizeCaps,
251
252
  slugify: () => slugify,
252
253
  stringifyPrimitive: () => stringifyPrimitive,
253
254
  toZod: () => toZod,
@@ -671,6 +672,18 @@ function prefixIssues(path, issues) {
671
672
  function unwrapMessage(message) {
672
673
  return typeof message === "string" ? message : message?.message;
673
674
  }
675
+ function sizeCaps(defChecks) {
676
+ const caps = [];
677
+ for (const ch of defChecks ?? []) {
678
+ const d = ch._zod.def;
679
+ if (!/_(length|size)$|_equals$/.test(d.check))
680
+ break;
681
+ const max = d.maximum ?? d.length ?? d.size;
682
+ if (max >= 0)
683
+ caps.push([max, ch]);
684
+ }
685
+ return caps;
686
+ }
674
687
  function attachSchema(issues, start, inst) {
675
688
  var _a3;
676
689
  for (let i = start; i < issues.length; i++) {
@@ -2234,7 +2247,7 @@ var init_versions = __esm({
2234
2247
  version = {
2235
2248
  major: 4,
2236
2249
  minor: 6,
2237
- patch: 5
2250
+ patch: 7
2238
2251
  };
2239
2252
  }
2240
2253
  });
@@ -2396,6 +2409,28 @@ function isValidJWT(token, algorithm = null) {
2396
2409
  return false;
2397
2410
  }
2398
2411
  }
2412
+ function capSize(inst, size) {
2413
+ const caps = sizeCaps(inst._zod.def.checks);
2414
+ if (!caps.length)
2415
+ return;
2416
+ const cap = Math.min(...caps.map((c) => c[0]));
2417
+ const parse3 = inst._zod.parse;
2418
+ inst._zod.parse = (payload, ctx) => {
2419
+ const n = size(payload.value);
2420
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
2421
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
2422
+ if (n > max && ch._zod.def.when(payload)) {
2423
+ const start = payload.issues.length;
2424
+ ch._zod.check(payload);
2425
+ payload.issues[start].continue = false;
2426
+ attachSchema(payload.issues, start, inst);
2427
+ return payload;
2428
+ }
2429
+ }
2430
+ }
2431
+ return parse3(payload, ctx);
2432
+ };
2433
+ }
2399
2434
  function handleArrayResult(result, final, index) {
2400
2435
  if (result.issues.length) {
2401
2436
  final.issues.push(...prefixIssues(index, result.issues));
@@ -2896,7 +2931,7 @@ function handleRefineResult(result, payload, input2, inst) {
2896
2931
  payload.issues.push(issue(_iss));
2897
2932
  }
2898
2933
  }
2899
- var $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, CC_SANITIZE, $ZodCreditCard, $ZodIBAN, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom;
2934
+ var $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, CC_SANITIZE, $ZodCreditCard, $ZodIBAN, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, arraySize, mapSize, setSize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom;
2900
2935
  var init_schemas = __esm({
2901
2936
  "node_modules/zod/v4/core/schemas.js"() {
2902
2937
  init_checks();
@@ -3503,6 +3538,9 @@ var init_schemas = __esm({
3503
3538
  return payload;
3504
3539
  };
3505
3540
  });
3541
+ arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
3542
+ mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
3543
+ setSize = (input2) => input2 instanceof Set ? input2.size : -1;
3506
3544
  $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3507
3545
  $ZodType.init(inst, def);
3508
3546
  const memo3 = globalConfig.memoizer;
@@ -3540,6 +3578,7 @@ var init_schemas = __esm({
3540
3578
  }
3541
3579
  return payload;
3542
3580
  };
3581
+ capSize(inst, arraySize);
3543
3582
  });
3544
3583
  NO_SYMBOL_KEYS = [];
3545
3584
  $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
@@ -4178,6 +4217,7 @@ var init_schemas = __esm({
4178
4217
  return Promise.all(proms).then(() => payload);
4179
4218
  return payload;
4180
4219
  };
4220
+ capSize(inst, mapSize);
4181
4221
  });
4182
4222
  $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4183
4223
  $ZodType.init(inst, def);
@@ -4214,6 +4254,7 @@ var init_schemas = __esm({
4214
4254
  return Promise.all(proms).then(() => payload);
4215
4255
  return payload;
4216
4256
  };
4257
+ capSize(inst, setSize);
4217
4258
  });
4218
4259
  $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
4219
4260
  $ZodType.init(inst, def);
@@ -14003,9 +14044,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
14003
14044
  doc.write(`}`);
14004
14045
  return outputVar;
14005
14046
  }
14047
+ function generateSizeGate(doc, schema, size) {
14048
+ for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
14049
+ doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
14050
+ }
14051
+ }
14006
14052
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
14007
14053
  const def = schema._zod.def;
14008
14054
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
14055
+ generateSizeGate(doc, schema, `${accessor}.length`);
14009
14056
  const outputVar = buildsValue ? newVar(ctx) : null;
14010
14057
  const iVar = newVar(ctx);
14011
14058
  const elemVar = newVar(ctx);
@@ -14405,6 +14452,7 @@ function literalPropertyKey(ctx, key) {
14405
14452
  function generateMapCheck(doc, ctx, schema, accessor) {
14406
14453
  const def = schema._zod.def;
14407
14454
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
14455
+ generateSizeGate(doc, schema, `${accessor}.size`);
14408
14456
  const outputVar = newVar(ctx);
14409
14457
  const kVar = newVar(ctx);
14410
14458
  const valVar = newVar(ctx);
@@ -14421,6 +14469,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
14421
14469
  function generateSetCheck(doc, ctx, schema, accessor) {
14422
14470
  const def = schema._zod.def;
14423
14471
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
14472
+ generateSizeGate(doc, schema, `${accessor}.size`);
14424
14473
  const outputVar = newVar(ctx);
14425
14474
  const valVar = newVar(ctx);
14426
14475
  doc.write(`const ${outputVar} = new Set();`);
@@ -35442,7 +35491,7 @@ var init_errors3 = __esm({
35442
35491
  // webhook signing secret (Stripe-style)
35443
35492
  ].map((p) => `\\b${p}`).join("|"), "g");
35444
35493
  GOOGLE_OAUTH_TOKEN_RE = /(?<![A-Za-z0-9+/])(?:ya29\.|1\/\/)[A-Za-z0-9._-]{8,}/g;
35445
- QUERY_SECRET_RE = new RegExp(`([?&](?:(?:access|refresh|id|auth|session|csrf|xsrf)[_-]?token|client[_-]?secret|api[_-]?secret|api[_-]?key|password|passwd|signature|token|key|sig|(?:code[_-]?)?verifier|(?:php|j)?sess(?:ion)?[_-]?id|sid|x[-_]${HEADER_NAME_RUN}?(?:api[-_]?key|token|secret|auth)${HEADER_NAME_RUN})=)[^&#\\s"'<>\`]+`, "gi");
35494
+ QUERY_SECRET_RE = new RegExp(`([?&#;](?:(?:access|refresh|id|auth|session|csrf|xsrf|api)[_-]?token|client[_-]?secret|api[_-]?secret|api[_-]?key|password|passwd|signature|secret|token|auth|key|sig|(?:code[_-]?)?verifier|(?:php|j)?sess(?:ion)?[_-]?id|sid|x[-_]${HEADER_NAME_RUN}?(?:api[-_]?key|token|secret|auth)${HEADER_NAME_RUN})=)[^&#\\s"'<>\`]+`, "gi");
35446
35495
  OAUTH_CODE_RE = /([?&]code=)(?=[^&#\s"'<>`]{16,})[^&#\s"'<>`]+/gi;
35447
35496
  FORM_PASSWORD_RE = /((?:^|[\s,;:"'(\[{])(?:password|passwd)=)[^&#\s"'<>`]+/gim;
35448
35497
  HEADER_SECRET_RE = new RegExp(`(\\b(?:x[-_]${HEADER_NAME_RUN}?(?:api[-_]?key|token|secret|auth)${HEADER_NAME_RUN}|api[-_]?key)\\s*:\\s*)[^\\s,;"'<>\`]+`, "gi");
@@ -35453,6 +35502,8 @@ var init_errors3 = __esm({
35453
35502
  "api[_-]?secret",
35454
35503
  "(?:x[_-])?api[_-]?key",
35455
35504
  "private[_-]?key",
35505
+ "aws[_-]?secret[_-]?access[_-]?key",
35506
+ // fleet-audit#1297
35456
35507
  "code[_-]?verifier",
35457
35508
  // PKCE; a bare `verifier` key is too generic for JSON
35458
35509
  `x[_-]${HEADER_NAME_RUN}?(?:api[_-]?key|token|secret|auth)${HEADER_NAME_RUN}`,
@@ -36552,12 +36603,24 @@ var init_fs = __esm({
36552
36603
  });
36553
36604
 
36554
36605
  // node_modules/@chrischall/mcp-utils/dist/internal/headers.js
36606
+ function responseHeader(res, name) {
36607
+ return getHeader(res?.headers, name);
36608
+ }
36609
+ function getHeader(headers, name) {
36610
+ if (!headers || typeof headers.get !== "function")
36611
+ return null;
36612
+ const value = headers.get.call(headers, name);
36613
+ return typeof value === "string" ? value : null;
36614
+ }
36555
36615
  var init_headers = __esm({
36556
36616
  "node_modules/@chrischall/mcp-utils/dist/internal/headers.js"() {
36557
36617
  }
36558
36618
  });
36559
36619
 
36560
36620
  // node_modules/@chrischall/mcp-utils/dist/internal/ascii.js
36621
+ function asciiLower(s) {
36622
+ return s.replace(/[A-Z]+/g, (m) => m.toLowerCase());
36623
+ }
36561
36624
  var init_ascii = __esm({
36562
36625
  "node_modules/@chrischall/mcp-utils/dist/internal/ascii.js"() {
36563
36626
  }
@@ -36569,16 +36632,42 @@ var init_code_point = __esm({
36569
36632
  }
36570
36633
  });
36571
36634
 
36635
+ // node_modules/@chrischall/mcp-utils/dist/internal/tags.js
36636
+ var init_tags = __esm({
36637
+ "node_modules/@chrischall/mcp-utils/dist/internal/tags.js"() {
36638
+ }
36639
+ });
36640
+
36572
36641
  // node_modules/@chrischall/mcp-utils/dist/scrape/index.js
36573
36642
  function isCloudflareChallenge(html) {
36574
- return /_cf_chl_opt/.test(html) || /<title[^>]*>\s*Just a moment/i.test(html);
36643
+ return html.includes("_cf_chl_opt") || hasJustAMomentTitle(html);
36575
36644
  }
36576
- var NEXT_DATA_MAX_CHARS;
36645
+ function hasJustAMomentTitle(html) {
36646
+ const lower = asciiLower(html);
36647
+ let i = 0;
36648
+ for (; ; ) {
36649
+ const open2 = lower.indexOf("<title", i);
36650
+ if (open2 < 0)
36651
+ return false;
36652
+ const gt = lower.indexOf(">", open2 + 6);
36653
+ if (gt < 0)
36654
+ return false;
36655
+ let j = gt + 1;
36656
+ while (j < lower.length && /\s/.test(lower[j]))
36657
+ j++;
36658
+ if (lower.startsWith(JUST_A_MOMENT, j))
36659
+ return true;
36660
+ i = gt + 1;
36661
+ }
36662
+ }
36663
+ var NEXT_DATA_MAX_CHARS, JUST_A_MOMENT;
36577
36664
  var init_scrape = __esm({
36578
36665
  "node_modules/@chrischall/mcp-utils/dist/scrape/index.js"() {
36579
36666
  init_ascii();
36580
36667
  init_code_point();
36668
+ init_tags();
36581
36669
  NEXT_DATA_MAX_CHARS = 16 * 1024 * 1024;
36670
+ JUST_A_MOMENT = "just a moment";
36582
36671
  }
36583
36672
  });
36584
36673
 
@@ -36604,7 +36693,7 @@ var init_net_atoms = __esm({
36604
36693
  // node_modules/@chrischall/mcp-utils/dist/http/body-limit.js
36605
36694
  async function readBytesCapped(res, maxBytes, service, bounded) {
36606
36695
  if (maxBytes !== void 0) {
36607
- const declared = Number(res.headers.get("content-length") ?? NaN);
36696
+ const declared = Number(responseHeader(res, "content-length") ?? NaN);
36608
36697
  if (Number.isFinite(declared) && declared > maxBytes) {
36609
36698
  cancelStream(res.body);
36610
36699
  throw new ResponseTooLargeError(service, maxBytes);
@@ -36649,6 +36738,7 @@ var ResponseTooLargeError;
36649
36738
  var init_body_limit = __esm({
36650
36739
  "node_modules/@chrischall/mcp-utils/dist/http/body-limit.js"() {
36651
36740
  init_errors3();
36741
+ init_headers();
36652
36742
  ResponseTooLargeError = class extends McpToolError {
36653
36743
  maxBytes;
36654
36744
  constructor(service, maxBytes) {
@@ -37080,7 +37170,7 @@ var init_version = __esm({
37080
37170
  "src/version.ts"() {
37081
37171
  "use strict";
37082
37172
  PACKAGE_NAME = "microsoft-teams-mcp";
37083
- VERSION = "0.6.0";
37173
+ VERSION = "0.6.1";
37084
37174
  }
37085
37175
  });
37086
37176
 
@@ -37635,6 +37725,21 @@ var init_public_suffix = __esm({
37635
37725
  }
37636
37726
  });
37637
37727
 
37728
+ // node_modules/@fetchproxy/protocol/dist/ip-literal.js
37729
+ function isIpLiteralHost(host) {
37730
+ if (host.includes(":") || host.startsWith("["))
37731
+ return true;
37732
+ const labels = host.split(".");
37733
+ if (labels.length > 1 && labels[labels.length - 1] === "")
37734
+ labels.pop();
37735
+ const last = labels[labels.length - 1] ?? "";
37736
+ return /^[0-9]+$/.test(last) || /^0x[0-9a-f]*$/i.test(last);
37737
+ }
37738
+ var init_ip_literal = __esm({
37739
+ "node_modules/@fetchproxy/protocol/dist/ip-literal.js"() {
37740
+ }
37741
+ });
37742
+
37638
37743
  // node_modules/@fetchproxy/protocol/dist/validate.js
37639
37744
  function assertObject(x, label) {
37640
37745
  if (typeof x !== "object" || x === null || Array.isArray(x)) {
@@ -38084,6 +38189,9 @@ function validateHello(raw) {
38084
38189
  if (!HOSTNAME_RE.test(d)) {
38085
38190
  throw new ProtocolError3(`hello.domains: invalid hostname ${JSON.stringify(d)}`);
38086
38191
  }
38192
+ if (isIpLiteralHost(d)) {
38193
+ throw new ProtocolError3(`hello.domains: ${JSON.stringify(d)} is an IP address \u2014 declare the site's DNS hostname; IP-literal origins (LAN, loopback, link-local) are not reachable through the bridge`);
38194
+ }
38087
38195
  if (isPublicSuffix(d)) {
38088
38196
  throw new ProtocolError3(`hello.domains: ${JSON.stringify(d)} is a public suffix \u2014 declare a registrable domain (e.g. "example.${d}"), not the suffix every site under it shares`);
38089
38197
  }
@@ -38857,6 +38965,7 @@ var init_validate = __esm({
38857
38965
  init_account_attest();
38858
38966
  init_json_pointer();
38859
38967
  init_public_suffix();
38968
+ init_ip_literal();
38860
38969
  ProtocolError3 = class extends Error {
38861
38970
  constructor(message) {
38862
38971
  super(message);
@@ -39036,6 +39145,7 @@ var init_dist3 = __esm({
39036
39145
  init_seal();
39037
39146
  init_encoding();
39038
39147
  init_public_suffix();
39148
+ init_ip_literal();
39039
39149
  init_json_pointer();
39040
39150
  }
39041
39151
  });
@@ -44006,7 +44116,7 @@ async function startHost(opts) {
44006
44116
  if (ownRetryableRefusal)
44007
44117
  resetSessionPromise();
44008
44118
  resolveOwnSession(ownSession);
44009
- } else {
44119
+ } else if (identified === "extension" && extensionWs === ws) {
44010
44120
  const slot = peers.get(frame.mcpId);
44011
44121
  if (slot)
44012
44122
  slot.ws.send(JSON.stringify(frame));
@@ -45094,6 +45204,9 @@ var init_ws_server = __esm({
45094
45204
  throw new Error("FetchproxyServer: opts.domains must be a non-empty array of hostnames");
45095
45205
  }
45096
45206
  for (const d of opts.domains) {
45207
+ if (typeof d === "string" && isIpLiteralHost(d)) {
45208
+ throw new Error(`FetchproxyServer: opts.domains entry ${JSON.stringify(d)} is an IP address \u2014 declare the site's DNS hostname; IP-literal origins (LAN, loopback, link-local) are not reachable through the bridge`);
45209
+ }
45097
45210
  if (typeof d === "string" && isPublicSuffix(d)) {
45098
45211
  throw new Error(`FetchproxyServer: opts.domains entry ${JSON.stringify(d)} is a public suffix \u2014 declare a registrable domain (e.g. "example.${d}"), not the suffix every site under it shares`);
45099
45212
  }
@@ -47039,8 +47152,10 @@ var init_bulk = __esm({
47039
47152
  });
47040
47153
 
47041
47154
  // node_modules/@fetchproxy/server/dist/bot-wall.js
47155
+ var CLOUDFLARE_TITLE_SCAN_MAX;
47042
47156
  var init_bot_wall = __esm({
47043
47157
  "node_modules/@fetchproxy/server/dist/bot-wall.js"() {
47158
+ CLOUDFLARE_TITLE_SCAN_MAX = 64 * 1024;
47044
47159
  }
47045
47160
  });
47046
47161
 
@@ -48739,7 +48854,30 @@ function causeMessage(err) {
48739
48854
  function isFetchFailed(err) {
48740
48855
  return err instanceof TypeError && err.message === "fetch failed";
48741
48856
  }
48742
- function hintFor(code2, host) {
48857
+ function proxyRefusalStatus(err) {
48858
+ for (const e of causes(err)) {
48859
+ if (codeOf(e) === "ERR_PROXY_TUNNEL") {
48860
+ const m = /\b(\d{3})\b/.exec(e instanceof Error ? e.message : "");
48861
+ return m ? Number(m[1]) : "unknown";
48862
+ }
48863
+ if (e instanceof Error) {
48864
+ const m = /^Proxy response \((\d{3})\) !== 200 when HTTP Tunneling/.exec(e.message);
48865
+ if (m) return Number(m[1]);
48866
+ }
48867
+ }
48868
+ return void 0;
48869
+ }
48870
+ function proxyRefusalHint(status, host) {
48871
+ if (status !== 403 && status !== 407 && status !== "unknown") return void 0;
48872
+ return `The outbound proxy this server runs behind refused the connection to ${host}: its egress policy does not allow that host. On a hosted (mcp-host) registration, the host must be on the registration's egress allow-list \u2014 the owner accepts the manifest's egress proposal (or adds the host) on the registration, then retries. Elsewhere, ask whoever runs the proxy to allow it.`;
48873
+ }
48874
+ function hintFor(code2, host, err) {
48875
+ const refused = proxyRefusalStatus(err);
48876
+ if (refused !== void 0) {
48877
+ const policy = proxyRefusalHint(refused, host);
48878
+ if (policy !== void 0) return policy;
48879
+ return `The outbound proxy this server runs behind could not open a connection to ${host} (it answered ${refused}). Retry; if it persists, check the proxy can reach the host.`;
48880
+ }
48743
48881
  if (code2 !== void 0 && DNS_CODES.has(code2)) {
48744
48882
  return `This machine could not resolve ${host}. Check DNS and VPN: a split-tunnel VPN that resolves teams.cloud.microsoft but not the regional *.asm.skype.com and *.sharepoint.com hosts fails exactly like this. \`nslookup ${host}\` on the machine running this server tells you which.`;
48745
48883
  }
@@ -48764,7 +48902,7 @@ function describeTransportFailure(err, url2, service) {
48764
48902
  const why = detail.length > 0 ? ` (${[...new Set(detail)].join(": ")})` : "";
48765
48903
  return new McpToolError(`Could not reach ${service} at ${host}${why}.`, {
48766
48904
  kind: "transport",
48767
- hint: hintFor(code2, host),
48905
+ hint: hintFor(code2, host, err),
48768
48906
  cause: err
48769
48907
  });
48770
48908
  }
@@ -78,7 +78,49 @@ function causeMessage(err) {
78
78
  function isFetchFailed(err) {
79
79
  return err instanceof TypeError && err.message === 'fetch failed';
80
80
  }
81
- function hintFor(code, host) {
81
+ /**
82
+ * The status a configured HTTPS proxy answered the CONNECT with, when that is
83
+ * why the request failed. undici reports it only in the message of an
84
+ * `UND_ERR_ABORTED` cause ("Proxy response (403) !== 200 when HTTP
85
+ * Tunneling") — there is no structured field to branch on — and Node's own
86
+ * http proxy support uses code `ERR_PROXY_TUNNEL`.
87
+ */
88
+ function proxyRefusalStatus(err) {
89
+ for (const e of causes(err)) {
90
+ if (codeOf(e) === 'ERR_PROXY_TUNNEL') {
91
+ const m = /\b(\d{3})\b/.exec(e instanceof Error ? e.message : '');
92
+ return m ? Number(m[1]) : 'unknown';
93
+ }
94
+ if (e instanceof Error) {
95
+ const m = /^Proxy response \((\d{3})\) !== 200 when HTTP Tunneling/.exec(e.message);
96
+ if (m)
97
+ return Number(m[1]);
98
+ }
99
+ }
100
+ return undefined;
101
+ }
102
+ /**
103
+ * A proxy that answered 403/407 refused the destination by policy: on mcp-host
104
+ * that is the registration's egress allow-list (mint.yaml `egress.allow`), not
105
+ * this machine's DNS or VPN, so say that instead of the network-route hints.
106
+ */
107
+ function proxyRefusalHint(status, host) {
108
+ if (status !== 403 && status !== 407 && status !== 'unknown')
109
+ return undefined;
110
+ return (`The outbound proxy this server runs behind refused the connection to ${host}: its egress ` +
111
+ 'policy does not allow that host. On a hosted (mcp-host) registration, the host must be on the ' +
112
+ "registration's egress allow-list — the owner accepts the manifest's egress proposal (or adds " +
113
+ 'the host) on the registration, then retries. Elsewhere, ask whoever runs the proxy to allow it.');
114
+ }
115
+ function hintFor(code, host, err) {
116
+ const refused = proxyRefusalStatus(err);
117
+ if (refused !== undefined) {
118
+ const policy = proxyRefusalHint(refused, host);
119
+ if (policy !== undefined)
120
+ return policy;
121
+ return (`The outbound proxy this server runs behind could not open a connection to ${host} ` +
122
+ `(it answered ${refused}). Retry; if it persists, check the proxy can reach the host.`);
123
+ }
82
124
  if (code !== undefined && DNS_CODES.has(code)) {
83
125
  return (`This machine could not resolve ${host}. Check DNS and VPN: a split-tunnel VPN that resolves ` +
84
126
  'teams.cloud.microsoft but not the regional *.asm.skype.com and *.sharepoint.com hosts ' +
@@ -118,7 +160,7 @@ export function describeTransportFailure(err, url, service) {
118
160
  const why = detail.length > 0 ? ` (${[...new Set(detail)].join(': ')})` : '';
119
161
  return new McpToolError(`Could not reach ${service} at ${host}${why}.`, {
120
162
  kind: 'transport',
121
- hint: hintFor(code, host),
163
+ hint: hintFor(code, host, err),
122
164
  cause: err,
123
165
  });
124
166
  }
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.6.0'; // x-release-please-version
13
+ export const VERSION = '0.6.1'; // x-release-please-version
package/mint.yaml CHANGED
@@ -77,6 +77,12 @@ env:
77
77
  help: >-
78
78
  Path to the cached Substrate search token file. Defaults to
79
79
  ~/.microsoft-teams-mcp/substrate-token.json.
80
+ - name: TEAMS_SHAREPOINT_TOKEN_FILE
81
+ required: false
82
+ help: >-
83
+ Path to the cached SharePoint token file (one token per SharePoint host,
84
+ used to download shared files). Defaults to
85
+ ~/.microsoft-teams-mcp/sharepoint-tokens.json.
80
86
  state:
81
87
  dataDir: true
82
88
  reason: >-
@@ -91,9 +97,17 @@ egress:
91
97
  # (us-api.asm.skype.com and the like), retried through the Teams gateway
92
98
  # (us-prod.asyncgw.teams.microsoft.com) when the store cannot be reached —
93
99
  # the client sends its token nowhere else. Message search goes to Microsoft
94
- # Substrate (src/substrate.ts) with its own token.
100
+ # Substrate (src/substrate.ts) with its own token. Shared files
101
+ # (teams_get_attachment) download from the file's SharePoint tenant host
102
+ # (<tenant>.sharepoint.com / <tenant>-my.sharepoint.com, src/sharepoint.ts):
103
+ # the authed driveItem GET and then its pre-signed @content.downloadUrl,
104
+ # which SharePoint issues on the same tenant host (download.aspx + tempauth).
105
+ # That the pre-signed link never redirects off *.sharepoint.com has not been
106
+ # confirmed on a live fenced download; if it does, the refusal now names the
107
+ # host it was refused (src/network-error.ts), and that host belongs here.
95
108
  allow:
96
109
  - teams.cloud.microsoft
97
110
  - '*.asm.skype.com'
98
111
  - us-prod.asyncgw.teams.microsoft.com
99
112
  - substrate.office.com
113
+ - '*.sharepoint.com'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/microsoft-teams-mcp",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
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,8 +45,8 @@
45
45
  "typecheck": "tsc -p tsconfig.check.json"
46
46
  },
47
47
  "dependencies": {
48
- "@chrischall/mcp-utils": "^3.0.0",
49
- "@fetchproxy/server": "^3.6.0",
48
+ "@chrischall/mcp-utils": "^3.0.3",
49
+ "@fetchproxy/server": "^3.6.2",
50
50
  "@modelcontextprotocol/server": "^2.3.0",
51
51
  "dotenv": "^18.0.1",
52
52
  "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.6.0",
9
+ "version": "0.6.1",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/microsoft-teams-mcp",
14
- "version": "0.6.0",
14
+ "version": "0.6.1",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -86,6 +86,20 @@
86
86
  "format": "string",
87
87
  "isSecret": false
88
88
  },
89
+ {
90
+ "name": "TEAMS_SUBSTRATE_TOKEN_FILE",
91
+ "description": "Where the captured Substrate search token is cached. Defaults to ~/.microsoft-teams-mcp/substrate-token.json.",
92
+ "isRequired": false,
93
+ "format": "string",
94
+ "isSecret": false
95
+ },
96
+ {
97
+ "name": "TEAMS_SHAREPOINT_TOKEN_FILE",
98
+ "description": "Where the captured SharePoint tokens are cached. Defaults to ~/.microsoft-teams-mcp/sharepoint-tokens.json.",
99
+ "isRequired": false,
100
+ "format": "string",
101
+ "isSecret": false
102
+ },
89
103
  {
90
104
  "name": "TEAMS_TIME_ZONE",
91
105
  "description": "Default IANA time zone (e.g. America/New_York) for time_local on read results. Unset means UTC only.",