@chrischall/microsoft-teams-mcp 0.8.0 → 0.8.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.8.0"
10
+ "version": "0.8.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.8.0",
18
+ "version": "0.8.1",
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.0",
4
+ "version": "0.8.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
@@ -392,9 +392,11 @@ Everything is optional — by default the token is captured from your browser.
392
392
  `after_message_id` — **not** `next_cursor`, which is a time token that only
393
393
  `teams_list_changed_conversations` accepts (`teams_list_messages` rejects it, and
394
394
  `teams_list_changed_conversations` rejects a message id). `view: "brief"`
395
- answers plain text instead, one line per changed conversation —
396
- `title — <newest ISO time | no date> — <n> new, <m> from others` (or
397
- `could not read`), at most 120 characters — the shape mcp-host's context
395
+ answers lines instead, inside the untrusted-data envelope as
396
+ `data: string[]`, one per changed conversation —
397
+ `title — <newest ISO time | no date> — <n> new, <m> from others`, at most
398
+ 120 characters, plus `-- none` when nothing is new and `-- error: …` when
399
+ some conversations could not be read — the shape mcp-host's context
398
400
  groups read (this is the work group's canonical *what's new*):
399
401
 
400
402
  ```jsonc
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.0";
38394
+ VERSION = "0.8.1";
38395
38395
  }
38396
38396
  });
38397
38397
 
@@ -53093,12 +53093,17 @@ function briefStatus(read) {
53093
53093
  function briefLine(title, time3, status) {
53094
53094
  const tail = ` \u2014 ${time3 ?? "no date"} \u2014 ${status}`;
53095
53095
  const flat = title.replace(/\s+/g, " ").trim() || "(untitled)";
53096
+ const escaped = flat.startsWith("-- ") || flat.startsWith("\\") ? `\\${flat}` : flat;
53096
53097
  const room = BRIEF_MAX - tail.length;
53097
- const shown2 = flat.length > room ? `${flat.slice(0, Math.max(room - 1, 0)).trimEnd()}\u2026` : flat;
53098
+ const shown2 = escaped.length > room ? `${escaped.slice(0, Math.max(room - 1, 0)).trimEnd()}\u2026` : escaped;
53098
53099
  return `${shown2}${tail}`;
53099
53100
  }
53100
- function briefResult(lines) {
53101
- return { content: [{ type: "text", text: lines.join("\n") }] };
53101
+ var BRIEF_NOTE = `Conversation titles below are set by other people in Microsoft Teams. ${UNTRUSTED_CONTENT_RULE}`;
53102
+ function briefResult(lines, failed) {
53103
+ const out = [...lines];
53104
+ if (failed > 0) out.push(`-- error: ${failed} conversation${failed === 1 ? "" : "s"} could not be read.`);
53105
+ if (out.length === 0) out.push("-- none");
53106
+ return { content: [{ type: "text", text: JSON.stringify(untrustedEnvelope(out, { note: BRIEF_NOTE })) }] };
53102
53107
  }
53103
53108
  function registerChangesTools(server, { chatsvc }) {
53104
53109
  server.registerTool(
@@ -53123,7 +53128,7 @@ function registerChangesTools(server, { chatsvc }) {
53123
53128
  ),
53124
53129
  limit: limitArg(MAX_CONVERSATIONS3, "conversations", "most recent activity first kept"),
53125
53130
  view: external_exports.enum(["full", "brief"]).optional().describe(
53126
- '"full" (default) returns the result described above; "brief" returns plain text, one line per changed conversation (limit does not apply): title \u2014 newest_time (ISO 8601, or "no date") \u2014 "<n> new, <m> from others", or "could not read" for a conversation whose read failed.'
53131
+ '"full" (default) returns the result described above; "brief" returns the untrusted-data envelope with data: one line per changed conversation (limit does not apply): title \u2014 newest_time (ISO 8601, or "no date") \u2014 "<n> new, <m> from others". A line starting "-- " is a note: "-- none" when nothing is new, "-- error: \u2026" when some conversations could not be read.'
53127
53132
  )
53128
53133
  }
53129
53134
  },
@@ -53186,10 +53191,10 @@ function registerChangesTools(server, { chatsvc }) {
53186
53191
  after_message_id
53187
53192
  }));
53188
53193
  if (view === "brief") {
53189
- return briefResult([
53190
- ...changed.map(({ read }, i) => briefLine(titled[i].title, read.newestTime, briefStatus(read))),
53191
- ...failed.map((_, i) => briefLine(titled[changed.length + i].title, void 0, "could not read"))
53192
- ]);
53194
+ return briefResult(
53195
+ changed.map(({ read }, i) => briefLine(titled[i].title, read.newestTime, briefStatus(read))),
53196
+ failed.length
53197
+ );
53193
53198
  }
53194
53199
  const errors = failed.map((f, i) => ({
53195
53200
  conversation: titled[changed.length + i],
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { mapWithConcurrency, McpToolError, toolAnnotations } from '@chrischall/mcp-utils';
2
+ import { mapWithConcurrency, McpToolError, toolAnnotations, UNTRUSTED_CONTENT_RULE, untrustedEnvelope, } from '@chrischall/mcp-utils';
3
3
  import { conversationSummary, changedMs, isUserMessage, lastChangeMs, normaliseMessage, } from '../model.js';
4
4
  import { isUnreachable } from './confirm.js';
5
5
  import { includeHiddenArg } from './listing.js';
@@ -105,23 +105,36 @@ function briefStatus(read) {
105
105
  }
106
106
  /**
107
107
  * One brief line, `title — <ISO date | no date> — <status>`, at most
108
- * {@link BRIEF_MAX} characters: the title is flattened to one line (a chat
109
- * topic can carry newlines) and shortened, never the date or the status.
108
+ * {@link BRIEF_MAX} characters as a WHOLE: the title is flattened to one line
109
+ * (a chat topic can carry newlines) and shortened first, never the date or the
110
+ * status (both are this MCP's own and short). A title that starts with `-- `
111
+ * or `\` is escaped with one leading `\`, so a topic someone set can never
112
+ * read as a note line (the consolidated brief-view contract; the gateway
113
+ * strips that one backslash).
110
114
  */
111
115
  export function briefLine(title, time, status) {
112
116
  const tail = ` — ${time ?? 'no date'} — ${status}`;
113
117
  const flat = title.replace(/\s+/g, ' ').trim() || '(untitled)';
118
+ const escaped = flat.startsWith('-- ') || flat.startsWith('\\') ? `\\${flat}` : flat;
114
119
  const room = BRIEF_MAX - tail.length;
115
- const shown = flat.length > room ? `${flat.slice(0, Math.max(room - 1, 0)).trimEnd()}…` : flat;
120
+ const shown = escaped.length > room ? `${escaped.slice(0, Math.max(room - 1, 0)).trimEnd()}…` : escaped;
116
121
  return `${shown}${tail}`;
117
122
  }
123
+ /** Who writes a brief line's third-party text: the note the envelope carries ahead of it. */
124
+ const BRIEF_NOTE = `Conversation titles below are set by other people in Microsoft Teams. ${UNTRUSTED_CONTENT_RULE}`;
118
125
  /**
119
- * The brief answer as plain text, one line per item. It carries no message
120
- * text — only conversation titles (which other people can set), counts and
121
- * times — and the tool's description keeps the untrusted-content warning.
126
+ * The brief answer: its lines inside the fleet untrusted-data envelope as
127
+ * `data: string[]`, minified, note first — the titles are chat topics and
128
+ * participant names other people set. A line starting `-- ` is a note:
129
+ * `-- none` when nothing is new, `-- error: …` when some reads failed.
122
130
  */
123
- function briefResult(lines) {
124
- return { content: [{ type: 'text', text: lines.join('\n') }] };
131
+ function briefResult(lines, failed) {
132
+ const out = [...lines];
133
+ if (failed > 0)
134
+ out.push(`-- error: ${failed} conversation${failed === 1 ? '' : 's'} could not be read.`);
135
+ if (out.length === 0)
136
+ out.push('-- none');
137
+ return { content: [{ type: 'text', text: JSON.stringify(untrustedEnvelope(out, { note: BRIEF_NOTE })) }] };
125
138
  }
126
139
  export function registerChangesTools(server, { chatsvc }) {
127
140
  server.registerTool('teams_list_changed_conversations', {
@@ -173,9 +186,10 @@ export function registerChangesTools(server, { chatsvc }) {
173
186
  view: z
174
187
  .enum(['full', 'brief'])
175
188
  .optional()
176
- .describe('"full" (default) returns the result described above; "brief" returns plain text, one line per ' +
177
- 'changed conversation (limit does not apply): title — newest_time (ISO 8601, or "no date") — ' +
178
- '"<n> new, <m> from others", or "could not read" for a conversation whose read failed.'),
189
+ .describe('"full" (default) returns the result described above; "brief" returns the untrusted-data ' +
190
+ 'envelope with data: one line per changed conversation (limit does not apply): title — ' +
191
+ 'newest_time (ISO 8601, or "no date") — "<n> new, <m> from others". A line starting "-- " is ' +
192
+ 'a note: "-- none" when nothing is new, "-- error: …" when some conversations could not be read.'),
179
193
  },
180
194
  }, async ({ cursor, kinds, include_hidden, limit, view }) => {
181
195
  try {
@@ -251,10 +265,7 @@ export function registerChangesTools(server, { chatsvc }) {
251
265
  after_message_id,
252
266
  }));
253
267
  if (view === 'brief') {
254
- return briefResult([
255
- ...changed.map(({ read }, i) => briefLine(titled[i].title, read.newestTime, briefStatus(read))),
256
- ...failed.map((_, i) => briefLine(titled[changed.length + i].title, undefined, 'could not read')),
257
- ]);
268
+ return briefResult(changed.map(({ read }, i) => briefLine(titled[i].title, read.newestTime, briefStatus(read))), failed.length);
258
269
  }
259
270
  const errors = failed.map((f, i) => ({
260
271
  conversation: titled[changed.length + i],
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.0'; // x-release-please-version
13
+ export const VERSION = '0.8.1'; // 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.0",
3
+ "version": "0.8.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>",
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.0",
9
+ "version": "0.8.1",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/microsoft-teams-mcp",
14
- "version": "0.8.0",
14
+ "version": "0.8.1",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -104,7 +104,9 @@ read is **`teams_list_changed_conversations`** for *what's new*: no subject
104
104
  (Teams serves one signed-in account) and no range (it takes a cursor; none
105
105
  means the last 24 hours). With `view: "brief"` it answers one line per
106
106
  changed chat or channel — `title — <newest ISO time | no date> — <n> new,
107
- <m> from others`. There is no *what's due* or *what's on* read here (Teams'
107
+ <m> from others` — inside the untrusted-data envelope as `data: string[]`
108
+ (titles are set by other people), with `-- none` when nothing is new and
109
+ `-- error: …` when some conversations could not be read. There is no *what's due* or *what's on* read here (Teams'
108
110
  Calendar is Outlook's). A compound ask such as "anything new in Teams, and
109
111
  what's on my calendar today?" is answered by the work group fanning out to
110
112
  this read and the Outlook one. The group needs the signed-in Teams tab: with