@chrischall/microsoft-teams-mcp 0.8.6 → 0.9.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 +101 -25
- package/dist/auth-fetchproxy.js +2 -2
- package/dist/bridge-scope.js +4 -6
- package/dist/bundle.js +802 -137
- package/dist/chatsvc.js +52 -7
- package/dist/index.js +3 -1
- package/dist/sharepoint-auth.js +94 -40
- package/dist/sharepoint-token-cache.js +19 -17
- package/dist/sharepoint.js +47 -34
- package/dist/substrate.js +126 -11
- package/dist/tools/attachment.js +79 -33
- package/dist/tools/group-chat.js +385 -0
- package/dist/tools/healthcheck.js +4 -4
- package/dist/tools/people.js +236 -0
- package/dist/tools/send.js +3 -16
- package/dist/version.js +1 -1
- package/package.json +9 -9
- package/server.json +3 -3
package/dist/tools/send.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CONFIRM_FLOW_SENTENCE, CONFIRM_INJECTION_RULE, confirmTokenParam, confirmWrite, McpToolError, toolAnnotations, unknownOutcomeReason, writeOrUnknown, } from '@chrischall/mcp-utils';
|
|
3
3
|
import { buildSendBody, clipText, mentionsProperty, newClientMessageId, qtdMsgsProperty, quoteHtml, renderMessageHtml, } from '../compose.js';
|
|
4
|
-
import { htmlToText,
|
|
4
|
+
import { htmlToText, normaliseMessage, SELF_CHAT, senderMri } from '../model.js';
|
|
5
5
|
import { resolveListed } from './conversation.js';
|
|
6
6
|
import { wrapApiError } from './errors.js';
|
|
7
|
+
import { MRI, recentSenders } from './people.js';
|
|
7
8
|
import { THIRD_PARTY_NAMES_NOTE, untrustedField, untrustedResult, UNTRUSTED_DESCRIPTION_SUFFIX, } from './untrusted.js';
|
|
8
9
|
import { workMeta } from './hints.js';
|
|
9
10
|
const TOOL = 'teams_send_message';
|
|
@@ -13,15 +14,12 @@ const TOOL = 'teams_send_message';
|
|
|
13
14
|
* (calendar, notifications, …) is refused.
|
|
14
15
|
*/
|
|
15
16
|
export { SELF_CHAT };
|
|
16
|
-
/** Recent messages scanned for
|
|
17
|
-
const RECENT_MESSAGES = 200;
|
|
17
|
+
/** Recent messages scanned for the read-back. */
|
|
18
18
|
const READBACK_MESSAGES = 50;
|
|
19
19
|
/** Candidates a mention error lists. */
|
|
20
20
|
const MAX_CANDIDATES = 10;
|
|
21
21
|
/** Previewed text of a quoted message. */
|
|
22
22
|
const PREVIEW_CHARS = 200;
|
|
23
|
-
/** An MRI such as `8:orgid:<oid>` (a person) or `28:<id>` (a bot). */
|
|
24
|
-
const MRI = /^\d+:\S+$/;
|
|
25
23
|
const mentionArg = z.object({
|
|
26
24
|
name_in_text: z
|
|
27
25
|
.string()
|
|
@@ -49,17 +47,6 @@ export async function resolveTarget(chatsvc, conversation, me, verb = 'post to')
|
|
|
49
47
|
const s = await resolveListed(chatsvc, raw, me, conversation, verb);
|
|
50
48
|
return { id: s.id, title: s.title, kind: s.kind, ...(s.participants !== undefined ? { participants: s.participants } : {}) };
|
|
51
49
|
}
|
|
52
|
-
/** Who has written in the conversation lately, by MRI → display name. */
|
|
53
|
-
async function recentSenders(chatsvc, conversationId) {
|
|
54
|
-
const out = new Map();
|
|
55
|
-
for (const m of await chatsvc.getMessages(conversationId, { max: RECENT_MESSAGES })) {
|
|
56
|
-
const mri = senderMri(m.from);
|
|
57
|
-
const name = m.imdisplayname?.trim();
|
|
58
|
-
if (isUserMessage(m) && mri !== undefined && name && !out.has(mri))
|
|
59
|
-
out.set(mri, name);
|
|
60
|
-
}
|
|
61
|
-
return out;
|
|
62
|
-
}
|
|
63
50
|
/**
|
|
64
51
|
* Each mention's MRI: an MRI is taken as-is; a name must match exactly one
|
|
65
52
|
* recent sender (exactly, else as a substring, ignoring case). Ambiguous or
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrischall/microsoft-teams-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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>",
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@chrischall/mcp-utils": "^3.7.2",
|
|
49
49
|
"@fetchproxy/server": "^3.8.0",
|
|
50
|
-
"@modelcontextprotocol/server": "^2.
|
|
51
|
-
"dotenv": "^18.0.
|
|
52
|
-
"zod": "^4.6.
|
|
50
|
+
"@modelcontextprotocol/server": "^2.4.0",
|
|
51
|
+
"dotenv": "^18.0.10",
|
|
52
|
+
"zod": "^4.6.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@modelcontextprotocol/client": "^2.
|
|
56
|
-
"@types/node": "^26.
|
|
57
|
-
"@vitest/coverage-v8": "^5.
|
|
58
|
-
"esbuild": "^0.28.
|
|
55
|
+
"@modelcontextprotocol/client": "^2.4.0",
|
|
56
|
+
"@types/node": "^26.6.6",
|
|
57
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
58
|
+
"esbuild": "^0.28.2",
|
|
59
59
|
"typescript": "^7.0.2",
|
|
60
|
-
"vitest": "^5.
|
|
60
|
+
"vitest": "^5.1.0"
|
|
61
61
|
},
|
|
62
62
|
"allowScripts": {
|
|
63
63
|
"esbuild": false,
|
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.
|
|
9
|
+
"version": "0.9.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@chrischall/microsoft-teams-mcp",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.9.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"name": "MCP_CONFIRM_MODE",
|
|
119
|
-
"description": "What the writes (teams_send_message, teams_react, teams_mark_read and the read tools' mark_read) do on a client that cannot show a confirmation prompt (claude.ai, Claude Desktop): \"ask-user\" (default: the first call returns a preview and a confirmToken, and the model must get your approval in chat before using it), \"auto\" (the model may use the token after reviewing the preview itself) or \"refuse\". An unrecognised value is treated as refuse.",
|
|
119
|
+
"description": "What the writes (teams_send_message, teams_react, teams_mark_read, teams_rename_chat, teams_add_chat_members, teams_remove_chat_members and the read tools' mark_read) do on a client that cannot show a confirmation prompt (claude.ai, Claude Desktop): \"ask-user\" (default: the first call returns a preview and a confirmToken, and the model must get your approval in chat before using it), \"auto\" (the model may use the token after reviewing the preview itself) or \"refuse\". An unrecognised value is treated as refuse.",
|
|
120
120
|
"isRequired": false,
|
|
121
121
|
"format": "string",
|
|
122
122
|
"isSecret": false
|