outlook-mcp/folder/index.js
Seton Carmichael a7886b5b2b Initial commit: Outlook MCP Server v1.0.0
MCP server providing Microsoft Outlook integration via Graph API:
- Email: list, search, read, send, thread reconstruction
- Calendar: list, create, decline, cancel, delete events
- Folders: list, create, move emails
- Inbox rules: list, create, reorder
- MSAL device code flow auth with persistent token cache
- Test mode with mock data
- Comprehensive README with setup, config, and tool reference

20 MCP tools across 5 modules. Node.js >= 14. MIT license.
2026-06-21 19:39:31 -04:00

78 lines
2 KiB
JavaScript

/**
* Folder management module for Outlook MCP server
*/
const handleListFolders = require('./list');
const handleCreateFolder = require('./create');
const handleMoveEmails = require('./move');
// Folder management tool definitions
const folderTools = [
{
name: "list-folders",
description: "Lists mail folders in your Outlook account",
inputSchema: {
type: "object",
properties: {
includeItemCounts: {
anyOf: [{ type: "boolean" }, { type: "string" }],
description: "Include counts of total and unread items"
},
includeChildren: {
anyOf: [{ type: "boolean" }, { type: "string" }],
description: "Include child folders in hierarchy"
}
},
required: []
},
handler: handleListFolders
},
{
name: "create-folder",
description: "Creates a new mail folder",
inputSchema: {
type: "object",
properties: {
name: {
type: "string",
description: "Name of the folder to create"
},
parentFolder: {
type: "string",
description: "Optional parent folder name (default is root)"
}
},
required: ["name"]
},
handler: handleCreateFolder
},
{
name: "move-emails",
description: "Moves emails from one folder to another",
inputSchema: {
type: "object",
properties: {
emailIds: {
type: "string",
description: "Comma-separated list of email IDs to move"
},
targetFolder: {
type: "string",
description: "Name of the folder to move emails to"
},
sourceFolder: {
type: "string",
description: "Optional name of the source folder (default is inbox)"
}
},
required: ["emailIds", "targetFolder"]
},
handler: handleMoveEmails
}
];
module.exports = {
folderTools,
handleListFolders,
handleCreateFolder,
handleMoveEmails
};