@chrischall/microsoft-teams-mcp 0.13.0 → 0.14.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +12 -2
- package/dist/auth-fetchproxy.js +35 -1
- package/dist/bridge-scope.js +45 -8
- package/dist/bundle.js +22429 -27258
- package/dist/sharepoint-auth.js +175 -29
- package/dist/sharepoint.js +182 -8
- package/dist/tools/send.js +70 -10
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -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.
|
|
10
|
+
"version": "0.14.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.
|
|
18
|
+
"version": "0.14.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.
|
|
4
|
+
"version": "0.14.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
|
@@ -686,8 +686,18 @@ Everything is optional — by default the token is captured from your browser.
|
|
|
686
686
|
emoji and mentions work as in plain text. Anything else — raw HTML,
|
|
687
687
|
headings, quotes, images — is escaped and shown as written. The preview's
|
|
688
688
|
`willSend.content` is the exact HTML that will be posted.
|
|
689
|
-
`reply_to` posts into a channel post's
|
|
690
|
-
|
|
689
|
+
Nothing is quoted by default. `reply_to` posts into a channel post's
|
|
690
|
+
thread — it must be a root post in that channel, not a reply. In a chat,
|
|
691
|
+
`reply_to` and `quote` are the same thing: both quote-reply that message.
|
|
692
|
+
`quote` quote-replies a message anywhere. Pass either only when the user
|
|
693
|
+
asked for a reply or a quote; when that is ambiguous (a message's
|
|
694
|
+
timestamp, or "reply" in a chat), ask. The preview says what is quoted in
|
|
695
|
+
plain words — `quoting: "Bea Example", 2026-11-12 12:31 UTC: "…"` (the
|
|
696
|
+
time in `TEAMS_TIME_ZONE` when set) or `quoting: "none"` — and its summary
|
|
697
|
+
ends `, quoting "<sender>"` or `, no quote`. Setting `reply_to` adds a
|
|
698
|
+
`warning` saying what it does (a thread reply in a channel, a quote in a
|
|
699
|
+
chat). The fenced details of the quoted message are in `quoted_message`.
|
|
700
|
+
`mentions`
|
|
691
701
|
@-mentions people by MRI or by a display name matched among the
|
|
692
702
|
conversation's recent senders (an ambiguous name is refused with the
|
|
693
703
|
candidates). The result says whether the post was found again by reading
|
package/dist/auth-fetchproxy.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* code that needs a token, as Outlook's client does, so a server run with
|
|
27
27
|
* `TEAMS_ACCESS_TOKEN` never has to load the bridge to boot.
|
|
28
28
|
*/
|
|
29
|
-
import { captureBearerHeader, createFetchproxyTransport } from '@chrischall/mcp-utils/fetchproxy';
|
|
29
|
+
import { captureBearerHeader, createFetchproxyTransport, } from '@chrischall/mcp-utils/fetchproxy';
|
|
30
30
|
import { readPortEnv } from '@chrischall/mcp-utils';
|
|
31
31
|
import { captureWindowMs } from './capture-window.js';
|
|
32
32
|
import { BRIDGE_TRUST_DOMAINS, CAPTURE_DECL, withBridgeScope } from './bridge-scope.js';
|
|
@@ -66,6 +66,40 @@ export const createCaptureTransport = (opts) => createFetchproxyTransport(opts);
|
|
|
66
66
|
* `sharePointHosts` are the hosts a SharePoint capture is about to try.
|
|
67
67
|
*/
|
|
68
68
|
export const bridgeScopedTransport = (env, sharePointHosts = []) => (opts) => createCaptureTransport(withBridgeScope(opts, env, sharePointHosts));
|
|
69
|
+
/**
|
|
70
|
+
* How long the SharePoint shared-file `download` verb may wait for the browser
|
|
71
|
+
* to finish the download, in ms. Downloads can be multi-MB, so it is generous;
|
|
72
|
+
* the transport deadline below is set past it so the extension's own
|
|
73
|
+
* "download stalled" answer is the one the caller sees, not a bare deadline.
|
|
74
|
+
*/
|
|
75
|
+
export const DOWNLOAD_VERB_TIMEOUT_MS = 120_000;
|
|
76
|
+
/**
|
|
77
|
+
* A full bridge transport for the SharePoint shared-file `download` verb (not a
|
|
78
|
+
* capture). It declares the one bridge scope exactly as every capture does
|
|
79
|
+
* (`withBridgeScope` pins the same domains, capture headers and
|
|
80
|
+
* {@link BRIDGE_CAPABILITIES}, so the download never re-offers a capture's grant
|
|
81
|
+
* and vice versa), and exposes `server.download(...)`.
|
|
82
|
+
*
|
|
83
|
+
* The download runs through `chrome.downloads` — the browser's own network
|
|
84
|
+
* stack and cookies — so it needs NO token capture and no SharePoint request
|
|
85
|
+
* from the page: an idle tab whose cached token starves the bearer capture
|
|
86
|
+
* still downloads here. The verb is browser-wide and gated by `domains`
|
|
87
|
+
* (`sharepoint.com`), so any tenant SharePoint host is reachable without having
|
|
88
|
+
* been granted a capture decl first.
|
|
89
|
+
*
|
|
90
|
+
* Built through this module's `createFetchproxyTransport` binding so a test's
|
|
91
|
+
* `vi.mock('@chrischall/mcp-utils/fetchproxy')` stub is the one used, as the
|
|
92
|
+
* capture transports are.
|
|
93
|
+
*/
|
|
94
|
+
export function bridgeDownloadTransport(env = process.env) {
|
|
95
|
+
return createFetchproxyTransport(withBridgeScope({
|
|
96
|
+
port: getWsPort(),
|
|
97
|
+
serverName: PACKAGE_NAME,
|
|
98
|
+
version: VERSION,
|
|
99
|
+
// Past the verb's own timeout so the extension's reply wins the race.
|
|
100
|
+
fetchTimeoutMs: DOWNLOAD_VERB_TIMEOUT_MS + 15_000,
|
|
101
|
+
}, env));
|
|
102
|
+
}
|
|
69
103
|
/**
|
|
70
104
|
* Capture a chat-service access token from the user's signed-in Teams tab.
|
|
71
105
|
* Returns the bare token (no `Bearer ` prefix).
|
package/dist/bridge-scope.js
CHANGED
|
@@ -30,6 +30,22 @@ import { parseBoolEnv } from '@chrischall/mcp-utils';
|
|
|
30
30
|
import { createFileStatePersistence } from '@chrischall/mcp-utils/session';
|
|
31
31
|
import { sharePointTokenCachePath } from './sharepoint-token-cache.js';
|
|
32
32
|
import { reportCacheWriteFailure } from './token-cache.js';
|
|
33
|
+
/**
|
|
34
|
+
* The inner-verb capabilities EVERY hello of this server declares, as one set.
|
|
35
|
+
*
|
|
36
|
+
* The same thrash the capture-header list causes (see the module note) a
|
|
37
|
+
* differing CAPABILITY set causes too: the bridge offers a grant whenever a
|
|
38
|
+
* hello's declared capabilities exceed the approved ones, and approving it
|
|
39
|
+
* replaces the stored set. The three captures need only `capture_request_header`
|
|
40
|
+
* (beside the `fetch` base verb every fetchproxy transport carries); the
|
|
41
|
+
* SharePoint shared-file download needs `download` (`chrome.downloads`, the
|
|
42
|
+
* browser's own cookies — no token capture, so an idle tab's cached token no
|
|
43
|
+
* longer starves the fetch). If the captures declared the smaller set and the
|
|
44
|
+
* download the larger, every switch between them would re-offer the grant. So
|
|
45
|
+
* all four declare this one set, and `withBridgeScope` pins it on every hello —
|
|
46
|
+
* the download grant is approved once and never re-offered.
|
|
47
|
+
*/
|
|
48
|
+
export const BRIDGE_CAPABILITIES = ['fetch', 'capture_request_header', 'download'];
|
|
33
49
|
/**
|
|
34
50
|
* The chat-service capture: any chat-service call on the New Teams host. An
|
|
35
51
|
* idle tab may make none — opening a chat is what makes the worker issue one.
|
|
@@ -56,10 +72,17 @@ export const RECAP_CAPTURE_DECL = {
|
|
|
56
72
|
headerName: 'authorization',
|
|
57
73
|
};
|
|
58
74
|
/**
|
|
59
|
-
*
|
|
60
|
-
* the
|
|
75
|
+
* The SharePoint family domain. The bridge accepts any `*.sharepoint.com` host
|
|
76
|
+
* under it — for both `domains` (the trust record) and `tabDomains` (which tabs
|
|
77
|
+
* a capture may read), where a concrete per-tenant host is not allowed because
|
|
78
|
+
* every tabDomain must be one of the declared `domains`.
|
|
79
|
+
*/
|
|
80
|
+
export const SHAREPOINT_DOMAIN = 'sharepoint.com';
|
|
81
|
+
/**
|
|
82
|
+
* Every domain the server captures from. {@link SHAREPOINT_DOMAIN} is the family
|
|
83
|
+
* domain: the bridge accepts any `*.sharepoint.com` host under it.
|
|
61
84
|
*/
|
|
62
|
-
export const BRIDGE_TRUST_DOMAINS = [CAPTURE_DECL.host,
|
|
85
|
+
export const BRIDGE_TRUST_DOMAINS = [CAPTURE_DECL.host, SHAREPOINT_DOMAIN, SUBSTRATE_CAPTURE_DECL.host];
|
|
63
86
|
/**
|
|
64
87
|
* True for a concrete SharePoint tenant host (`{label}.sharepoint.com`), such
|
|
65
88
|
* as `contoso-my.sharepoint.com` or `contoso.sharepoint.com`. Rejects a bare
|
|
@@ -132,17 +155,31 @@ export function rememberSharePointHost(host, env = process.env) {
|
|
|
132
155
|
* The hello options of a capture transport, widened to the one scope: the
|
|
133
156
|
* domains and capture headers mcp-utils derived from the single capture are
|
|
134
157
|
* replaced with {@link BRIDGE_TRUST_DOMAINS} and {@link bridgeCaptureDecls}
|
|
135
|
-
* (plus `extraSharePointHosts`, the hosts a SharePoint capture is about to try)
|
|
136
|
-
*
|
|
158
|
+
* (plus `extraSharePointHosts`, the hosts a SharePoint capture is about to try),
|
|
159
|
+
* and the capability set with {@link BRIDGE_CAPABILITIES}. The verb set is the
|
|
160
|
+
* same on every hello — the captures use `capture_request_header`, the
|
|
161
|
+
* shared-file download uses `download`, and all declare both so neither
|
|
162
|
+
* re-offers the other's grant.
|
|
137
163
|
*/
|
|
138
164
|
export function withBridgeScope(opts, env, extraSharePointHosts = []) {
|
|
139
165
|
const hosts = [...knownSharePointHosts(env), ...extraSharePointHosts];
|
|
140
166
|
return {
|
|
141
167
|
...opts,
|
|
142
168
|
domains: [...BRIDGE_TRUST_DOMAINS],
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
|
|
169
|
+
// The Teams tab is where the chat-service, search and recap captures read
|
|
170
|
+
// their requests. A SharePoint capture also reads requests the Teams tab
|
|
171
|
+
// makes — but an idle tab's cached token means it makes none, so the capture
|
|
172
|
+
// starves. Allowing a SharePoint tab here too lets the capture ALSO snapshot
|
|
173
|
+
// an authenticated request a SharePoint tab makes — i.e. the user opening
|
|
174
|
+
// the file once — turning that documented fallback into a reliable one. It
|
|
175
|
+
// is the FAMILY domain `sharepoint.com` (every tabDomain must be one of the
|
|
176
|
+
// declared `domains`, which rules out a concrete per-tenant host), and it
|
|
177
|
+
// matches any `*.sharepoint.com` tab. tabDomains is a tab-matching hint, not
|
|
178
|
+
// the trust record (that is `domains`), so this never re-pairs. The
|
|
179
|
+
// `download` verb is browser-wide (`chrome.downloads`), gated by `domains`,
|
|
180
|
+
// and needs no tab.
|
|
181
|
+
tabDomains: [CAPTURE_DECL.host, SHAREPOINT_DOMAIN],
|
|
146
182
|
captureHeaders: bridgeCaptureDecls(hosts),
|
|
183
|
+
capabilities: [...BRIDGE_CAPABILITIES],
|
|
147
184
|
};
|
|
148
185
|
}
|