@injaan.dev/ms365-email-cli-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@injaan.dev/ms365-email-cli-mcp Show me my last 5 unread emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@injaan.dev/ms365-email-cli-mcp (DEPRECATED)
Deprecated Notice
This project is deprecated and discontinued.
Use @injaan.dev/ms365-email-cli instead, which now includes the MCP server feature natively.
Migration target:
npm install -g @injaan.dev/ms365-email-cliReason for deprecation: the original @injaan.dev/ms365-email-cli project has embedded MCP support, so this wrapper package is no longer needed.
Model Context Protocol (MCP) server wrapper for ms365-email-cli.
This package exposes mailbox operations as MCP tools and executes the local ms365-email-cli command under the hood.
Related MCP server: email-mcp
Prerequisites
Node.js 18+
ms365-email-cliinstalled and available in your shellPATHMS365 CLI config already initialized (
ms365-email-cli init)
Install
Local project install:
npm installGlobal CLI install from npm:
npm install -g @injaan.dev/ms365-email-cli-mcpRun
From source:
npm startFrom global install:
ms365-email-cli-mcpThe server uses stdio transport and is intended to be launched by an MCP-compatible client.
Configure in AI agents (Claude Code, OpenAI Codex, GitHub Copilot)
This package is an MCP stdio server. Most clients only need a command that starts it.
You can use either:
Global binary (recommended):
ms365-email-cli-mcpSource command:
node /absolute/path/to/ms365-email-cli-mcp/index.js
Before configuring any client, verify these are available in the same environment where your AI client runs:
ms365-email-cli-mcpms365-email-cli
1) Claude Code
Add the server (stdio):
# If installed globally
claude mcp add --transport stdio ms365-email-cli -- ms365-email-cli-mcp
# Or run from source
claude mcp add --transport stdio ms365-email-cli -- node /absolute/path/to/ms365-email-cli-mcp/index.jsUseful management commands:
claude mcp list
claude mcp get ms365-email-cliIf you prefer shared project config, Claude Code can also use a project .mcp.json:
{
"mcpServers": {
"ms365-email-cli": {
"type": "stdio",
"command": "ms365-email-cli-mcp"
}
}
}2) OpenAI Codex (CLI / extension)
Option A - add via CLI:
# If installed globally
codex mcp add ms365-email-cli -- ms365-email-cli-mcp
# Or run from source
codex mcp add ms365-email-cli -- node /absolute/path/to/ms365-email-cli-mcp/index.jsOption B - add in ~/.codex/config.toml (or project .codex/config.toml):
[mcp_servers."ms365-email-cli"]
command = "ms365-email-cli-mcp"
# Alternative source-based form:
# [mcp_servers."ms365-email-cli"]
# command = "node"
# args = ["/absolute/path/to/ms365-email-cli-mcp/index.js"]Check active servers:
codex mcp --help3) GitHub Copilot in VS Code
Create .vscode/mcp.json in your workspace (or use MCP: Open User Configuration):
{
"servers": {
"ms365-email-cli": {
"type": "stdio",
"command": "ms365-email-cli-mcp"
}
}
}Source-based alternative:
{
"servers": {
"ms365-email-cli": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/ms365-email-cli-mcp/index.js"]
}
}
}Then in VS Code:
Run MCP: List Servers from Command Palette.
Start/trust
ms365-email-cli.Open Chat and use the tools.
Quick verification prompt (any client)
Try asking your agent:
"List my last 5 emails"
"Show unread emails"
If tools do not appear, confirm your client process can resolve both ms365-email-cli-mcp and ms365-email-cli in PATH.
Available MCP tools
list_emailslist_unread_emailsread_emailthreadmark_readsearch_emailssend_email(supportsto,cc,subject,body,html,attachments)replyreply_allattachment
Notes
send_email.ccsupports either:a single string (
"manager@example.com")comma-separated string (
"a@example.com,b@example.com")array of strings (
["a@example.com", "b@example.com"])
Each CC value is forwarded to the CLI as repeatable
-cflags.Errors from the CLI are returned to MCP as tool errors.
Example MCP tool call shape (send_email)
{
"name": "send_email",
"arguments": {
"to": "user@example.com",
"cc": ["manager@example.com", "audit@example.com"],
"subject": "Hello",
"body": "Email body",
"html": false,
"attachments": ["./report.pdf"]
}
}Publish Checklist
Authenticate with npm:
npm loginVerify the package contents:
npm pack --dry-runPublish:
npm publishFor updates, bump version first:
npm version patch npm publish
npm Deprecation (maintainers)
Mark published versions as deprecated on npm so users see a warning on install:
npm deprecate "@injaan.dev/ms365-email-cli-mcp@*" "Deprecated and discontinued. Use @injaan.dev/ms365-email-cli with built-in MCP server."If needed, deprecate a specific range instead of all versions:
npm deprecate "@injaan.dev/ms365-email-cli-mcp@<=1.0.7" "Deprecated and discontinued. Use @injaan.dev/ms365-email-cli with built-in MCP server."Available Tools
10 toolsattachmentA
List or download attachments from an email. Lists attachments if no output directory is set; downloads to directory if output is set.
Inputs: id (required), output_dir.
list_emailsA
List recent emails (all statuses, newest first). Output includes ID, From, Subject, Received, Status for each email.
Inputs: count.
list_unread_emailsA
List unread emails (newest first). Output includes ID, From, Subject, Received. [+attachments] shown for file attachments.
Inputs: count.
mark_readA
Mark an email as read by message ID.
Inputs: id (required).
read_emailA
Read full email content by message ID. Shows: From, To, CC, Subject, Date, Body, Attachments.
Inputs: id (required).
replyA
Reply to the sender of an email (reply to original sender only).
Inputs: id (required), body (required), html, attachments.
reply_allA
Reply to all recipients of an email (original sender, To, and CC recipients).
Inputs: id (required), body (required), html, attachments.
search_emailsA
Search emails by various criteria. Use query for full-text search or combine from/subject/since filters.
Inputs: from, count, query, since, +2 more.
send_emailC
Send an email via MS365 mailbox.
Inputs: to (required), body (required), subject (required), cc, +2 more.
threadA
Show full conversation thread for an email. Fetches all messages in the same conversation, sorted oldest first.
Inputs: id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct email operation: listing, reading, threading, read status, searching, sending, replying, reply-all, and attachments. Even similar tools like list_emails and list_unread_emails are clearly separated by filter, so no real ambiguity.
Most tools follow a verb_noun pattern (list_emails, read_email, mark_read, search_emails, send_email, reply_all), but 'thread' and 'attachment' are nouns, and 'reply' is a bare verb. The naming is readable but not perfectly uniform.
With 10 tools, the server is well-scoped for an email CLI. Each tool addresses a core email workflow (read, list, search, send, reply, manage attachments), without excess or superficial additions.
The surface covers the main email lifecycle: list, read, search, send, reply, and attachments. Minor gaps exist such as no mark_unread, delete, or folder management, but these are not critical for basic email operations and can be worked around.
Maintenance
Related MCP Connectors
MCP server for Nylas — read email, calendars, events and contacts, and send email or create events.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
MCP server for MailTempo's public free temporary email inboxes.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- FlicenseAqualityDmaintenanceA lightweight MCP server for personal Microsoft Outlook/Hotmail accounts, enabling email search, reading, attachment management, and folder operations via Microsoft Graph API with OAuth device-code flow.61-
- AlicenseNot gradedqualityBmaintenanceMCP server for reading, searching, sending, and managing emails via IMAP/SMTP, with tools like list_emails, read_email, search_emails, send_email, get_attachment, get_account_info, and mark_email_read.31 npmISC
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes a Microsoft 365 mailbox via the Model Context Protocol, enabling AI assistants to search, read, and download emails and attachments, and optionally send mail.-
- FlicenseAqualityCmaintenanceA local MCP server that gives Claude read/write access to a personal Hotmail/Outlook.com mailbox via the Microsoft Graph API, exposing tools for listing, searching, sending, and drafting emails.6-