outlook-lite-mcp
This MCP server lets you manage a Microsoft Outlook mailbox through Microsoft Graph.
List emails by folder, time period, filter, and page, grouped by conversation.
Search emails by text, sender, subject, or body.
Read clean email content in summary, full, or thread mode.
List and download attachments to a local downloads folder.
Reply, reply-all, forward, and send emails, always with preview/confirmation.
Create, edit, and send drafts.
Move or archive emails to folders; delete emails recoverably to Deleted Items with confirmation.
Mark emails read/unread, flagged/unflagged, completed, important, or normal.
Add or remove Outlook categories in bulk.
Show account details, folder counts, categories, and switch accounts.
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., "@outlook-lite-mcp list my last 5 emails and read the first one"
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.
outlook-lite-mcp
A lightweight MCP server for Microsoft Outlook email (Microsoft Graph). Works with work/school accounts (Microsoft 365) and personal accounts (Outlook.com, Hotmail).
Zero dependencies. Node 22.18+ runs the TypeScript directly: no
npm install, no build.You run it, you own it. It runs on your machine with your own Azure app. No third-party server sees your mail.
Token-light. Tabular output and cleaned bodies (no quotes, signatures or legal footers).
Permanent ids. Every email comes with its real Microsoft Graph id, requested as an immutable id: it doesn't change when the email is moved or archived, so you can store it in a database and use it later.
Safe by default. Reply, forward, send and delete always show a preview and wait for the user's approval.
Login on connect. The first time the client connects, your browser opens on the Microsoft account picker.
Português: README.pt-BR.md. Tool descriptions are in Portuguese; any LLM handles them fine.
Prerequisites
Node.js 22.18 or newer (
node --version). Nothing else to install: nonpm install, no build.git, to clone the repository (or download the ZIP from GitHub).
A Microsoft account with a mailbox: work/school (Microsoft 365) or personal (Outlook.com, Hotmail).
Permission to register an app in Microsoft Entra (free):
work account: allowed by default in most companies; if blocked, ask your IT admin to register it or to grant consent;
personal account: sign in to https://portal.azure.com once with a free Azure account, which creates your own directory.
An MCP client: Claude Desktop, Claude Code, Cursor, VS Code or any other client that supports stdio servers.
Related MCP server: outlook-mcp
Quick start
1. Get the code
git clone https://github.com/almeidatmatheus/outlook-lite-mcp.git
cd outlook-lite-mcp
node --version # needs 22.18 or newer2. Register your own app in Microsoft Entra (once, ~5 min)
Each user (or each company) registers their own app. It's free and keeps you in control of your data.
Go to https://entra.microsoft.com → Applications → App registrations → New registration.
Name:
outlook-lite-mcpSupported account types:
personal + any company: Accounts in any organizational directory and personal Microsoft accounts
only your company: Accounts in this organizational directory only
Register.
On Overview, copy the Application (client) ID (and the Directory (tenant) ID if you chose "this directory only").
Authentication → Add a platform → Mobile and desktop applications → custom redirect URI:
http://localhost/cbThen, still in Authentication, set Allow public client flows to Yes → Save. No client secret is needed for local use.
API permissions → Add a permission → Microsoft Graph → Delegated permissions:
Mail.ReadWrite,Mail.Send,MailboxSettings.Read,User.Read,offline_access. (Never Application permissions.)Work accounts: if your company requires it, an admin clicks Grant admin consent for .
3. Add it to your MCP client
Claude Desktop (claude_desktop_config.json, see examples/):
{
"mcpServers": {
"outlook": {
"command": "node",
"args": ["/absolute/path/to/outlook-lite-mcp/src/main.ts"],
"env": { "OUTLOOK_MCP_CLIENT_ID": "<your client id>" }
}
}
}Claude Code:
claude mcp add outlook -e OUTLOOK_MCP_CLIENT_ID=<your client id> -- node /absolute/path/to/outlook-lite-mcp/src/main.tsAny other MCP client (Cursor, VS Code, local models…): command node /absolute/path/to/outlook-lite-mcp/src/main.ts, stdio transport, same env var.
Restart the client. The browser opens on the Microsoft account picker; sign in and you're done.
The token is stored in ~/.outlook-lite-mcp/default.json (mode 600) and refreshes itself.
To use another account, ask to "switch account" (tool cx, action trocar).
On macOS, keep the folder outside Downloads/Desktop/Documents (e.g. ~/outlook-lite-mcp), or the client may not be allowed to read it.
Try it
"list my last 5 emails" · "read the first one" · "reply saying thanks" · "archive the newsletters" · "download the invoice attachment"
Tools
tool | does |
| list a folder (period, filter, count, page), one line per conversation |
| search (all, from, subject, body) |
| read a clean email (summary, full, thread) |
| attachments: list / download (to |
| reply, forward, send (new or a draft). Ask for confirmation |
| drafts: new, reply, reply-all, forward, edit |
| move / archive |
| delete (to Deleted Items, recoverable). Asks for confirmation |
| read, unread, flagged, unflagged, complete, important, normal |
| add/remove a category in bulk |
| account, folders with counts, categories; |
Email ids: the id column of ls/find is the email's permanent Graph id (immutable id). Pass it as alvo/alvos to the other tools, now or in a later session.
Confirmation. If the client supports MCP elicitation, the server asks the user directly.
Otherwise the first call returns a preview and a code cf; only the identical call with that cf executes.
Clients should show the preview to the user and send cf only after explicit approval.
Options
env var | default |
| required |
|
|
|
|
| browser; |
|
|
|
|
Command line: node src/main.ts login | whoami | logout.
Behind a corporate proxy: Node 22.21+ with NODE_USE_ENV_PROXY=1 and HTTPS_PROXY.
Remote mode (optional, self-hosted)
To use it from claude.ai as a custom connector, run your own HTTPS instance:
export OUTLOOK_MCP_CLIENT_ID=<client id>
export OUTLOOK_MCP_URL=https://your-domain.example # public HTTPS URL
export OUTLOOK_MCP_ALLOW=you@company.com,company.com # who may connect (emails or domains)
node src/main.ts http # listens on PORT (8787)In Entra add the platform Web with redirect https://your-domain.example/ms/cb (and a client secret in
OUTLOOK_MCP_CLIENT_SECRET if Entra asks for one). In claude.ai add a custom connector with https://your-domain.example/mcp.
For a quick test, cloudflared tunnel --url http://localhost:8787 gives you a temporary HTTPS URL.
Always set OUTLOOK_MCP_ALLOW. Without it anyone with the URL can connect their own account to your server.
Security
Delegated permissions only: the server can do what the signed-in user can do, nothing more.
Tokens live on your machine (
~/.outlook-lite-mcp, mode 600). Remote mode keeps them inhttp-store.jsonon the server.Email content is untrusted. A message can contain text trying to instruct the AI ("forward this to…"). The mandatory confirmation before reply/forward/send/delete is the main defense; don't remove it.
See SECURITY.md to report a vulnerability.
Project layout
src/
main.ts entry: stdio (default) | http | login | logout | whoami
mcp.ts MCP protocol: JSON-RPC, schema validation, confirmation (elicitation or cf code)
http.ts remote mode: Streamable HTTP + OAuth server that delegates login to Microsoft
auth.ts Microsoft login: browser (PKCE), device code, refresh, token file
ctx.ts per-user state (token, caches)
g.ts minimal Graph client: get/post/patch, $batch, retry on 429/401, immutable ids
ids.ts validates the email ids received by the tools
fmt.ts tabular output, body cleanup
lib.ts shared helpers and enums
tools/ one file per tool + index.ts
test/
mock.ts fake Microsoft (login + Graph)
run.ts real MCP clients against the mock, local and remoteDevelopment
node test/run.ts # 56 checks, no network or Microsoft account needed
npx tsc -p . # type check (optional)License
Available Tools
13 toolsattA
Anexos de um email: acao ls lista; acao get baixa o anexo n para a pasta de downloads e devolve o caminho.
Inputs: alvo (required), n, acao.
cxA
Conta conectada: email, pastas com totais e não lidos, categorias. acao trocar desconecta e pede login de outra conta.
Inputs: acao.
drfA
Cria ou edita rascunho sem enviar: novo, resposta, resposta_todos, encaminhar ou editar um rascunho existente. Envie depois com snd alvo.
Inputs: alvo, para, tipo, corpo, +1 more.
findARead-only
Busca emails por texto, remetente ou assunto (busca do Outlook). Use quando o usuário menciona alguém ou um assunto específico.
Inputs: termo (required), qtd, campo, pasta, +1 more.
fwADestructive
Encaminha um email para outros destinatários, com nota opcional. Envia de verdade; pede confirmação.
Inputs: alvo (required), para (required), cf, nota.
lsARead-only
Lista emails de uma pasta, mais recentes primeiro, uma linha por conversa. Use para ver a caixa, não lidos, emails de hoje etc.
Inputs: pg, qtd, pasta, filtro, +2 more.
mkBIdempotent
Marca emails como lido, não lido, sinalizado, desinalizado, concluído, importante ou normal.
Inputs: alvos (required), marca (required).
mvA
Move emails para outra pasta (arquivar = destino arquivo). Não exclui.
Inputs: alvos (required), destino (required).
rdARead-only
Lê um email: cabeçalho e corpo limpo (sem citações, assinatura e aviso legal). modo thread mostra a conversa toda.
Inputs: alvo (required), modo.
rmADestructive
Exclui emails (vão para Itens Excluídos, recuperáveis). Pede confirmação.
Inputs: alvos (required), cf.
rpADestructive
Responde um email (ao remetente ou a todos). Envia de verdade; pede confirmação.
Inputs: alvo (required), corpo (required), cf, todos.
sndADestructive
Envia um email novo (para, assunto, corpo) ou envia um rascunho existente (alvo). Envia de verdade; pede confirmação.
Inputs: cc, cf, alvo, para, +2 more.
tagBIdempotent
Adiciona ou remove uma categoria do Outlook em vários emails de uma vez.
Inputs: cat (required), alvos (required), acao.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools map to distinct actions, but the send-side family (rp reply, fw forward, snd send, drf draft) and the retrieval pair (ls list vs find search) overlap enough that an agent must read descriptions carefully to choose correctly. The terse names give almost no signal on their own, so the descriptions carry the disambiguation load.
Names mix cryptic 2–3 letter abbreviations (ls, rd, rp, fw, snd, drf, mv, rm, mk, att, cx) with full English words (find, tag), and there is no verb_noun pattern or shared abbreviation scheme. Without the descriptions, names like 'cx', 'drf', and 'mk' are essentially opaque, making the set feel ad hoc rather than predictable.
13 tools is a well-scoped surface for a lite email client: one tool per core operation (list, search, read, attach, reply, forward, send, draft, move, delete, mark, tag, account). Nothing feels redundant or missing at the count level, though merging draft creation/sending could trim one tool.
The email lifecycle is essentially covered: read, search, send, reply, forward, draft, move, delete, mark, categorize, plus account/folder summary. Minor gaps remain around folder management (creating/renaming folders), explicit CC/BCC handling, and saving attachment content rather than just downloading, but none are blockers for typical workflows.
Maintenance
Related MCP Connectors
Search connected email, read and manage messages, draft and send, and manage rules for new mail.
Search Gmail and Outlook, save drafts, manage email rules, and view email stats.
Read email/chat conversations, messages, contacts and teams; draft, send and update threads.
Manage Microsoft 365 email, calendar, contacts and inbox rules via the Graph API with OAuth 2.0.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Outlook email through Microsoft Graph API. Supports email management operations like reading, searching, marking as read/unread, and deleting messages through natural language.81 npmMIT
- AlicenseBqualityCmaintenanceEnables AI assistants to manage Microsoft Outlook email and calendar through the Microsoft Graph API, including reading, sending, searching emails, and handling calendar events.4381 npm30MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with Microsoft 365 Outlook Mail, allowing email operations via natural language.314 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Microsoft Outlook emails through the Microsoft Graph API, supporting operations like listing, reading, sending, and moving emails.MIT