@chrischall/microsoft-teams-mcp 0.8.1 → 0.8.3

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.8.1"
10
+ "version": "0.8.3"
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.8.1",
18
+ "version": "0.8.3",
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.8.1",
4
+ "version": "0.8.3",
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
@@ -522,10 +522,12 @@ Everything is optional — by default the token is captured from your browser.
522
522
  and between pages of a read: a long read past it is dropped and redone by
523
523
  the next call (except the first conversation of a call, which always
524
524
  finishes, so every call makes progress). Conversations are exported in id
525
- order; the cursor normally lists the ones still to do, but when that list is
526
- too long for a cursor it holds only the id to go on from, and the next call
527
- re-lists conversations from there — so a conversation that first appears
528
- between calls with an id before that point is not in this export. A
525
+ order, and the cursor holds only the id to go on from (so it stays short
526
+ however many conversations remain): the next call re-lists conversations
527
+ from there, so a conversation that first appears between calls is in this
528
+ export only if its id sorts after that point. An export of named
529
+ `conversations` instead keeps the ids they resolved to, so a resume never
530
+ resolves the names again. A
529
531
  rejected credential, rate limiting that
530
532
  outlasts three backed-off retries, or a Teams-side failure stops the call
531
533
  early with a cursor, keeping what was written (re-authenticate and resume);
package/dist/bundle.js CHANGED
@@ -38391,7 +38391,7 @@ var init_version = __esm({
38391
38391
  "src/version.ts"() {
38392
38392
  "use strict";
38393
38393
  PACKAGE_NAME = "microsoft-teams-mcp";
38394
- VERSION = "0.8.1";
38394
+ VERSION = "0.8.3";
38395
38395
  }
38396
38396
  });
38397
38397
 
