@chrischall/microsoft-teams-mcp 0.8.7 → 0.10.0

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.7"
10
+ "version": "0.10.0"
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.7",
18
+ "version": "0.10.0",
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.7",
4
+ "version": "0.10.0",
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
@@ -36,7 +36,10 @@ By default nothing here marks anything read. Reading a chat through this
36
36
  server leaves your Teams unread badges exactly as they were — unless you ask
37
37
  for it: `teams_mark_read`, or `mark_read: true` on `teams_list_messages`
38
38
  / `teams_list_unread_messages`, moves your read marker forward. The writes —
39
- `teams_send_message`, `teams_react` and marking read — go through the same
39
+ `teams_send_message`, `teams_react`, marking read, renaming a group chat
40
+ or adding and removing its members (`teams_rename_chat`,
41
+ `teams_add_chat_members`, `teams_remove_chat_members`), and starting a new
42
+ one (`teams_create_group_chat`) — go through the same
40
43
  chat-service API and change nothing until you confirm (see
41
44
  [Writes](#writes)).
42
45
 
@@ -47,7 +50,8 @@ and approving a grant replaces the stored list of header captures. So all of
47
50
  this server's captures (chat service, SharePoint, Substrate search) declare the
48
51
  **same** scope: the three domains `teams.cloud.microsoft`, `sharepoint.com` and
49
52
  `substrate.office.com`, plus the chat-service and search captures and one
50
- capture per SharePoint host the server has already captured from. Each capture
53
+ capture per SharePoint host the server has already captured from (usually just
54
+ your own OneDrive host — see [SharePoint file download](#sharepoint-file-download)). Each capture
51
55
  still reads only the one header it needs. The SharePoint hosts are remembered
52
56
  in `~/.microsoft-teams-mcp/bridge-scope.json` (beside the SharePoint token
53
57
  cache; not written with `TEAMS_TOKEN_CACHE=false`) once a capture from them
@@ -78,17 +82,28 @@ Two things follow from that:
78
82
  `teams.cloud.microsoft`, `sharepoint.com` and `substrate.office.com`, and the
79
83
  same list of header captures. So approving `microsoft-teams-mcp` once covers
80
84
  all three, and moving between chats, files and search never asks again (see
81
- [Pairing](#pairing)). The first file from a new SharePoint host asks once to
82
- grant that host's capture.
83
- - **Open the file once per SharePoint host.** The SharePoint token is captured
84
- from the browser's own request to the file's SharePoint host, is short-lived
85
- (~53 minutes), and is scoped to one host family. So the first file from a
86
- given host in a session may need you to reload a signed-in Teams tab (the
87
- requests it makes while loading are what the token is read from; opening a
88
- file does not reliably make one); after that the token is
89
- cached and refreshed until it expires. A file your account cannot open, or on
90
- a SharePoint host your token does not cover, comes back as metadata and its
91
- open link rather than failing.
85
+ [Pairing](#pairing)). The very first download asks once to grant the capture
86
+ from your OneDrive host.
87
+ - **One token serves every SharePoint host.** The SharePoint token is captured
88
+ from a request your Teams tab makes to your own OneDrive host
89
+ (`<tenant>-my.sharepoint.com`), and SharePoint accepts it on every host of the
90
+ tenant: colleagues' OneDrives in other regions and team sites alike. So you
91
+ never need to open a file in Teams before downloading it. The first download,
92
+ and the first after the short-lived token expires, may need you to reload a
93
+ signed-in Teams tab (the requests it makes while loading are what the token
94
+ is read from); after that the token is cached until it expires. If the bridge
95
+ has not yet granted a SharePoint host, the download says so: approve the
96
+ pending scope update for `microsoft-teams-mcp` in the ContextMint Bridge
97
+ popup (no need to remove or re-pair it) and retry.
98
+ - **A file your account cannot open** (SharePoint answers 403) comes back as
99
+ metadata and its open link rather than failing.
100
+
101
+ `ref` matches an attachment ignoring case, and a file without its extension
102
+ (`report` finds `report.csv`); a name that matches two attachments is refused
103
+ with both listed. `save: true` writes the attachment to a fresh file in the
104
+ same folder `teams_export_messages` uses — `TEAMS_OUTPUT_DIR`, else
105
+ `~/Downloads/microsoft-teams-mcp` — and returns its `path` instead of the
106
+ contents (a download link on a hosted install, whose disk you cannot reach).
92
107
 
93
108
  ## Substrate search
94
109
 
@@ -112,6 +127,12 @@ read only from the request header, never from page storage.
112
127
  another capture for 10 minutes. `mode: "substrate"` fails instead;
113
128
  `mode: "scan"` never touches Substrate.
114
129
 
130
+ - **It also finds people.** `teams_add_chat_members`,
131
+ `teams_remove_chat_members` and `teams_create_group_chat` use the same token to look a person up in your
132
+ organisation's directory (Substrate's people suggestions) when a name is not
133
+ in your chats, or when you pass an email address. A lookup is an explicit
134
+ request, so it always tries a fresh capture rather than honouring the
135
+ 10-minute cooldown below.
115
136
  - **It does not re-capture in a loop.** If a freshly captured token is still
116
137
  refused (401), the same 10-minute cooldown applies, so `auto` goes straight
117
138
  to the scan instead of waiting on the bridge every call.
@@ -190,9 +211,9 @@ Everything is optional — by default the token is captured from your browser.
190
211
  | `TEAMS_TOKEN_CACHE` | `false` to keep the captured token in memory only. Defaults to on. |
191
212
  | `TEAMS_TOKEN_FILE` | Where the captured token is cached. Defaults to `~/.microsoft-teams-mcp/token.json`. |
192
213
  | `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. |
193
- | `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. |
214
+ | `TEAMS_SHAREPOINT_TOKEN_FILE` | Where the captured SharePoint token (one for every SharePoint host, used to download shared files) is cached. Defaults to `~/.microsoft-teams-mcp/sharepoint-tokens.json`. `TEAMS_TOKEN_CACHE=false` keeps them in memory too. |
194
215
  | `TEAMS_TIME_ZONE` | Default IANA time zone (e.g. `America/New_York`) for the `tz` argument of `teams_list_messages` and `teams_list_unread_messages`: 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. |
195
- | `TEAMS_OUTPUT_DIR` | Folder `teams_export_messages` (and `teams_get_transcript` with `save`) writes into (each export gets its own timestamped subfolder). Defaults to `~/Downloads/microsoft-teams-mcp`. When set, a per-call `dest` must lie inside it; when unset, `dest` must be under `~/Downloads`, `~/Documents` or `~/Desktop`. |
216
+ | `TEAMS_OUTPUT_DIR` | Folder `teams_export_messages` (and `teams_get_transcript` with `save`, and `teams_get_attachment` with `save` or for a file over 10 MiB) writes into (each export gets its own timestamped subfolder). Defaults to `~/Downloads/microsoft-teams-mcp`. When set, a per-call `dest` must lie inside it; when unset, `dest` must be under `~/Downloads`, `~/Documents` or `~/Desktop`. |
196
217
  | `TEAMS_WS_PORT` | fetchproxy concentrator port. Defaults to `37149`, the fleet-wide shared port. |
197
218
  | `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. |
198
219
  | `FETCHPROXY_IDENTITY_DIR` | Where to store the long-term fetchproxy identity keypair (default `~/.fetchproxy/identity/`; an absolute path only, anything else is ignored). Exists for a host that runs a separate child per caller, so they can share one identity. |
@@ -457,9 +478,12 @@ Everything is optional — by default the token is captured from your browser.
457
478
  - `teams_get_attachment` — one attachment of a message: an inline image is
458
479
  returned as the image itself; a shared file is downloaded from SharePoint and
459
480
  returned as its contents — an image as the image, anything else as an embedded
460
- resource carrying the bytes. Shared-file download uses a separate, short-lived
461
- SharePoint token captured per SharePoint host, so the first file from a given
462
- host may need [your Teams tab reloaded](#sharepoint-file-download) to mint it; a
481
+ resource carrying the bytes. `save: true` writes it to a fresh file under
482
+ `TEAMS_OUTPUT_DIR` (else `~/Downloads/microsoft-teams-mcp`) and returns its
483
+ `path` instead. `ref` matches ignoring case, and a file without its extension.
484
+ Shared-file download uses a separate, short-lived SharePoint token that serves
485
+ every SharePoint host, so the first download may need
486
+ [your Teams tab reloaded](#sharepoint-file-download) to capture it; a
463
487
  file your account cannot open, or one that could not be fetched, comes back as
464
488
  metadata and its open link instead of failing. The caption names the
465
489
  conversation beside its id (`title`, plus `participants` for an untitled
@@ -579,6 +603,67 @@ Everything is optional — by default the token is captured from your browser.
579
603
  `new_horizon_message_id`. The marker never moves backwards: when it is
580
604
  already at or past the target, nothing is written (no confirmation is
581
605
  asked) and `status` is `already_read`. Only you see your read marker.
606
+ - `teams_rename_chat` — rename a group chat (set its topic): `name` is
607
+ trimmed and must not be empty. Only group chats — 1:1s, meeting chats,
608
+ channels and the self-chat are refused. Teams posts a notice in the chat,
609
+ so everyone in it sees the rename. The preview shows the current and new
610
+ name; renaming to the current name writes nothing and asks nothing. The
611
+ chat is read back to verify the new name (`verified`).
612
+ - `teams_add_chat_members` — add `people` (1–20) to a group chat as
613
+ ordinary members. Each person is one of:
614
+ - an MRI (`8:orgid:…`) or a bare object id — used as given;
615
+ - an email address — looked up in your organisation's directory and taken
616
+ only when exactly one person there has that email or UPN (ignoring case);
617
+ - a display name — matched, ignoring case and with "Greg King" and
618
+ "King, Greg" the same, among the other person of each of your 1:1 chats
619
+ and the chat's recent senders (exact first, then substring; several is
620
+ refused). **Only when no one there matches** is the directory searched:
621
+ the one person whose name is exactly that is taken; failing an exact
622
+ match, the directory's *only* suggestion is taken when the name is whole
623
+ words of it ("Solomon" for "Solomon, Gary", never "Sol"). Anything else —
624
+ several exact matches, several suggestions, a partial word, nothing —
625
+ refuses, listing the candidates with their email and MRI.
626
+
627
+ The directory is Substrate's people suggestions
628
+ (`POST https://substrate.office.com/search/api/v1/suggestions`), reached
629
+ with the [Substrate token](#substrate-search) search already captures — no
630
+ new token or bridge scope, but the first lookup may need you to run any
631
+ search in the Teams search box so the token can be captured. Only people in
632
+ your organisation are found there (not distribution lists or personal
633
+ contacts). If the directory cannot be searched (no token yet, a capture
634
+ timeout, `TEAMS_DISABLE_FETCHPROXY`), the error says so and what to do;
635
+ passing the MRI always works. An ambiguous or unknown person refuses the
636
+ whole call. The preview lists everyone with their `source` (`id`, `chat`
637
+ or `directory`) and, for a directory hit, their `email`, so you can see
638
+ exactly who will be added. People already in the chat are reported as
639
+ `already_member` and not written (if everyone is, nothing is asked). Teams
640
+ posts a notice in the chat for each person added. The chat is read back,
641
+ and each person is reported `added`, `already_member`, `unknown` (Teams
642
+ did not confirm and the read-back does not show them) or `failed` (with
643
+ the error).
644
+ - `teams_remove_chat_members` — remove `people` (1–20, named as for
645
+ `teams_add_chat_members`) from a group chat; refuses to remove you (leave
646
+ the chat in Teams instead). People not in the chat are reported as
647
+ `not_member` and not written. Teams posts a notice in the chat for each
648
+ person removed, and they lose access to it. Each person is reported
649
+ `removed`, `not_member`, `unknown` or `failed`.
650
+ - `teams_create_group_chat` — start a new group chat with `people` (2–20,
651
+ named as for `teams_add_chat_members`, except that with no chat yet a name
652
+ is matched among the other person of each of your 1:1 chats only, then the
653
+ directory) and an optional `topic` (trimmed; empty or missing is an
654
+ untitled chat). You are always included — listing yourself is ignored, as
655
+ are duplicates — and fewer than two other people is refused: one other
656
+ person is a 1:1, which this tool does not create. Sent as one
657
+ `POST /threads` with everyone as a member (Teams makes every group-chat
658
+ member an Admin). Everyone added sees the new chat at once, and **it
659
+ cannot be deleted afterwards** — only left. No message is sent; post the
660
+ first one with `teams_send_message`. The preview shows the topic and
661
+ everyone with their `source` and, from the directory, `email`. The chat is
662
+ read back and the result is `created` with the new `conversation` (id,
663
+ title, kind `group`), the `members` and `verified` (everyone and the topic
664
+ shown). It is not idempotent: `status: "unknown"` means Teams did not
665
+ confirm the create — check `teams_list_conversations` before retrying,
666
+ since a blind retry makes a second chat.
582
667
 
583
668
  `teams_list_messages` and `teams_list_unread_messages` also write when — and only
584
669
  when — you pass `mark_read: true` (see above). Every other tool is
@@ -586,13 +671,15 @@ read-only, and nothing marks anything read unless you ask it to.
586
671
 
587
672
  ## Writes
588
673
 
589
- A post and a reaction are visible to everyone in the conversation, and
590
- marking read clears your unread badges, so each write asks you first. A
674
+ A post, a reaction, a rename, a membership change and a new group chat are
675
+ visible to everyone in the conversation, and marking read clears your unread badges, so each
676
+ write asks you first. A
591
677
  client that can show a confirmation prompt (Claude Code) shows one. On a
592
678
  client that cannot, the first call changes nothing and returns a
593
679
  `confirmation-required` preview — the conversation, the exact text, any
594
- mentions, the quoted message, the reaction, or the message your read marker
595
- moves to and where it was, with everything other people wrote (titles,
680
+ mentions, the quoted message, the reaction, the message your read marker
681
+ moves to and where it was, a chat's current and new name, or who is added or
682
+ removed, with everything other people wrote (titles,
596
683
  names, quoted text) fenced as untrusted — plus a `confirmToken`; only a
597
684
  repeat call with that token writes. With `mark_read` on
598
685
  `teams_list_messages` / `teams_list_unread_messages`, that first call returns just
@@ -612,8 +699,9 @@ itself, so keep `MCP_CONFIRM_MODE=ask-user` and approve each preview in chat
612
699
  as the real guard on what gets posted.
613
700
 
614
701
  **Try it in your own notes first.** The conversation `48:notes` (also by the
615
- name `notes` or `self`) is your Teams self-chat ("notes to self"): every write
616
- accepts it, `teams_list_messages` reads it, nobody else sees it, and
702
+ name `notes` or `self`) is your Teams self-chat ("notes to self"): sending,
703
+ reacting and marking read accept it (the group-chat tools do not — it has no
704
+ one else in it), `teams_list_messages` reads it, nobody else sees it, and
617
705
  it is the safe place to see what a message or reaction will look like. Every
618
706
  other `48:` system conversation (calendar and the like) is refused.
619
707
 
@@ -626,7 +714,10 @@ is `status: "unknown"` only when that does not show the change. A read-marker
626
714
  move Teams does not confirm is `status: "unknown"` (`marked_read: false` with a
627
715
  `mark_read_warning` from the read tools); moving it again to the same message
628
716
  is harmless. Marking read (`PUT …/properties?name=consumptionhorizon`) was
629
- verified live on `48:notes` on 2026-10-12. Threaded channel replies, @mentions,
717
+ verified live on `48:notes` on 2026-10-12. A rename or membership change
718
+ Teams does not confirm is settled the same way, by reading the chat back;
719
+ renaming, adding and removing (`/threads/{id}/properties?name=topic` and
720
+ `/threads/{id}/members/{mri}`) were verified live on 2026-11-09. Threaded channel replies, @mentions,
630
721
  removing a reaction and the ✅ reaction's key follow Teams' documented or
631
722
  inferred shapes but have not been verified against a live tenant yet.
632
723
 
@@ -745,7 +836,9 @@ instead.
745
836
  (below), sent only to the file's own `*.sharepoint.com` host; the pre-signed
746
837
  download link it returns is fetched with **no** token at all. Search uses a
747
838
  third, Substrate token, sent only to
748
- `https://substrate.office.com/searchservice/api/v2/query`.
839
+ `https://substrate.office.com/searchservice/api/v2/query` and, to look a
840
+ person up in the directory for the group-chat member tools,
841
+ `https://substrate.office.com/search/api/v1/suggestions`.
749
842
  - **Shared files download from SharePoint.** They live in SharePoint, which
750
843
  does not accept the chat-service token, so `teams_get_attachment` captures a
751
844
  separate SharePoint token and fetches the file through SharePoint's v2.1
@@ -63,9 +63,9 @@ export const createCaptureTransport = (opts) => createFetchproxyTransport(opts);
63
63
  /**
64
64
  * A capture transport factory that declares the one bridge scope
65
65
  * (`withBridgeScope`), whichever single header the capture reads.
66
- * `sharePointHost` is the host a SharePoint capture is about to try.
66
+ * `sharePointHosts` are the hosts a SharePoint capture is about to try.
67
67
  */
68
- export const bridgeScopedTransport = (env, sharePointHost) => (opts) => createCaptureTransport(withBridgeScope(opts, env, sharePointHost));
68
+ export const bridgeScopedTransport = (env, sharePointHosts = []) => (opts) => createCaptureTransport(withBridgeScope(opts, env, sharePointHosts));
69
69
  /**
70
70
  * Capture a chat-service access token from the user's signed-in Teams tab.
71
71
  * Returns the bare token (no `Bearer ` prefix).
@@ -65,7 +65,7 @@ export function sharePointCaptureDecl(host) {
65
65
  }
66
66
  /**
67
67
  * The capture headers every hello declares: the chat-service and search
68
- * captures, then one per SharePoint host (deduplicated, sorted, and only
68
+ * captures, then one per granted SharePoint host (deduplicated, sorted, and only
69
69
  * concrete SharePoint hosts), so the list is the same whichever capture runs.
70
70
  */
71
71
  export function bridgeCaptureDecls(sharePointHosts) {
@@ -122,13 +122,11 @@ export function rememberSharePointHost(host, env = process.env) {
122
122
  * The hello options of a capture transport, widened to the one scope: the
123
123
  * domains and capture headers mcp-utils derived from the single capture are
124
124
  * replaced with {@link BRIDGE_TRUST_DOMAINS} and {@link bridgeCaptureDecls}
125
- * (plus `extraSharePointHost`, the host a SharePoint capture is about to try).
125
+ * (plus `extraSharePointHosts`, the hosts a SharePoint capture is about to try).
126
126
  * The verb set is unchanged — every capture is `capture_request_header`.
127
127
  */
128
- export function withBridgeScope(opts, env, extraSharePointHost) {
129
- const hosts = knownSharePointHosts(env);
130
- if (extraSharePointHost !== undefined)
131
- hosts.push(extraSharePointHost);
128
+ export function withBridgeScope(opts, env, extraSharePointHosts = []) {
129
+ const hosts = [...knownSharePointHosts(env), ...extraSharePointHosts];
132
130
  return {
133
131
  ...opts,
134
132
  domains: [...BRIDGE_TRUST_DOMAINS],