
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
ms365-mcp-server
Advanced tools
Microsoft 365 MCP Server for managing Microsoft 365 email through natural language interactions with full OAuth2 authentication support
A powerful Model Context Protocol (MCP) server that enables seamless Microsoft 365 email integration through natural language interactions. Built for SIYA Desktop, LLMs, and any MCP-compatible application with production-ready security.
For detailed technical documentation, enhancement reports, and guides, see the docs/ directory:
send_email
- Send emails with attachments and rich formattingmanage_email
- UNIFIED: Read, search, list, mark, move, delete, or draft emailsget_attachment
- Download email attachments with metadatalist_folders
- Browse mailbox folders with item countsmanage_contacts
- UNIFIED: List all contacts or search by name/emailauthenticate
- UNIFIED: Complete authentication management (login, status, logout)Option A: Global Installation
# Install globally
npm install -g ms365-mcp-server
# Authenticate (no Azure setup needed!)
ms365-mcp-server --login
# Start the server
ms365-mcp-server
# Start with custom server URL
ms365-mcp-server --server-url https://your-domain.com
Option B: Run with npx (no installation needed)
# Authenticate
npx ms365-mcp-server --login
# Start the server
npx ms365-mcp-server
# Start with custom server URL
npx ms365-mcp-server --server-url https://your-domain.com
For Global Installation:
{
"mcpServers": {
"ms365": {
"command": "ms365-mcp-server",
"args": ["--server-url", "https://your-domain.com"]
}
}
}
For npx Usage:
{
"mcpServers": {
"ms365": {
"command": "npx",
"args": ["ms365-mcp-server", "--server-url", "https://your-domain.com"]
}
}
}
Chat with SIYA and ask it to help with your emails! The tools are designed for natural language interaction.
# One-command authentication
ms365-mcp-server --login
# Authentication with custom server URL
ms365-mcp-server --login --server-url https://your-domain.com
# Set server URL via environment variable
export SERVER_URL=https://your-domain.com
ms365-mcp-server
// Check authentication status
{
"tool": "authenticate",
"arguments": {
"action": "status"
}
}
// Login with device code
{
"tool": "authenticate",
"arguments": {
"action": "login"
}
}
// Logout
{
"tool": "authenticate",
"arguments": {
"action": "logout"
}
}
// Send an email with attachment
{
"tool": "send_email",
"arguments": {
"to": ["colleague@company.com"],
"subject": "Project Update",
"body": "<h2>Status Report</h2><p>Project is on track!</p>",
"bodyType": "html",
"attachments": [{
"name": "report.pdf",
"contentBytes": "base64_encoded_content"
}]
}
}
// Search emails with smart name matching
{
"tool": "manage_email",
"arguments": {
"action": "search",
"from": "John Smith", // Works with names or emails
"after": "2024-01-01",
"hasAttachment": true
}
}
// List recent inbox emails
{
"tool": "manage_email",
"arguments": {
"action": "list",
"folderId": "inbox",
"maxResults": 10
}
}
// Find emails sent to you (TO or CC)
{
"tool": "manage_email",
"arguments": {
"action": "search_to_me",
"from": "boss@company.com",
"isUnread": true
}
}
// Read a specific email
{
"tool": "manage_email",
"arguments": {
"action": "read",
"messageId": "email_id_here"
}
}
// Mark email as read
{
"tool": "manage_email",
"arguments": {
"action": "mark",
"messageId": "email_id",
"isRead": true
}
}
// Move email to folder
{
"tool": "manage_email",
"arguments": {
"action": "move",
"messageId": "email_id",
"destinationFolderId": "archive"
}
}
// Delete email
{
"tool": "manage_email",
"arguments": {
"action": "delete",
"messageId": "email_id"
}
}
// Create draft email
{
"tool": "manage_email",
"arguments": {
"action": "draft",
"draftTo": ["colleague@company.com"],
"draftSubject": "Draft: Project Update",
"draftBody": "<h2>Status Report</h2><p>Project is on track!</p>",
"draftBodyType": "html",
"draftCc": ["manager@company.com"],
"draftImportance": "normal"
}
}
// List all contacts
{
"tool": "manage_contacts",
"arguments": {
"action": "list",
"maxResults": 100
}
}
// Search contacts by name
{
"tool": "manage_contacts",
"arguments": {
"action": "search",
"query": "John"
}
}
// Get attachment from email
{
"tool": "get_attachment",
"arguments": {
"messageId": "email_id",
"attachmentId": "attachment_id"
}
}
// List mailbox folders
{
"tool": "list_folders",
"arguments": {}
}
// Download a specific attachment
{
"tool": "get_attachment",
"arguments": {
"messageId": "email_id",
"attachmentId": "attachment_id"
}
}
// Download all attachments from an email
{
"tool": "get_attachment",
"arguments": {
"messageId": "email_id"
}
}
The server automatically serves downloaded attachments. By default, files are served at http://localhost:55000/attachments/
. For production environments, configure the server URL using the SERVER_URL
environment variable:
# Local development (default)
SERVER_URL=http://localhost:55000 ms365-mcp-server
# Production environment
SERVER_URL=https://your-domain.com ms365-mcp-server
Files are:
Attachments are automatically cleaned up after 24 hours. You can also manually delete files from the public/attachments
directory.
// Create a basic draft
{
"tool": "manage_email",
"arguments": {
"action": "draft",
"draftTo": ["colleague@company.com"],
"draftSubject": "Project Update",
"draftBody": "Draft content here...",
"draftBodyType": "text"
}
}
// Create a threaded reply draft (automatically appears in email thread)
{
"tool": "manage_email",
"arguments": {
"action": "reply_draft",
"originalMessageId": "original_email_id",
"draftBody": "My reply content...", // Optional comment
"replyToAll": false
}
}
// Create a forward draft (automatically includes original content)
{
"tool": "manage_email",
"arguments": {
"action": "forward_draft",
"originalMessageId": "original_email_id",
"draftBody": "Forwarding this for your review..." // Optional comment
}
}
// Update an existing draft
{
"tool": "manage_email",
"arguments": {
"action": "update_draft",
"draftId": "draft_email_id",
"draftSubject": "Updated Subject",
"draftBody": "Updated content..."
}
}
// Send a saved draft
{
"tool": "manage_email",
"arguments": {
"action": "send_draft",
"draftId": "draft_email_id"
}
}
// List all draft emails
{
"tool": "manage_email",
"arguments": {
"action": "list_drafts",
"maxResults": 20
}
}
// List all folders including subfolders with hierarchy
{
"tool": "list_folders"
}
// List only child folders of a specific parent folder
{
"tool": "list_folders",
"arguments": {
"parentFolderId": "inbox_folder_id"
}
}
// Search for folders by name (case-insensitive)
{
"tool": "list_folders",
"arguments": {
"searchName": "projects"
}
}
# Authentication
ms365-mcp-server --login # Authenticate using device code
ms365-mcp-server --logout # Clear stored tokens
ms365-mcp-server --verify-login # Check authentication status
# Management
ms365-mcp-server --setup-auth # Interactive credential setup
ms365-mcp-server --reset-auth # Clear all authentication data
ms365-mcp-server --debug # Enable detailed logging
# Check current status
ms365-mcp-server --verify-login
# Reset and re-authenticate
ms365-mcp-server --logout
ms365-mcp-server --login
# Enable detailed logging
ms365-mcp-server --debug
# Logs location: /tmp/ms365-mcp-server.log
--login
--login
--login
again# Local development
npm run dev
# Build and test
npm run build
npm test
# Version management
npm run version-bump [patch|minor|major]
MIT License - see LICENSE file for details.
Contributions welcome! Please submit issues and pull requests.
Built with 🔒 Security and ❤️ for the AI community
Production-ready Microsoft 365 integration for SIYA Desktop and MCP applications
--server-url URL
: Set custom server URL for attachments and authentication (default: http://localhost:55000)SERVER_URL
: Environment variable to set server URL--setup-auth
: Set up MS365 API credentials--reset-auth
: Clear stored authentication tokens--multi-user
: Enable multi-user authentication mode--login
: Login to MS365--logout
: Logout from MS365--verify-login
: Verify login status--debug
: Enable debug output--non-interactive
, -n
: Run in non-interactive mode (no prompt)--help
, -h
: Show help messageFAQs
Microsoft 365 MCP Server for managing Microsoft 365 email through natural language interactions with full OAuth2 authentication support
The npm package ms365-mcp-server receives a total of 13 weekly downloads. As such, ms365-mcp-server popularity was classified as not popular.
We found that ms365-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.