@mcp-consultant-tools/teams 1.0.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/README.md +134 -0
- package/build/TeamsService.d.ts +110 -0
- package/build/TeamsService.d.ts.map +1 -0
- package/build/TeamsService.js +598 -0
- package/build/TeamsService.js.map +1 -0
- package/build/cards/templates.d.ts +13 -0
- package/build/cards/templates.d.ts.map +1 -0
- package/build/cards/templates.js +247 -0
- package/build/cards/templates.js.map +1 -0
- package/build/index.d.ts +30 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +124 -0
- package/build/index.js.map +1 -0
- package/build/tools/authenticate.d.ts +22 -0
- package/build/tools/authenticate.d.ts.map +1 -0
- package/build/tools/authenticate.js +148 -0
- package/build/tools/authenticate.js.map +1 -0
- package/build/tools/list-channels.d.ts +20 -0
- package/build/tools/list-channels.d.ts.map +1 -0
- package/build/tools/list-channels.js +113 -0
- package/build/tools/list-channels.js.map +1 -0
- package/build/tools/send-card.d.ts +48 -0
- package/build/tools/send-card.d.ts.map +1 -0
- package/build/tools/send-card.js +102 -0
- package/build/tools/send-card.js.map +1 -0
- package/build/tools/send-message.d.ts +19 -0
- package/build/tools/send-message.d.ts.map +1 -0
- package/build/tools/send-message.js +123 -0
- package/build/tools/send-message.js.map +1 -0
- package/build/types.d.ts +170 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +5 -0
- package/build/types.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adaptive Card Templates for Release Announcements
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create a release announcement card
|
|
6
|
+
*/
|
|
7
|
+
function createReleaseAnnouncementCard(data) {
|
|
8
|
+
const npmUrl = data.npmUrl || `https://www.npmjs.com/package/${data.packageName}`;
|
|
9
|
+
return {
|
|
10
|
+
type: "AdaptiveCard",
|
|
11
|
+
version: "1.4",
|
|
12
|
+
$schema: "http://adaptivecards.io/schemas/adaptive-card.json",
|
|
13
|
+
body: [
|
|
14
|
+
{
|
|
15
|
+
type: "Container",
|
|
16
|
+
style: "emphasis",
|
|
17
|
+
items: [
|
|
18
|
+
{
|
|
19
|
+
type: "TextBlock",
|
|
20
|
+
text: `๐ New Release: ${data.packageName} v${data.version}`,
|
|
21
|
+
size: "large",
|
|
22
|
+
weight: "bolder",
|
|
23
|
+
wrap: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: "TextBlock",
|
|
29
|
+
text: data.summary,
|
|
30
|
+
wrap: true,
|
|
31
|
+
spacing: "medium",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "FactSet",
|
|
35
|
+
facts: [
|
|
36
|
+
{ title: "Version", value: data.version },
|
|
37
|
+
{ title: "Released", value: data.date },
|
|
38
|
+
{ title: "Type", value: data.releaseType },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "TextBlock",
|
|
43
|
+
text: "**Changes:**",
|
|
44
|
+
weight: "bolder",
|
|
45
|
+
spacing: "medium",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "TextBlock",
|
|
49
|
+
text: data.changes,
|
|
50
|
+
wrap: true,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
actions: [
|
|
54
|
+
...(data.releaseNotesUrl
|
|
55
|
+
? [
|
|
56
|
+
{
|
|
57
|
+
type: "Action.OpenUrl",
|
|
58
|
+
title: "View Release Notes",
|
|
59
|
+
url: data.releaseNotesUrl,
|
|
60
|
+
},
|
|
61
|
+
]
|
|
62
|
+
: []),
|
|
63
|
+
{
|
|
64
|
+
type: "Action.OpenUrl",
|
|
65
|
+
title: "npm Package",
|
|
66
|
+
url: npmUrl,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a beta release card with warning styling
|
|
73
|
+
*/
|
|
74
|
+
function createBetaReleaseCard(data) {
|
|
75
|
+
const npmUrl = data.npmUrl || `https://www.npmjs.com/package/${data.packageName}`;
|
|
76
|
+
return {
|
|
77
|
+
type: "AdaptiveCard",
|
|
78
|
+
version: "1.4",
|
|
79
|
+
$schema: "http://adaptivecards.io/schemas/adaptive-card.json",
|
|
80
|
+
body: [
|
|
81
|
+
{
|
|
82
|
+
type: "Container",
|
|
83
|
+
style: "warning",
|
|
84
|
+
items: [
|
|
85
|
+
{
|
|
86
|
+
type: "TextBlock",
|
|
87
|
+
text: `๐งช Beta Release: ${data.packageName} v${data.version}`,
|
|
88
|
+
size: "large",
|
|
89
|
+
weight: "bolder",
|
|
90
|
+
wrap: true,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "TextBlock",
|
|
96
|
+
text: "โ ๏ธ **This is a pre-release version for testing purposes.**",
|
|
97
|
+
wrap: true,
|
|
98
|
+
color: "warning",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: "TextBlock",
|
|
102
|
+
text: data.summary,
|
|
103
|
+
wrap: true,
|
|
104
|
+
spacing: "medium",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: "FactSet",
|
|
108
|
+
facts: [
|
|
109
|
+
{ title: "Version", value: data.version },
|
|
110
|
+
{ title: "Released", value: data.date },
|
|
111
|
+
{ title: "Type", value: "Beta Release" },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: "TextBlock",
|
|
116
|
+
text: "**Changes:**",
|
|
117
|
+
weight: "bolder",
|
|
118
|
+
spacing: "medium",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
type: "TextBlock",
|
|
122
|
+
text: data.changes,
|
|
123
|
+
wrap: true,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: "TextBlock",
|
|
127
|
+
text: "Install with: `npm install ${data.packageName}@beta`",
|
|
128
|
+
wrap: true,
|
|
129
|
+
spacing: "medium",
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
actions: [
|
|
133
|
+
...(data.releaseNotesUrl
|
|
134
|
+
? [
|
|
135
|
+
{
|
|
136
|
+
type: "Action.OpenUrl",
|
|
137
|
+
title: "View Release Notes",
|
|
138
|
+
url: data.releaseNotesUrl,
|
|
139
|
+
},
|
|
140
|
+
]
|
|
141
|
+
: []),
|
|
142
|
+
{
|
|
143
|
+
type: "Action.OpenUrl",
|
|
144
|
+
title: "npm Package (Beta)",
|
|
145
|
+
url: npmUrl,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Create a hotfix card with attention styling
|
|
152
|
+
*/
|
|
153
|
+
function createHotfixCard(data) {
|
|
154
|
+
const npmUrl = data.npmUrl || `https://www.npmjs.com/package/${data.packageName}`;
|
|
155
|
+
return {
|
|
156
|
+
type: "AdaptiveCard",
|
|
157
|
+
version: "1.4",
|
|
158
|
+
$schema: "http://adaptivecards.io/schemas/adaptive-card.json",
|
|
159
|
+
body: [
|
|
160
|
+
{
|
|
161
|
+
type: "Container",
|
|
162
|
+
style: "attention",
|
|
163
|
+
items: [
|
|
164
|
+
{
|
|
165
|
+
type: "TextBlock",
|
|
166
|
+
text: `๐ฅ Hotfix: ${data.packageName} v${data.version}`,
|
|
167
|
+
size: "large",
|
|
168
|
+
weight: "bolder",
|
|
169
|
+
color: "attention",
|
|
170
|
+
wrap: true,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: "TextBlock",
|
|
176
|
+
text: "๐จ **Critical fix - please update immediately.**",
|
|
177
|
+
wrap: true,
|
|
178
|
+
color: "attention",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: "TextBlock",
|
|
182
|
+
text: data.summary,
|
|
183
|
+
wrap: true,
|
|
184
|
+
spacing: "medium",
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: "FactSet",
|
|
188
|
+
facts: [
|
|
189
|
+
{ title: "Version", value: data.version },
|
|
190
|
+
{ title: "Released", value: data.date },
|
|
191
|
+
{ title: "Type", value: "Hotfix" },
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: "TextBlock",
|
|
196
|
+
text: "**Fixed Issues:**",
|
|
197
|
+
weight: "bolder",
|
|
198
|
+
spacing: "medium",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: "TextBlock",
|
|
202
|
+
text: data.changes,
|
|
203
|
+
wrap: true,
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
actions: [
|
|
207
|
+
...(data.releaseNotesUrl
|
|
208
|
+
? [
|
|
209
|
+
{
|
|
210
|
+
type: "Action.OpenUrl",
|
|
211
|
+
title: "View Details",
|
|
212
|
+
url: data.releaseNotesUrl,
|
|
213
|
+
},
|
|
214
|
+
]
|
|
215
|
+
: []),
|
|
216
|
+
{
|
|
217
|
+
type: "Action.OpenUrl",
|
|
218
|
+
title: "Update Now",
|
|
219
|
+
url: npmUrl,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Get a card from a template
|
|
226
|
+
*/
|
|
227
|
+
export function getCardFromTemplate(template, data) {
|
|
228
|
+
switch (template) {
|
|
229
|
+
case "release-announcement":
|
|
230
|
+
return createReleaseAnnouncementCard(data);
|
|
231
|
+
case "beta-release":
|
|
232
|
+
return createBetaReleaseCard(data);
|
|
233
|
+
case "hotfix":
|
|
234
|
+
return createHotfixCard(data);
|
|
235
|
+
default:
|
|
236
|
+
throw new Error(`Unknown template: ${template}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Available templates
|
|
241
|
+
*/
|
|
242
|
+
export const AVAILABLE_TEMPLATES = [
|
|
243
|
+
"release-announcement",
|
|
244
|
+
"beta-release",
|
|
245
|
+
"hotfix",
|
|
246
|
+
];
|
|
247
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/cards/templates.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,SAAS,6BAA6B,CAAC,IAAyB;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,iCAAiC,IAAI,CAAC,WAAW,EAAE,CAAC;IAElF,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,oDAAoD;QAC7D,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,mBAAmB,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,OAAO,EAAE;wBAC5D,IAAI,EAAE,OAAO;wBACb,MAAM,EAAE,QAAQ;wBAChB,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,QAAQ;aAClB;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE;oBACL,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE;oBACzC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE;oBACvC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE;iBAC3C;aACF;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,cAAc;gBACpB,MAAM,EAAE,QAAQ;gBAChB,OA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ACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAsB,EACtB,IAAyB;IAEzB,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,sBAAsB;YACzB,OAAO,6BAA6B,CAAC,IAAI,CAAC,CAAC;QAC7C,KAAK,cAAc;YACjB,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChC;YACE,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IACjD,sBAAsB;IACtB,cAAc;IACd,QAAQ;CACT,CAAC"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @mcp-consultant-tools/teams
|
|
4
|
+
*
|
|
5
|
+
* MCP server for Microsoft Teams integration.
|
|
6
|
+
* Send messages and adaptive cards to Teams channels for release announcements.
|
|
7
|
+
*
|
|
8
|
+
* Authentication: Client Credentials (app-only) - no user interaction required.
|
|
9
|
+
*/
|
|
10
|
+
import { TeamsService } from "./TeamsService.js";
|
|
11
|
+
/**
|
|
12
|
+
* Register Teams tools and prompts to an MCP server
|
|
13
|
+
* @param server - The MCP server instance
|
|
14
|
+
* @param teamsService - Optional pre-configured service (for testing)
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerTeamsTools(server: any, teamsService?: TeamsService): void;
|
|
17
|
+
/**
|
|
18
|
+
* Export service class for direct usage
|
|
19
|
+
*/
|
|
20
|
+
export { TeamsService } from "./TeamsService.js";
|
|
21
|
+
export type { TeamsConfig } from "./TeamsService.js";
|
|
22
|
+
/**
|
|
23
|
+
* Export types
|
|
24
|
+
*/
|
|
25
|
+
export * from "./types.js";
|
|
26
|
+
/**
|
|
27
|
+
* Export card templates
|
|
28
|
+
*/
|
|
29
|
+
export { getCardFromTemplate, AVAILABLE_TEMPLATES } from "./cards/templates.js";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAMH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWjD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAmFjF;AAED;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,cAAc,YAAY,CAAC;AAE3B;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @mcp-consultant-tools/teams
|
|
4
|
+
*
|
|
5
|
+
* MCP server for Microsoft Teams integration.
|
|
6
|
+
* Send messages and adaptive cards to Teams channels for release announcements.
|
|
7
|
+
*
|
|
8
|
+
* Authentication: Client Credentials (app-only) - no user interaction required.
|
|
9
|
+
*/
|
|
10
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
12
|
+
import { realpathSync } from "node:fs";
|
|
13
|
+
import { createMcpServer, createEnvLoader } from "@mcp-consultant-tools/core";
|
|
14
|
+
import { TeamsService } from "./TeamsService.js";
|
|
15
|
+
import { registerSendMessageTool } from "./tools/send-message.js";
|
|
16
|
+
import { registerSendCardTool } from "./tools/send-card.js";
|
|
17
|
+
import { registerListChannelsTool, registerListTeamsTool } from "./tools/list-channels.js";
|
|
18
|
+
import { registerAuthenticateTool, registerAuthStatusTool, registerLogoutTool, } from "./tools/authenticate.js";
|
|
19
|
+
/**
|
|
20
|
+
* Register Teams tools and prompts to an MCP server
|
|
21
|
+
* @param server - The MCP server instance
|
|
22
|
+
* @param teamsService - Optional pre-configured service (for testing)
|
|
23
|
+
*/
|
|
24
|
+
export function registerTeamsTools(server, teamsService) {
|
|
25
|
+
let service = teamsService || null;
|
|
26
|
+
/**
|
|
27
|
+
* Lazy initialization - service created on first use
|
|
28
|
+
* Supports two auth modes:
|
|
29
|
+
* - client-credentials: Requires TEAMS_CLIENT_SECRET (for automation)
|
|
30
|
+
* - device-code: No secret needed, authenticates via browser (default)
|
|
31
|
+
*/
|
|
32
|
+
function getTeamsService() {
|
|
33
|
+
if (!service) {
|
|
34
|
+
// Determine auth mode
|
|
35
|
+
const authMode = process.env.TEAMS_AUTH_MODE === "client-credentials"
|
|
36
|
+
? "client-credentials"
|
|
37
|
+
: "device-code";
|
|
38
|
+
// TEAMS_CLIENT_ID is required - must be a custom app registration
|
|
39
|
+
// The previously used "Microsoft Graph Command Line Tools" client ID was retired March 2025
|
|
40
|
+
// See: https://devblogs.microsoft.com/microsoft365dev/microsoft-graph-cli-retirement/
|
|
41
|
+
const clientId = process.env.TEAMS_CLIENT_ID;
|
|
42
|
+
const tenantId = process.env.TEAMS_TENANT_ID;
|
|
43
|
+
if (!clientId) {
|
|
44
|
+
throw new Error("TEAMS_CLIENT_ID is required. You must register an Azure AD app:\n\n" +
|
|
45
|
+
"1. Go to https://entra.microsoft.com โ App registrations โ New registration\n" +
|
|
46
|
+
"2. Enable 'Allow public client flows' in Authentication settings\n" +
|
|
47
|
+
"3. Add API permissions: User.Read, Team.ReadBasic.All, Channel.ReadBasic.All, ChannelMessage.Send, Group.Read.All\n" +
|
|
48
|
+
"4. Grant admin consent\n" +
|
|
49
|
+
"5. Set TEAMS_CLIENT_ID to your app's Application (client) ID");
|
|
50
|
+
}
|
|
51
|
+
if (!tenantId) {
|
|
52
|
+
throw new Error("TEAMS_TENANT_ID is required. Set it to your Azure AD tenant ID.\n" +
|
|
53
|
+
"Find it in Azure Portal โ Azure Active Directory โ Overview โ Tenant ID");
|
|
54
|
+
}
|
|
55
|
+
if (authMode === "client-credentials") {
|
|
56
|
+
if (!process.env.TEAMS_CLIENT_SECRET) {
|
|
57
|
+
throw new Error("TEAMS_CLIENT_SECRET is required for client-credentials auth mode. " +
|
|
58
|
+
"For interactive authentication, use TEAMS_AUTH_MODE=device-code (default).");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const config = {
|
|
62
|
+
authMode,
|
|
63
|
+
tenantId,
|
|
64
|
+
clientId,
|
|
65
|
+
clientSecret: process.env.TEAMS_CLIENT_SECRET,
|
|
66
|
+
defaultTeamId: process.env.TEAMS_DEFAULT_TEAM_ID,
|
|
67
|
+
defaultChannelId: process.env.TEAMS_DEFAULT_CHANNEL_ID,
|
|
68
|
+
};
|
|
69
|
+
service = new TeamsService(config);
|
|
70
|
+
console.error(`Teams service initialized (${authMode} mode)`);
|
|
71
|
+
}
|
|
72
|
+
return service;
|
|
73
|
+
}
|
|
74
|
+
// ========================================
|
|
75
|
+
// TOOLS
|
|
76
|
+
// ========================================
|
|
77
|
+
// Authentication tools (call these first for device-code mode)
|
|
78
|
+
registerAuthenticateTool(server, getTeamsService);
|
|
79
|
+
registerAuthStatusTool(server, getTeamsService);
|
|
80
|
+
registerLogoutTool(server, getTeamsService);
|
|
81
|
+
// Messaging tools
|
|
82
|
+
registerSendMessageTool(server, getTeamsService);
|
|
83
|
+
registerSendCardTool(server, getTeamsService);
|
|
84
|
+
registerListChannelsTool(server, getTeamsService);
|
|
85
|
+
registerListTeamsTool(server, getTeamsService);
|
|
86
|
+
console.error("Teams tools registered: authenticate, auth-status, logout, " +
|
|
87
|
+
"send-channel-message, send-adaptive-card, list-channels, list-teams");
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Export service class for direct usage
|
|
91
|
+
*/
|
|
92
|
+
export { TeamsService } from "./TeamsService.js";
|
|
93
|
+
/**
|
|
94
|
+
* Export types
|
|
95
|
+
*/
|
|
96
|
+
export * from "./types.js";
|
|
97
|
+
/**
|
|
98
|
+
* Export card templates
|
|
99
|
+
*/
|
|
100
|
+
export { getCardFromTemplate, AVAILABLE_TEMPLATES } from "./cards/templates.js";
|
|
101
|
+
/**
|
|
102
|
+
* Standalone CLI server (when run directly)
|
|
103
|
+
* Uses realpathSync to resolve symlinks created by npx
|
|
104
|
+
*/
|
|
105
|
+
if (import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
|
|
106
|
+
const loadEnv = createEnvLoader();
|
|
107
|
+
loadEnv();
|
|
108
|
+
const server = createMcpServer({
|
|
109
|
+
name: "@mcp-consultant-tools/teams",
|
|
110
|
+
version: "1.0.0",
|
|
111
|
+
capabilities: {
|
|
112
|
+
tools: {},
|
|
113
|
+
prompts: {},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
registerTeamsTools(server);
|
|
117
|
+
const transport = new StdioServerTransport();
|
|
118
|
+
server.connect(transport).catch((error) => {
|
|
119
|
+
console.error("Failed to start @mcp-consultant-tools/teams MCP server:", error);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
});
|
|
122
|
+
console.error("@mcp-consultant-tools/teams server running on stdio");
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;IAClC,OAAO,EAAE,CAAC;IAEV,MAAM,MAAM,GAAG,eAAe,CAAC;QAC7B,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;QAChB,YAAY,EAAE;YACZ,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,EAAE;SACZ;KACF,CAAC,CAAC;IAEH,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAE3B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,yDAAyD,EAAE,KAAK,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teams Authentication Tools
|
|
3
|
+
*
|
|
4
|
+
* Handles authentication for device-code flow.
|
|
5
|
+
* - authenticate: Start sign-in flow, returns URL and code
|
|
6
|
+
* - auth-status: Check current authentication status
|
|
7
|
+
* - logout: Clear stored authentication
|
|
8
|
+
*/
|
|
9
|
+
import type { TeamsService } from "../TeamsService.js";
|
|
10
|
+
/**
|
|
11
|
+
* Register the authenticate tool
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerAuthenticateTool(server: any, getService: () => TeamsService): void;
|
|
14
|
+
/**
|
|
15
|
+
* Register the auth-status tool
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerAuthStatusTool(server: any, getService: () => TeamsService): void;
|
|
18
|
+
/**
|
|
19
|
+
* Register the logout tool
|
|
20
|
+
*/
|
|
21
|
+
export declare function registerLogoutTool(server: any, getService: () => TeamsService): void;
|
|
22
|
+
//# sourceMappingURL=authenticate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../src/tools/authenticate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,MAAM,YAAY,GAC7B,IAAI,CAmEN;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,MAAM,YAAY,GAC7B,IAAI,CA+CN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,MAAM,YAAY,GAC7B,IAAI,CAkCN"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teams Authentication Tools
|
|
3
|
+
*
|
|
4
|
+
* Handles authentication for device-code flow.
|
|
5
|
+
* - authenticate: Start sign-in flow, returns URL and code
|
|
6
|
+
* - auth-status: Check current authentication status
|
|
7
|
+
* - logout: Clear stored authentication
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Register the authenticate tool
|
|
11
|
+
*/
|
|
12
|
+
export function registerAuthenticateTool(server, getService) {
|
|
13
|
+
server.tool("authenticate", "Authenticate to Microsoft Teams. For device-code mode (default), returns a URL and code - open the URL in your browser and enter the code to sign in. Required before using other Teams tools when using personal credentials. For client-credentials mode, validates the app credentials.", {
|
|
14
|
+
// No parameters needed
|
|
15
|
+
}, async () => {
|
|
16
|
+
try {
|
|
17
|
+
const service = getService();
|
|
18
|
+
const result = await service.startAuthentication();
|
|
19
|
+
if (result.status === "authenticated") {
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: `โ
**Already Authenticated**\n\n${result.message}`,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (result.status === "pending") {
|
|
30
|
+
// Return clear instructions for the user
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: `๐ **Teams Authentication Required**\n\n` +
|
|
36
|
+
`Please complete sign-in:\n\n` +
|
|
37
|
+
`1. **Open this URL:** ${result.verificationUri}\n` +
|
|
38
|
+
`2. **Enter this code:** \`${result.userCode}\`\n` +
|
|
39
|
+
`3. **Sign in** with your Microsoft account\n\n` +
|
|
40
|
+
`โฑ๏ธ This code expires in ${Math.floor(result.expiresInSeconds / 60)} minutes.\n\n` +
|
|
41
|
+
`Once you've signed in, you can use the other Teams tools (send-channel-message, send-adaptive-card, etc.).\n\n` +
|
|
42
|
+
`_The authentication will complete automatically in the background once you sign in._`,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// Failed or other status
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: "text",
|
|
52
|
+
text: `โ **Authentication Failed**\n\n${result.message}`,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: "text",
|
|
64
|
+
text: `โ **Authentication Error**\n\n${message}`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
isError: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Register the auth-status tool
|
|
74
|
+
*/
|
|
75
|
+
export function registerAuthStatusTool(server, getService) {
|
|
76
|
+
server.tool("auth-status", "Check the current Teams authentication status. Shows whether you're authenticated, the auth mode (client-credentials or device-code), and token expiration.", {
|
|
77
|
+
// No parameters needed
|
|
78
|
+
}, async () => {
|
|
79
|
+
try {
|
|
80
|
+
const service = getService();
|
|
81
|
+
const status = service.getAuthStatus();
|
|
82
|
+
const emoji = status.status === "authenticated"
|
|
83
|
+
? "โ
"
|
|
84
|
+
: status.status === "pending"
|
|
85
|
+
? "โณ"
|
|
86
|
+
: status.status === "expired"
|
|
87
|
+
? "โ ๏ธ"
|
|
88
|
+
: "โ";
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{
|
|
92
|
+
type: "text",
|
|
93
|
+
text: `${emoji} **Authentication Status: ${status.status}**\n\n` +
|
|
94
|
+
`**Mode:** ${status.authMode}\n` +
|
|
95
|
+
(status.expiresAt ? `**Expires:** ${status.expiresAt}\n` : "") +
|
|
96
|
+
`\n${status.message}`,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
103
|
+
return {
|
|
104
|
+
content: [
|
|
105
|
+
{
|
|
106
|
+
type: "text",
|
|
107
|
+
text: `โ **Error checking status**\n\n${message}`,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
isError: true,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Register the logout tool
|
|
117
|
+
*/
|
|
118
|
+
export function registerLogoutTool(server, getService) {
|
|
119
|
+
server.tool("logout", "Clear Teams authentication. Removes cached tokens. Use the 'authenticate' tool to sign in again.", {
|
|
120
|
+
// No parameters needed
|
|
121
|
+
}, async () => {
|
|
122
|
+
try {
|
|
123
|
+
const service = getService();
|
|
124
|
+
service.logout();
|
|
125
|
+
return {
|
|
126
|
+
content: [
|
|
127
|
+
{
|
|
128
|
+
type: "text",
|
|
129
|
+
text: "โ
**Logged out**\n\nTeams authentication has been cleared. Use the 'authenticate' tool to sign in again.",
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
136
|
+
return {
|
|
137
|
+
content: [
|
|
138
|
+
{
|
|
139
|
+
type: "text",
|
|
140
|
+
text: `โ **Error logging out**\n\n${message}`,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
isError: true,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=authenticate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../src/tools/authenticate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAW,EACX,UAA8B;IAE9B,MAAM,CAAC,IAAI,CACT,cAAc,EACd,4RAA4R,EAC5R;IACE,uBAAuB;KACxB,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAEnD,IAAI,MAAM,CAAC,MAAM,KAAK,eAAe,EAAE,CAAC;gBACtC,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,kCAAkC,MAAM,CAAC,OAAO,EAAE;yBACzD;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAChC,yCAAyC;gBACzC,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EACF,0CAA0C;gCAC1C,8BAA8B;g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K,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,8BAA8B,OAAO,EAAE;qBAC9C;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list-channels tool
|
|
3
|
+
*
|
|
4
|
+
* Lists channels in a Teams team for discovery.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import type { TeamsService } from "../TeamsService.js";
|
|
8
|
+
export declare const listChannelsSchema: {
|
|
9
|
+
teamId: z.ZodString;
|
|
10
|
+
};
|
|
11
|
+
export declare const listTeamsSchema: {};
|
|
12
|
+
/**
|
|
13
|
+
* Register the list-channels tool
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerListChannelsTool(server: any, getService: () => TeamsService): void;
|
|
16
|
+
/**
|
|
17
|
+
* Register the list-teams tool
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerListTeamsTool(server: any, getService: () => TeamsService): void;
|
|
20
|
+
//# sourceMappingURL=list-channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-channels.d.ts","sourceRoot":"","sources":["../../src/tools/list-channels.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,eAAO,MAAM,kBAAkB;;CAI9B,CAAC;AAGF,eAAO,MAAM,eAAe,IAAK,CAAC;AAElC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,MAAM,YAAY,GAC7B,IAAI,CAqDN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,MAAM,YAAY,GAC7B,IAAI,CAuDN"}
|