outlook-email-mcp
v1.0.2
Published
MCP server for sending emails via Microsoft Outlook COM interop
Maintainers
Readme
Outlook Email MCP
An MCP (Model Context Protocol) server that enables sending emails via Microsoft Outlook COM interop on Windows.
Features
- 📧 Send emails through Microsoft Outlook installed on Windows
- 📎 Support for attachments (multiple files)
- 👥 CC and BCC recipients
- 🎨 HTML and plain text body formats
- ⚠️ Email importance levels (low, normal, high)
- 🏷️ Outlook categories support
- ✅ Comprehensive email validation
- 🔒 No authentication required (uses current Outlook user account)
Prerequisites
- Windows OS (7, 8, 10, 11 or Server editions)
- Microsoft Outlook (2016, 2019, 2021, or Microsoft 365) installed and configured
- Node.js 18+ (for running as MCP server)
Installation
✨ One-Click Install
Manual Install (npm)
npm install outlook-email-mcpOr add to your .vscode/mcp.json manually:
{
"servers": {
"outlook-email": {
"command": "npx",
"args": ["-y", "outlook-email-mcp"]
}
}
}Or for development:
git clone https://github.com/dwjobling/outlook-email-mcp.git
cd outlook-email-mcp
npm install
npm run buildUsage
GitHub Copilot Integration
Use this MCP server directly with GitHub Copilot in VS Code for natural language email sending:
Quick Setup:
npm install
npm run buildThen open the project in VS Code with GitHub Copilot installed. See COPILOT_SETUP.md for detailed instructions.
Example in Copilot Chat:
"Send an HTML email to [email protected] and [email protected] with CC to [email protected] about the project status, set as high priority"
Copilot will use the send_email tool to execute your request!
Setup Files for Copilot
.vscode/settings.json- VS Code configuration.vscode/mcp.json- MCP server configuration for CopilotCOPILOT_SETUP.md- Complete setup and troubleshooting guide
As an MCP Server
The package can be run as a standalone MCP server via stdio:
npm startThis will start the MCP server and listen for tool calls via standard input/output.
MCP Tool: send_email
Send an email with the following parameters:
Parameters
to(string, required): Email recipient(s). Multiple recipients can be comma-separated- Example:
"[email protected]"or"[email protected], [email protected]"
- Example:
subject(string, required): Email subject linebody(string, required): Email body contentbodyFormat(string, optional): Email body format- Options:
"text"(default),"html" - Use
"html"for formatted emails with CSS, tables, etc.
- Options:
cc(string, optional): Carbon copy recipient(s), comma-separatedbcc(string, optional): Blind carbon copy recipient(s), comma-separatedattachments(array of strings, optional): File paths to attach- Example:
["/path/to/file.pdf", "C:\\Users\\Name\\Document.docx"] - Paths must be absolute or relative to the current working directory
- Example:
importance(string, optional): Email priority level- Options:
"low","normal"(default),"high"
- Options:
categories(string, optional): Outlook categories, comma-separated- Example:
"Work, Urgent"
- Example:
Response
Success response:
{
"success": true,
"message": "Email sent successfully to [email protected]",
"messageId": "[outlook-entry-id]"
}Error response:
{
"success": false,
"message": "Failed to send email",
"error": "Invalid email address: not-an-email"
}Example Usage (via Node.js)
import { OutlookClient } from "outlook-email-mcp";
const client = new OutlookClient();
// Send a simple email
const response = await client.sendEmail({
to: "[email protected]",
subject: "Hello from Outlook MCP",
body: "This is a test email.",
});
console.log(response);
// Send an HTML email with attachments
const response = await client.sendEmail({
to: "[email protected]",
subject: "Report",
body: "<h1>Monthly Report</h1><p>Here is your report.</p>",
bodyFormat: "html",
cc: "[email protected]",
attachments: ["./report.pdf"],
importance: "high",
});
console.log(response);Development
Build
npm run buildWatch Mode
npm run devError Handling
The server handles various error conditions:
- Outlook not installed: Cannot create Outlook.Application COM object
- Outlook not running: May need Outlook to be open for sending
- Invalid email addresses: Email validation against standard format
- Attachment file not found: Each attachment path is verified
- COM errors: Outlook-specific errors (network issues, permission errors, etc.)
All errors return structured error responses through the MCP protocol.
Limitations
- Windows Only: Requires Windows OS with Outlook installed via COM interop
- Outlook Installation: Outlook must be installed and properly configured
- Outlook Access: May require Outlook to be running or properly licensed
- File Paths: Attachment paths must be accessible from the Node.js process
- Security Warnings: Outlook may show security prompts for programmatic email access (depending on version)
Troubleshooting
"Failed to initialize Outlook: Cannot create Outlook.Application COM object"
- Ensure Microsoft Outlook is installed on your system
- Verify Outlook installation is not corrupted by trying to open Outlook manually
- Check that you have the necessary permissions to access COM objects
"Attachment file not found"
- Verify file paths are absolute or relative to the current working directory
- Check file permissions - the process must have read access to the file
Emails not appearing in Outlook
- Check Outlook is running (may need to be open)
- Verify the email addresses are valid and formatted correctly
- Check Outlook for any error dialogs or security prompts
License
MIT
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
