@sam2kb/m365-mcp 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/.env.example +11 -0
- package/LICENSE +21 -0
- package/README.md +257 -0
- package/SKILL.md +59 -0
- package/dist/auth-cli.d.ts +13 -0
- package/dist/auth-cli.js +127 -0
- package/dist/auth-cli.js.map +1 -0
- package/dist/auth.d.ts +44 -0
- package/dist/auth.js +288 -0
- package/dist/auth.js.map +1 -0
- package/dist/graph.d.ts +32 -0
- package/dist/graph.js +189 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +152 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/calendar.d.ts +236 -0
- package/dist/tools/calendar.js +255 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/contacts.d.ts +207 -0
- package/dist/tools/contacts.js +169 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/files.d.ts +135 -0
- package/dist/tools/files.js +127 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/mail.d.ts +300 -0
- package/dist/tools/mail.js +233 -0
- package/dist/tools/mail.js.map +1 -0
- package/dist/tools/tasks.d.ts +171 -0
- package/dist/tools/tasks.js +129 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/teams.d.ts +71 -0
- package/dist/tools/teams.js +75 -0
- package/dist/tools/teams.js.map +1 -0
- package/dist/tools/users.d.ts +55 -0
- package/dist/tools/users.js +64 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/types.d.ts +197 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -0
- package/tsconfig.json +19 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for m365-mcp
|
|
3
|
+
*/
|
|
4
|
+
export interface AccountConfig {
|
|
5
|
+
name: string;
|
|
6
|
+
tenantId: string;
|
|
7
|
+
clientId: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
addedAt: string;
|
|
11
|
+
tokenPath: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TokenData {
|
|
14
|
+
access_token: string;
|
|
15
|
+
refresh_token: string;
|
|
16
|
+
expires_at: number;
|
|
17
|
+
scope: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AccountsStore {
|
|
20
|
+
default: string | null;
|
|
21
|
+
accounts: Record<string, {
|
|
22
|
+
tenantId: string;
|
|
23
|
+
clientId: string;
|
|
24
|
+
email?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
addedAt: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export interface GraphListResponse<T> {
|
|
30
|
+
value: T[];
|
|
31
|
+
"@odata.nextLink"?: string;
|
|
32
|
+
"@odata.count"?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface GraphError {
|
|
35
|
+
error: {
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
innerError?: {
|
|
39
|
+
"request-id": string;
|
|
40
|
+
date: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface EmailAddress {
|
|
45
|
+
name?: string;
|
|
46
|
+
address: string;
|
|
47
|
+
}
|
|
48
|
+
export interface EmailMessage {
|
|
49
|
+
id: string;
|
|
50
|
+
subject: string;
|
|
51
|
+
from?: {
|
|
52
|
+
emailAddress: EmailAddress;
|
|
53
|
+
};
|
|
54
|
+
toRecipients?: {
|
|
55
|
+
emailAddress: EmailAddress;
|
|
56
|
+
}[];
|
|
57
|
+
ccRecipients?: {
|
|
58
|
+
emailAddress: EmailAddress;
|
|
59
|
+
}[];
|
|
60
|
+
receivedDateTime: string;
|
|
61
|
+
sentDateTime: string;
|
|
62
|
+
isRead: boolean;
|
|
63
|
+
isDraft: boolean;
|
|
64
|
+
bodyPreview: string;
|
|
65
|
+
body: {
|
|
66
|
+
contentType: string;
|
|
67
|
+
content: string;
|
|
68
|
+
};
|
|
69
|
+
hasAttachments: boolean;
|
|
70
|
+
importance: string;
|
|
71
|
+
webLink: string;
|
|
72
|
+
}
|
|
73
|
+
export interface CalendarEvent {
|
|
74
|
+
id: string;
|
|
75
|
+
subject: string;
|
|
76
|
+
start: {
|
|
77
|
+
dateTime: string;
|
|
78
|
+
timeZone: string;
|
|
79
|
+
};
|
|
80
|
+
end: {
|
|
81
|
+
dateTime: string;
|
|
82
|
+
timeZone: string;
|
|
83
|
+
};
|
|
84
|
+
location?: {
|
|
85
|
+
displayName: string;
|
|
86
|
+
};
|
|
87
|
+
isOnlineMeeting: boolean;
|
|
88
|
+
onlineMeetingUrl?: string;
|
|
89
|
+
organizer?: {
|
|
90
|
+
emailAddress: EmailAddress;
|
|
91
|
+
};
|
|
92
|
+
attendees?: {
|
|
93
|
+
emailAddress: EmailAddress;
|
|
94
|
+
type: string;
|
|
95
|
+
status: {
|
|
96
|
+
response: string;
|
|
97
|
+
};
|
|
98
|
+
}[];
|
|
99
|
+
body?: {
|
|
100
|
+
contentType: string;
|
|
101
|
+
content: string;
|
|
102
|
+
};
|
|
103
|
+
isAllDay: boolean;
|
|
104
|
+
recurrence?: any;
|
|
105
|
+
webLink: string;
|
|
106
|
+
}
|
|
107
|
+
export interface Contact {
|
|
108
|
+
id: string;
|
|
109
|
+
displayName?: string;
|
|
110
|
+
givenName?: string;
|
|
111
|
+
surname?: string;
|
|
112
|
+
emailAddresses?: {
|
|
113
|
+
name?: string;
|
|
114
|
+
address: string;
|
|
115
|
+
}[];
|
|
116
|
+
businessPhones?: string[];
|
|
117
|
+
mobilePhone?: string;
|
|
118
|
+
companyName?: string;
|
|
119
|
+
jobTitle?: string;
|
|
120
|
+
homeAddress?: any;
|
|
121
|
+
businessAddress?: any;
|
|
122
|
+
personalNotes?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface DriveItem {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
size: number;
|
|
128
|
+
folder?: {
|
|
129
|
+
childCount: number;
|
|
130
|
+
};
|
|
131
|
+
file?: {
|
|
132
|
+
mimeType: string;
|
|
133
|
+
};
|
|
134
|
+
webUrl: string;
|
|
135
|
+
createdDateTime?: string;
|
|
136
|
+
lastModifiedDateTime: string;
|
|
137
|
+
parentReference?: {
|
|
138
|
+
path: string;
|
|
139
|
+
};
|
|
140
|
+
"@microsoft.graph.downloadUrl"?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface TeamsChat {
|
|
143
|
+
id: string;
|
|
144
|
+
topic?: string;
|
|
145
|
+
chatType: string;
|
|
146
|
+
members?: {
|
|
147
|
+
displayName: string;
|
|
148
|
+
userId: string;
|
|
149
|
+
}[];
|
|
150
|
+
lastUpdatedDateTime: string;
|
|
151
|
+
}
|
|
152
|
+
export interface TeamsMessage {
|
|
153
|
+
id: string;
|
|
154
|
+
from?: {
|
|
155
|
+
user?: {
|
|
156
|
+
displayName: string;
|
|
157
|
+
id: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
body: {
|
|
161
|
+
contentType: string;
|
|
162
|
+
content: string;
|
|
163
|
+
};
|
|
164
|
+
createdDateTime: string;
|
|
165
|
+
}
|
|
166
|
+
export interface TodoList {
|
|
167
|
+
id: string;
|
|
168
|
+
displayName: string;
|
|
169
|
+
isOwner: boolean;
|
|
170
|
+
wellknownListName: string;
|
|
171
|
+
}
|
|
172
|
+
export interface TodoTask {
|
|
173
|
+
id: string;
|
|
174
|
+
title: string;
|
|
175
|
+
status: string;
|
|
176
|
+
importance: string;
|
|
177
|
+
dueDateTime?: {
|
|
178
|
+
dateTime: string;
|
|
179
|
+
timeZone: string;
|
|
180
|
+
};
|
|
181
|
+
body?: {
|
|
182
|
+
contentType: string;
|
|
183
|
+
content: string;
|
|
184
|
+
};
|
|
185
|
+
createdDateTime: string;
|
|
186
|
+
}
|
|
187
|
+
export interface OrgUser {
|
|
188
|
+
id: string;
|
|
189
|
+
displayName: string;
|
|
190
|
+
mail?: string;
|
|
191
|
+
userPrincipalName: string;
|
|
192
|
+
jobTitle?: string;
|
|
193
|
+
department?: string;
|
|
194
|
+
officeLocation?: string;
|
|
195
|
+
mobilePhone?: string;
|
|
196
|
+
businessPhones?: string[];
|
|
197
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sam2kb/m365-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Production-grade Microsoft 365 MCP server — email, calendar, contacts, OneDrive, Teams, tasks, and users via delegated OAuth",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"m365-mcp": "dist/index.js",
|
|
9
|
+
"m365-mcp-auth": "dist/auth-cli.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"dev": "tsx src/index.ts",
|
|
15
|
+
"auth": "tsx src/auth-cli.ts",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"mcp",
|
|
21
|
+
"microsoft365",
|
|
22
|
+
"outlook",
|
|
23
|
+
"teams",
|
|
24
|
+
"onedrive",
|
|
25
|
+
"graph-api"
|
|
26
|
+
],
|
|
27
|
+
"author": "Alex Kay <info@wittyfinch.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/sam2kb/m365-mcp"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^20.10.0",
|
|
41
|
+
"tsx": "^4.7.0",
|
|
42
|
+
"typescript": "^5.3.0",
|
|
43
|
+
"vitest": "^3.2.4"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"types": ["node"]
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["node_modules", "dist", "src/__tests__"]
|
|
19
|
+
}
|