outlooklivemcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
outlooklivemcp
A local Model Context Protocol server that gives an AI agent access to a personal Outlook.com / Hotmail / Live mailbox over Microsoft Graph — mail, folders, server-side search, drafts, contacts, and sending, with a config-driven allowlist of From addresses and an automatic signature.
Works with the Microsoft account you already have. A single signed-in mailbox can send as any address you allow (for example a personalized domain alias), and several MCP client sessions share one login through a background daemon.
create_draft → review in Outlook → send_draft (nothing sends without you)Features
Area | Tools |
Accounts |
|
| |
Drafts |
|
Sending |
|
Mail actions |
|
Contacts |
|
23 tools, each accepting an optional
accountid; omit it to use the default account.Drafts for review —
create_draftputs a message in the Drafts folder; it is never sent. Review it in Outlook or withget_message, thensend_draft(which refuses anything that is not a draft),update_draft, ordelete_draft.Sender allowlist —
send_mailandcreate_draftreject any From address outside the account's configuredsenders, enforced before any network call.Automatic signature — appended to outgoing mail and replies; opt out per call with
signature: false, or change the text in config any time (no restart needed).Shared daemon — one background process owns the login, so any number of MCP sessions share it without racing token refreshes.
Device-code login: no client secret, no redirect URI, no web server.
Related MCP server: outlook-mcp
Requirements
Node.js 20 or newer
A Microsoft account (personal Outlook.com / Hotmail / Live, or a work/school account)
A Microsoft Entra tenant where you can register an app — see below
1. Register an app in Microsoft Entra
The server talks to Microsoft Graph as a public client (no secret). You need one app registration in a tenant you control.
If you don't have a tenant:
Signing up for a free Azure account at https://azure.microsoft.com/free creates a default directory — that works, no payment needed.
Any tenant where you can create app registrations is fine.
Then:
Open https://entra.microsoft.com → Identity → Applications → App registrations → New registration.
Name: anything you like. Note that Microsoft rejects display names containing "Outlook" — pick something else, for example
My Mail Bridge.Supported account types: choose Accounts in any organizational directory and personal Microsoft accounts. This is required for a personal Outlook.com mailbox; a single-tenant app cannot sign one in.
Leave Redirect URI empty — device code flow does not need one.
Click Register and copy the Application (client) ID from the Overview page.
Go to Authentication → set Allow public client flows to Yes → Save. (If the preview blade does not save, switch to the old experience at the top of the Authentication page and set it there.)
Go to API permissions → Add a permission → Microsoft Graph → Delegated permissions, and add:
User.ReadMail.ReadWriteMail.SendContacts.ReadWriteoffline_access
No client secret is needed or wanted. For a personal account you consent as yourself during login; admin consent is not required.
2. Install and build
git clone https://github.com/aminkh17/outlooklivemcp.git
cd outlooklivemcp
npm install
npm run build3. Configure
node dist/index.js initThis writes a template to ~/.outlooklivemcp/config.json. Edit it and put your
Application (client) ID in:
{
"clientId": "YOUR-APPLICATION-CLIENT-ID",
"tenant": "common",
"scopes": [
"offline_access",
"User.Read",
"Mail.ReadWrite",
"Mail.Send",
"Contacts.ReadWrite"
],
"accounts": [
{
"id": "personal",
"label": "My mailbox",
"loginHint": "you@outlook.com",
"senders": ["you@outlook.com"],
"senderNames": { "you@outlook.com": "My Name" },
"signature": "My Name\nexample.com",
"defaultSender": "you@outlook.com"
}
]
}Key | Meaning |
| Application (client) ID from step 1 |
|
|
| Short id used in tool calls and token storage |
| Optional hint shown during login; never sent to Microsoft |
| The only addresses this account may send from — a hard allowlist |
| Optional friendly name per address, used for the From display name |
| Appended to every outgoing message; edit any time, no restart |
| Used when a tool call omits |
Add more objects under accounts for additional mailboxes — each signs in separately and
keeps its own tokens.
Sending from a custom domain alias
If your Microsoft account has a personalized domain (a grandfathered Outlook.com custom
domain, or an alias added at account.microsoft.com), put that address in senders:
"senders": ["you@yourdomain.com"],
"defaultSender": "you@yourdomain.com"The address must belong to the signed-in mailbox. Another person's alias on a shared
domain is not sendable from your token — that account must be added as its own entry
under accounts and sign in itself.
4. Sign in
node dist/index.js login --account personalOpen the printed URL, enter the code, and approve the permissions. Tokens are stored in
~/.outlooklivemcp/tokens.json with 0600 permissions and refreshed automatically.
node dist/index.js accounts # login state per account
node dist/index.js whoami # calls GET /me to confirm5. Wire it into your MCP client
OpenCode (~/.config/opencode/opencode.json):
{
"mcp": {
"outlook": {
"type": "local",
"command": ["node", "/absolute/path/to/outlooklivemcp/dist/index.js", "serve"],
"enabled": true
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"outlook": {
"command": "node",
"args": ["/absolute/path/to/outlooklivemcp/dist/index.js", "serve"]
}
}
}Any MCP client that speaks stdio works. The server logs only to stderr.
Shared daemon
dist/index.js is a thin stdio proxy. The first tool call starts a detached daemon
(dist/daemon.js) that owns the token store, and every session talks to it over
~/.outlooklivemcp/daemon.sock.
The daemon starts automatically on demand; there is only ever one.
One process refreshes tokens, so several MCP sessions can share one login safely.
config.jsonis reloaded on every request — changingsenders,senderNames, orsignaturetakes effect immediately, no restart.After 10 minutes idle it exits and restarts on the next call.
Logs go to
~/.outlooklivemcp/daemon.log(rotated at 5 MB). The socket is mode0600.
node dist/index.js status # health, pid, uptime, signed-in accounts
node dist/index.js stop-daemon # stop it; it restarts on demand
npm run daemon # run it in the foreground for debuggingCLI
outlooklivemcp [serve] Start the MCP server on stdio (default)
outlooklivemcp init [--force] Write a template config file
outlooklivemcp login [--account id] Sign in with the device-code flow
outlooklivemcp logout [--account id] Remove stored tokens for an account
outlooklivemcp accounts Show configured accounts and login state
outlooklivemcp whoami [--account id] Call GET /me and print the profile
outlooklivemcp config Show resolved config and token paths
outlooklivemcp status Show daemon health
outlooklivemcp stop-daemon Stop the shared daemon
outlooklivemcp help Show this helpEnvironment variables
Variable | Purpose |
| State directory (default |
| Config file path |
| Override the app client id |
| Override the OAuth tenant |
| Daemon idle timeout in seconds |
| Verbose logging to stderr |
Notes on Outlook.com personal accounts
Learned the hard way, and worth knowing before you fight deliverability:
The From display name is account-wide. Outlook.com consumer accounts stamp outgoing mail with the profile display name and ignore any name set on the message. You cannot have a different From name per alias — verified across
from.name,sender.name, andreplyTovariants, andPATCH /mereturns 405 for consumer accounts. The signature is therefore the reliable way to brand mail from an alias. (Work/school accounts honoursenderNamesin this server's config.)DKIM is not available on consumer personalized domains. Microsoft generates DKIM keys only for domains added to a Microsoft 365 / Exchange Online tenant. The consumer personalized-domain platform neither signs your mail nor exposes selectors to publish. The only route is moving the domain into a tenant.
DMARC you can do, and it passes on SPF alone. Because a personalized domain's
Return-Pathmatches itsFromand its SPF authorises Outlook, publishing_dmarc.<domain> TXT "v=DMARC1; p=none; rua=mailto:you@<domain>; fo=1"at your DNS host is enough to satisfy DMARC. Start withp=none(monitoring only).
Security notes
Tokens live in
~/.outlooklivemcp/tokens.json, mode0600. Treat that file like a password.The sender allowlist is enforced in code before any network call.
send_draftrefuses any message whoseisDraftflag is false, so it cannot re-send mail from another folder.The server never logs message bodies or tokens.
The daemon socket is a Unix socket with mode
0600, so only your user can connect.All logs go to stderr; stdout is reserved for MCP JSON-RPC.
To revoke access, remove the app at https://account.live.com/consent/Manage and delete the token file.
Troubleshooting
Symptom | Cause | Fix |
| App is single-tenant, or wrong tenant | Set supported account types to include personal accounts; use |
| Public client flow disabled | Authentication → Allow public client flows → Yes |
| Missing consent | Re-run |
| Refresh token expired or revoked |
|
| No token yet |
|
|
| Add it to |
| Wrong property name | Contact notes map to Graph's |
Name on sent mail is your account name, not your config name | Outlook.com consumer behaviour | See the platform notes above; use the signature |
| Microsoft's outbound content filter, not the recipient | Resend as plain text without marketing styling, links, or emoji; do not retry the identical message |
Development
npm run build # compile to dist/
npm run typecheck
npm run smoke # start the server, list tools, check config validation
npm run daemon # run the daemon in the foregroundscripts/smoke.mjs starts the server over stdio and lists every tool without touching
Graph. scripts/livetest.mjs and scripts/drafttest.mjs exercise live Graph calls and
need a signed-in account.
Acknowledgements
Architecture modelled on a shared-daemon pattern: a thin stdio proxy per MCP session and one background daemon that owns the credentials.
Support
If this project saves you time, you can buy me a coffee:
☕️ https://buymeacoffee.com/amin17
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.
Policy-guarded Gmail for AI agents: search, read, draft and send under rules you set.
Gmail, Outlook, iCloud, Fastmail and any IMAP mailbox for your agent. Scoped OAuth, approved sends.
AI agents search, read, sort and draft in your own mailboxes; send only to recipients you allow.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Microsoft Outlook via the Microsoft Graph API for managing emails and calendar events. It allows users to read and send emails, list messages, and create calendar appointments with automatic Teams links.2ISC
- AlicenseBqualityCmaintenanceEnables AI assistants to manage Microsoft Outlook email and calendar through the Microsoft Graph API, including reading, sending, searching emails, and handling calendar events.4333MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with Microsoft 365 Outlook Mail, allowing email operations via natural language.74 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