@mindstone/mcp-server-microsoft-mail 0.1.2 → 0.2.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/CHANGELOG.md +10 -0
- package/README.md +4 -3
- package/dist/compose.d.ts +54 -0
- package/dist/compose.js +72 -0
- package/dist/resources/compose-email-template.d.ts +2 -0
- package/dist/resources/compose-email-template.js +1035 -0
- package/dist/server.js +5 -0
- package/dist/tools.js +21 -0
- package/package.json +5 -1
- package/server.json +2 -2
package/dist/server.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { SERVER_NAME, SERVER_VERSION } from './types.js';
|
|
3
3
|
import { registerMailTools } from './tools.js';
|
|
4
|
+
import { COMPOSE_EMAIL_RESOURCE_URI } from './compose.js';
|
|
5
|
+
import { COMPOSE_EMAIL_HTML } from './resources/compose-email-template.js';
|
|
4
6
|
export function createServer() {
|
|
5
7
|
const server = new McpServer({
|
|
6
8
|
name: SERVER_NAME,
|
|
7
9
|
version: SERVER_VERSION,
|
|
8
10
|
});
|
|
9
11
|
registerMailTools(server);
|
|
12
|
+
server.registerResource('compose-email', COMPOSE_EMAIL_RESOURCE_URI, { mimeType: 'text/html' }, async (uri) => ({
|
|
13
|
+
contents: [{ uri: uri.href, mimeType: 'text/html', text: COMPOSE_EMAIL_HTML }],
|
|
14
|
+
}));
|
|
10
15
|
return server;
|
|
11
16
|
}
|
|
12
17
|
//# sourceMappingURL=server.js.map
|
package/dist/tools.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { callGraph } from './client.js';
|
|
3
|
+
import { handleComposeEmail } from './compose.js';
|
|
3
4
|
import { authRequiredJson, errorResponse, successJson, withErrorHandling, } from './utils.js';
|
|
4
5
|
import { AUTH_TOOL_NAME } from './types.js';
|
|
5
6
|
import { createDraft, createReplyDraft, deleteEmail, forwardEmail, getEmail, listEmails, listFolders, moveEmail, replyToEmail, searchEmails, sendEmail, } from './mail.js';
|
|
@@ -131,6 +132,26 @@ sign-in, Microsoft 365 tools become available.`,
|
|
|
131
132
|
return successJson(result);
|
|
132
133
|
}));
|
|
133
134
|
// ---------------------------------------------------------------------
|
|
135
|
+
// compose_email
|
|
136
|
+
// ---------------------------------------------------------------------
|
|
137
|
+
// Registered without withErrorHandling: the handler does no Graph I/O, and
|
|
138
|
+
// its McpError(InvalidParams) validation failure must surface as-is rather
|
|
139
|
+
// than as an auth-flavoured retry envelope.
|
|
140
|
+
server.registerTool('compose_email', {
|
|
141
|
+
description: 'Open an inline editable email compose form before sending. Use this when the user wants to write or send an email, so they can review and edit the draft first. Do NOT use when the user asks to save a draft (use create_draft). This tool does not send the email directly.',
|
|
142
|
+
inputSchema: z.object({
|
|
143
|
+
to: z.array(z.string()).describe('Recipient email address(es), e.g. ["alice@example.com"]'),
|
|
144
|
+
cc: z.array(z.string()).optional().describe('CC recipient(s)'),
|
|
145
|
+
subject: z.string().describe('Email subject'),
|
|
146
|
+
body: z.string().describe('Email body'),
|
|
147
|
+
}).shape,
|
|
148
|
+
annotations: {
|
|
149
|
+
readOnlyHint: false,
|
|
150
|
+
destructiveHint: false,
|
|
151
|
+
openWorldHint: false,
|
|
152
|
+
},
|
|
153
|
+
}, async (args) => handleComposeEmail(args));
|
|
154
|
+
// ---------------------------------------------------------------------
|
|
134
155
|
// search_emails
|
|
135
156
|
// ---------------------------------------------------------------------
|
|
136
157
|
server.registerTool('search_emails', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-microsoft-mail",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"mcpName": "io.github.mindstone/mcp-server-microsoft-mail",
|
|
5
5
|
"description": "Microsoft 365 Outlook mail via Graph: read, search, send, reply, forward, draft, move, delete.",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
|
@@ -31,9 +31,12 @@
|
|
|
31
31
|
"prepublishOnly": "npm run build && npm test",
|
|
32
32
|
"watch": "tsc --watch",
|
|
33
33
|
"start": "node dist/index.js",
|
|
34
|
+
"pretest": "npm run compose:template:check",
|
|
34
35
|
"test": "vitest run",
|
|
35
36
|
"test:watch": "vitest",
|
|
36
37
|
"test:coverage": "vitest run --coverage",
|
|
38
|
+
"compose:template": "node scripts/gen-compose-html.mjs",
|
|
39
|
+
"compose:template:check": "node scripts/gen-compose-html.mjs --check",
|
|
37
40
|
"security:internal-refs": "node scripts/check-internal-refs.mjs"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
"zod": "^3.23.0"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
48
|
+
"@mindstone/mcp-app-compose": "file:../../packages/mcp-app-compose",
|
|
45
49
|
"@mindstone/mcp-test-harness": "file:../../test-harness",
|
|
46
50
|
"@types/node": "^22",
|
|
47
51
|
"@vitest/coverage-v8": "^4.1.3",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.mindstone/mcp-server-microsoft-mail",
|
|
4
4
|
"title": "Microsoft 365 Mail",
|
|
5
5
|
"description": "Microsoft 365 Outlook mail via Graph: read, search, send, reply, forward, draft, move, delete.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/mindstone/mcp-servers",
|
|
9
9
|
"source": "github",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
16
16
|
"identifier": "@mindstone/mcp-server-microsoft-mail",
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.2.0",
|
|
18
18
|
"runtimeHint": "npx",
|
|
19
19
|
"transport": {
|
|
20
20
|
"type": "stdio"
|