@@ -50592,7 +50592,7 @@ var ChatServiceClient = class {
50592
50592
  * id of the vetted shape, never taken from message content, so the bearer
50593
50593
  * only ever goes to the Teams gateway. Served even when the meeting's
50594
50594
  * organizer disabled transcript download (verified live 2026-11-04). A 404 is
50595
- * a transcript the store no longer holds (it expires after some weeks).
50595
+ * a transcript the store no longer holds (it expires after about four weeks).
50596
50596
  */
50597
50597
  async fetchTranscript(objectId) {
50598
50598
  this.#requireConfigured();
@@ -50606,7 +50606,7 @@ var ChatServiceClient = class {
50606
50606
  throw new McpToolError("This transcript is no longer available from Teams (404): it has expired or was removed.", {
50607
50607
  status,
50608
50608
  kind: "http",
50609
- hint: "Teams' own copy of a transcript expires after some weeks. The recording's play_url may still open it in the browser if the organizer kept the recording."
50609
+ hint: "Teams' own copy of a transcript expires after about four weeks. The recording's play_url may still open it in the browser if the organizer kept the recording."
50610
50610
  });
50611
50611
  }
50612
50612
  this.#checkStatus(status);
@@ -55332,11 +55332,16 @@ async function runExport({ chatsvc, sharepoint }, input2, opts) {
55332
55332
  args,
55333
55333
  ...stopPos !== void 0 ? { pos: stopPos } : {}
55334
55334
  };
55335
- try {
55336
- cursor = encodeExportCursor({ ...base, ids: queue });
55337
- } catch (err) {
55338
- if (!(err instanceof TypeError)) throw err;
55339
- cursor = encodeExportCursor({ ...base, from_id: queue[0] });
55335
+ const fromId = encodeExportCursor({ ...base, from_id: queue[0] });
55336
+ if (args.conversations === void 0) {
55337
+ cursor = fromId;
55338
+ } else {
55339
+ try {
55340
+ cursor = encodeExportCursor({ ...base, ids: queue });
55341
+ } catch (err) {
55342
+ if (!(err instanceof TypeError)) throw err;
55343
+ cursor = fromId;
55344
+ }
55340
55345
  }
55341
55346
  } else {
55342
55347
  hasMore = false;
@@ -55383,7 +55388,7 @@ function registerExportTools(server, deps2, opts = {}) {
55383
55388
  "teams_export_messages",
55384
55389
  {
55385
55390
  title: "Export Teams chats and channels to files",
55386
- description: `Bulk-export the messages of chats and channels to files \u2014 for archiving, or to search or analyse thousands of messages with shell tools \u2014 without any message text entering this conversation. The result holds no message content: only where the files are (on a local install, absolute paths in a fresh folder under dest, else ${EXPORT_OUTPUT_ENV}, else ~/Downloads/${EXPORT_SERVER_NAME}; on a hosted install, a signed download link to a zip that expires, url_expires_at), each file's size and record count, counts, the time span, errors, and has_more / cursor. One file per conversation, named after it (an untitled group chat after its participants), plus a manifest; JSONL by default (a header record with the export's details and an untrusted-content note, then one record per message, oldest first, each with its conversation's id, kind, title, team and \u2014 for chats \u2014 participants), or format "markdown" for readable transcripts (a channel threaded under its root posts). Use jq, grep or rg on the files rather than reading them whole. conversations names chats/channels by id or name (omit for every one), kinds narrows to chat / channel / meeting, since and until bound messages by arrival (default: all history). Each call stops at max_items messages (default ${DEFAULT_MAX_ITEMS}, max ${MAX_ITEMS}) or budget_seconds (default ${DEFAULT_BUDGET_SECONDS}, max ${MAX_BUDGET_SECONDS}); when has_more is true pass cursor back (alone, or with max_items / budget_seconds) to continue the same export into the same folder (a hosted install returns a new link per part). A cursor too long to list every remaining conversation resumes from an id instead, so a conversation that first appears between parts may be left out. A rejected credential or persistent rate limiting stops early with a cursor and keeps what was written; a conversation that cannot be read is listed in errors and skipped. Never marks anything read. A name matching several conversations returns {ambiguous: true, candidates} and writes nothing. With attachments true, inline images and shared files (up to 25 MB) are saved under attachments/<conversation>/<message id>-<name> and each message's record lists them by that path relative to the export folder; one that cannot be fetched (a SharePoint file the account cannot open, no token yet, too large) is listed as skipped with the reason, never failing the export.` + UNTRUSTED_DESCRIPTION_SUFFIX2,
55391
+ description: `Bulk-export the messages of chats and channels to files \u2014 for archiving, or to search or analyse thousands of messages with shell tools \u2014 without any message text entering this conversation. The result holds no message content: only where the files are (on a local install, absolute paths in a fresh folder under dest, else ${EXPORT_OUTPUT_ENV}, else ~/Downloads/${EXPORT_SERVER_NAME}; on a hosted install, a signed download link to a zip that expires, url_expires_at), each file's size and record count, counts, the time span, errors, and has_more / cursor. One file per conversation, named after it (an untitled group chat after its participants), plus a manifest; JSONL by default (a header record with the export's details and an untrusted-content note, then one record per message, oldest first, each with its conversation's id, kind, title, team and \u2014 for chats \u2014 participants), or format "markdown" for readable transcripts (a channel threaded under its root posts). Use jq, grep or rg on the files rather than reading them whole. conversations names chats/channels by id or name (omit for every one), kinds narrows to chat / channel / meeting, since and until bound messages by arrival (default: all history). Each call stops at max_items messages (default ${DEFAULT_MAX_ITEMS}, max ${MAX_ITEMS}) or budget_seconds (default ${DEFAULT_BUDGET_SECONDS}, max ${MAX_BUDGET_SECONDS}); when has_more is true pass cursor back (alone, or with max_items / budget_seconds) to continue the same export into the same folder (a hosted install returns a new link per part). Conversations are exported in id order and a cursor resumes from an id, so a conversation that first appears between parts is included only if it sorts after that point. A rejected credential or persistent rate limiting stops early with a cursor and keeps what was written; a conversation that cannot be read is listed in errors and skipped. Never marks anything read. A name matching several conversations returns {ambiguous: true, candidates} and writes nothing. With attachments true, inline images and shared files (up to 25 MB) are saved under attachments/<conversation>/<message id>-<name> and each message's record lists them by that path relative to the export folder; one that cannot be fetched (a SharePoint file the account cannot open, no token yet, too large) is listed as skipped with the reason, never failing the export.` + UNTRUSTED_DESCRIPTION_SUFFIX2,
55387
55392
  annotations: toolAnnotations({ readOnly: true, openWorld: true }),
55388
55393
  _meta: workMeta("other", { aliases: ["export", "save the chat", "chat history"] }),
55389
55394
  inputSchema: {
@@ -55429,7 +55434,7 @@ function registerTranscriptTools(server, { chatsvc }) {
55429
55434
  "teams_get_transcript",
55430
55435
  {
55431
55436
  title: "Get a Teams meeting transcript",
55432
- description: `Get the transcript of a recorded Teams meeting from its meeting chat (by id or by name, as teams_list_conversations lists it). Works even when the organizer disabled transcript download: it reads Teams' own copy, the one the Recap tab shows. Returns the newest transcribed recording unless recording_id names another (other_recordings lists the rest, newest first): its time, duration and play_url, the speakers, and the transcript \u2014 format "text" (default: one line per speaker turn, "[hh:mm:ss] Name: words") or "vtt" (the WebVTT as Teams serves it). A transcript longer than ${MAX_INLINE_CHARS.toLocaleString("en-US")} characters is cut short (truncated: true). save: true writes <meeting>-<time>.vtt and .txt instead (on a local install into a fresh folder under dest, else ${EXPORT_OUTPUT_ENV}, else ~/Downloads/${EXPORT_SERVER_NAME}; on a hosted install as a zip behind a signed link) and returns where. Teams' copy expires after some weeks: an expired one is an error, not another recording. Does not mark anything read.` + UNTRUSTED_DESCRIPTION_SUFFIX2,
55437
+ description: `Get the transcript of a recorded Teams meeting from its meeting chat (by id or by name, as teams_list_conversations lists it). Works even when the organizer disabled transcript download: it reads Teams' own copy, the one the Recap tab shows. Returns the newest transcribed recording unless recording_id names another (other_recordings lists the rest, newest first): its time, duration and play_url, the speakers, and the transcript \u2014 format "text" (default: one line per speaker turn, "[hh:mm:ss] Name: words") or "vtt" (the WebVTT as Teams serves it). A transcript longer than ${MAX_INLINE_CHARS.toLocaleString("en-US")} characters is cut short (truncated: true). save: true writes <meeting>-<time>.vtt and .txt instead (on a local install into a fresh folder under dest, else ${EXPORT_OUTPUT_ENV}, else ~/Downloads/${EXPORT_SERVER_NAME}; on a hosted install as a zip behind a signed link) and returns where. Teams' copy expires after about four weeks: an expired one is an error naming the recording, its play_url and the others, not another recording. Does not mark anything read.` + UNTRUSTED_DESCRIPTION_SUFFIX2,
55433
55438
  _meta: workMeta("lookup", { aliases: ["transcript", "meeting transcript", "recording", "recap", "vtt", "what was said"] }),
55434
55439
  // save writes a local file the user asked for; nothing in Teams changes.
55435
55440
  annotations: toolAnnotations({ readOnly: true, openWorld: true }),
@@ -55464,10 +55469,16 @@ function registerTranscriptTools(server, { chatsvc }) {
55464
55469
  });
55465
55470
  }
55466
55471
  }
55467
- const vtt = await chatsvc.fetchTranscript(chosen.object_id);
55472
+ const picked = chosen;
55473
+ const others = recordings.filter((r) => r !== picked).slice(0, MAX_OTHERS).map(shown);
55474
+ let vtt;
55475
+ try {
55476
+ vtt = await chatsvc.fetchTranscript(picked.object_id);
55477
+ } catch (err) {
55478
+ throw errorStatusOf(err) === 404 ? expiredError(summary.title, picked, others, err) : err;
55479
+ }
55468
55480
  const cues = parseVtt(vtt);
55469
55481
  const text = renderTranscriptText(cues);
55470
- const others = recordings.filter((r) => r !== chosen).slice(0, MAX_OTHERS).map(shown);
55471
55482
  const base = {
55472
55483
  conversation: summary.id,
55473
55484
  title: summary.title,
@@ -55515,6 +55526,20 @@ function registerTranscriptTools(server, { chatsvc }) {
55515
55526
  }
55516
55527
  );
55517
55528
  }
55529
+ function expiredError(chatTitle, r, others, cause) {
55530
+ const which = `recording ${r.message_id} (${r.time})`;
55531
+ const play = r.play_url !== void 0 ? ` Open the recording in the browser instead: ${r.play_url}` : "";
55532
+ const rest = others.length > 0 ? ` Other recordings in this chat, newest first (pass one as recording_id): ${others.map((o) => `${o.recording_id} (${o.time})`).join(", ")}.` : "";
55533
+ return new McpToolError(
55534
+ `The transcript of ${which} in "${chatTitle}" is no longer available from Teams (404): it has expired or was removed.`,
55535
+ {
55536
+ status: 404,
55537
+ kind: "http",
55538
+ hint: `Teams keeps its own copy of a transcript for about four weeks.${play}${rest}`,
55539
+ cause
55540
+ }
55541
+ );
55542
+ }
55518
55543
  function recordingObjectOf(messages, id) {
55519
55544
  const m = messages.find((x) => x.id === id);
55520
55545
  return m === void 0 ? void 0 : parseRecording(m)?.object_id;
package/dist/chatsvc.js CHANGED
@@ -405,7 +405,7 @@ export class ChatServiceClient {
405
405
  * id of the vetted shape, never taken from message content, so the bearer
406
406
  * only ever goes to the Teams gateway. Served even when the meeting's
407
407
  * organizer disabled transcript download (verified live 2026-11-04). A 404 is
408
- * a transcript the store no longer holds (it expires after some weeks).
408
+ * a transcript the store no longer holds (it expires after about four weeks).
409
409
  */
410
410
  async fetchTranscript(objectId) {
411
411
  this.#requireConfigured();
@@ -419,7 +419,7 @@ export class ChatServiceClient {
419
419
  throw new McpToolError('This transcript is no longer available from Teams (404): it has expired or was removed.', {
420
420
  status,
421
421
  kind: 'http',
422
- hint: "Teams' own copy of a transcript expires after some weeks. The recording's play_url may still open it " +
422
+ hint: "Teams' own copy of a transcript expires after about four weeks. The recording's play_url may still open it " +
423
423
  'in the browser if the organizer kept the recording.',
424
424
  });
425
425
  }
@@ -16,10 +16,12 @@
16
16
  * `budget_seconds`, whichever comes first, and returns `has_more` with a
17
17
  * `cursor`; passing the cursor back continues the SAME export (the same
18
18
  * directory on disk, the next `part-NNNN.zip` in the blob store). The cursor
19
- * carries the original arguments, the conversations still to do (or, when
20
- * that list is too long for a cursor, the id to go on from — conversations
21
- * are exported in id order; a conversation new since the first part with an
22
- * id before that point is then not exported), and where in the current
19
+ * carries the original arguments, what is still to do — for an export of
20
+ * named conversations the ids they resolved to; otherwise (or when that list
21
+ * is too long for a cursor) only the id to go on from, so the cursor stays
22
+ * short: conversations are exported in id order and the next part re-lists
23
+ * them from there, so one that first appears between parts is exported only
24
+ * if its id sorts after that point — and where in the current
23
25
  * conversation it stopped, as a `from.ts` position. The budget is checked
24
26
  * between conversations and between pages of a read; a read cut by it is
25
27
  * redone whole by the next part, except the first conversation of a call,
@@ -426,13 +428,22 @@ async function runExport({ chatsvc, sharepoint }, input, opts) {
426
428
  args,
427
429
  ...(stopPos !== undefined ? { pos: stopPos } : {}),
428
430
  };
429
- try {
430
- cursor = encodeExportCursor({ ...base, ids: queue });
431
+ // A whole-account export re-lists on resume, so it goes on from an id: the cursor stays
432
+ // short however many conversations remain. A named one keeps the conversations its names
433
+ // resolved to (a short list), so a resume never resolves them again.
434
+ const fromId = encodeExportCursor({ ...base, from_id: queue[0] });
435
+ if (args.conversations === undefined) {
436
+ cursor = fromId;
431
437
  }
432
- catch (err) {
433
- if (!(err instanceof TypeError))
434
- throw err;
435
- cursor = encodeExportCursor({ ...base, from_id: queue[0] });
438
+ else {
439
+ try {
440
+ cursor = encodeExportCursor({ ...base, ids: queue });
441
+ }
442
+ catch (err) {
443
+ if (!(err instanceof TypeError))
444
+ throw err;
445
+ cursor = fromId;
446
+ }
436
447
  }
437
448
  }
438
449
  else {
@@ -488,8 +499,8 @@ export function registerExportTools(server, deps, opts = {}) {
488
499
  `(default ${DEFAULT_MAX_ITEMS}, max ${MAX_ITEMS}) or budget_seconds (default ${DEFAULT_BUDGET_SECONDS}, ` +
489
500
  `max ${MAX_BUDGET_SECONDS}); when has_more is true pass cursor back (alone, or with max_items / ` +
490
501
  'budget_seconds) to continue the same export into the same folder (a hosted install returns a new link ' +
491
- 'per part). A cursor too long to list every remaining conversation resumes from an id instead, so a ' +
492
- 'conversation that first appears between parts may be left out. A rejected credential or persistent rate limiting stops early with a cursor and keeps what ' +
502
+ 'per part). Conversations are exported in id order and a cursor resumes from an id, so a ' +
503
+ 'conversation that first appears between parts is included only if it sorts after that point. A rejected credential or persistent rate limiting stops early with a cursor and keeps what ' +
493
504
  'was written; a conversation that cannot be read is listed in errors and skipped. Never marks anything ' +
494
505
  'read. A name matching several conversations returns {ambiguous: true, candidates} and writes nothing. ' +
495
506
  'With attachments true, inline images and shared files (up to 25 MB) are saved under ' +
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { McpToolError, currentCallSignal, toolAnnotations } from '@chrischall/mcp-utils';
2
+ import { McpToolError, currentCallSignal, errorStatusOf, toolAnnotations } from '@chrischall/mcp-utils';
3
3
  import { openExportSink, sanitizeExportFileName } from '@chrischall/mcp-utils/export';
4
4
  import { listRecordings, parseRecording, parseVtt, renderTranscriptText, transcriptSpeakers } from '../transcript.js';
5
5
  import { AmbiguousConversationError, ambiguousResult, resolveListed } from './conversation.js';
@@ -30,7 +30,7 @@ export function registerTranscriptTools(server, { chatsvc }) {
30
30
  `${MAX_INLINE_CHARS.toLocaleString('en-US')} characters is cut short (truncated: true). save: true writes ` +
31
31
  `<meeting>-<time>.vtt and .txt instead (on a local install into a fresh folder under dest, else ${EXPORT_OUTPUT_ENV}, ` +
32
32
  `else ~/Downloads/${EXPORT_SERVER_NAME}; on a hosted install as a zip behind a signed link) and returns where. ` +
33
- "Teams' copy expires after some weeks: an expired one is an error, not another recording. " +
33
+ "Teams' copy expires after about four weeks: an expired one is an error naming the recording, its play_url and the others, not another recording. " +
34
34
  'Does not mark anything read.' +
35
35
  UNTRUSTED_DESCRIPTION_SUFFIX,
36
36
  _meta: workMeta('lookup', { aliases: ['transcript', 'meeting transcript', 'recording', 'recap', 'vtt', 'what was said'] }),
@@ -84,10 +84,17 @@ export function registerTranscriptTools(server, { chatsvc }) {
84
84
  });
85
85
  }
86
86
  }
87
- const vtt = await chatsvc.fetchTranscript(chosen.object_id);
87
+ const picked = chosen;
88
+ const others = recordings.filter((r) => r !== picked).slice(0, MAX_OTHERS).map(shown);
89
+ let vtt;
90
+ try {
91
+ vtt = await chatsvc.fetchTranscript(picked.object_id);
92
+ }
93
+ catch (err) {
94
+ throw errorStatusOf(err) === 404 ? expiredError(summary.title, picked, others, err) : err;
95
+ }
88
96
  const cues = parseVtt(vtt);
89
97
  const text = renderTranscriptText(cues);
90
- const others = recordings.filter((r) => r !== chosen).slice(0, MAX_OTHERS).map(shown);
91
98
  const base = {
92
99
  conversation: summary.id,
93
100
  title: summary.title,
@@ -137,6 +144,28 @@ export function registerTranscriptTools(server, { chatsvc }) {
137
144
  }
138
145
  });
139
146
  }
147
+ /**
148
+ * A 404 for `r`'s transcript, naming what the caller cannot otherwise see: which
149
+ * recording was tried (the default is the newest, never stated in the call), its
150
+ * play_url — the one way left to the recording — and the chat's other recordings.
151
+ * Expiry is not worked out from the time: the store's window was observed, not
152
+ * documented, so the others are listed for the caller to try.
153
+ */
154
+ function expiredError(chatTitle, r, others, cause) {
155
+ const which = `recording ${r.message_id} (${r.time})`;
156
+ const play = r.play_url !== undefined ? ` Open the recording in the browser instead: ${r.play_url}` : '';
157
+ const rest = others.length > 0
158
+ ? ` Other recordings in this chat, newest first (pass one as recording_id): ${others
159
+ .map((o) => `${o.recording_id} (${o.time})`)
160
+ .join(', ')}.`
161
+ : '';
162
+ return new McpToolError(`The transcript of ${which} in "${chatTitle}" is no longer available from Teams (404): it has expired or was removed.`, {
163
+ status: 404,
164
+ kind: 'http',
165
+ hint: `Teams keeps its own copy of a transcript for about four weeks.${play}${rest}`,
166
+ cause,
167
+ });
168
+ }
140
169
  /** The object id of the recording message `id`, if it is one (any of a chunk's messages names it). */
141
170
  function recordingObjectOf(messages, id) {
142
171
  const m = messages.find((x) => x.id === id);
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.8.1'; // x-release-please-version
13
+ export const VERSION = '0.8.3'; // x-release-please-version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/microsoft-teams-mcp",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
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>",
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.8.1",
9
+ "version": "0.8.3",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/microsoft-teams-mcp",
14
- "version": "0.8.1",
14
+ "version": "0.8.3",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },