MCP Outlook Server
FastMCP server for sending Outlook mail via Microsoft Graph. This project exists because the Agent Builder Outlook connector does not provide a send-email capability; the MCP server delivers that missing tool by exposing a single send_outlook_mail
entry point that validates payloads, obtains access tokens, and calls the Graph sendMail
endpoint.
Prerequisites
Python 3.10+
Microsoft Outlook/Graph account with
Mail.Send
permission (delegated token or app registration)uv
(recommended) orpip
Installation
Environment Variables
Set the following in .env
(create from .env.example
):
GRAPH_USER_ACCESS_TOKEN
– Optional delegated bearer token (e.g., from Graph Explorer) for quick testing.GRAPH_DEFAULT_SENDER
– Mailbox to send from, e.g.,user@outlook.com
.GRAPH_TENANT_ID
,GRAPH_CLIENT_ID
,GRAPH_CLIENT_SECRET
– Required only for app-only client credentials flow.
Load them before running:
Local Usage
Dry run (no email sent):
Send a live message (dry_run=False
) once configuration is confirmed. To expose the MCP tool to clients:
Testing
Unit tests cover token acquisition and payload construction.
Deployment Notes
fastmcp.json
is configured forfastmcp run
and FastMCP Cloud.Secrets should be supplied via environment variables on the target platform.
See
todo.md
for remaining tasks and deployment checklist.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables sending emails through Microsoft Outlook using the Microsoft Graph API. Provides the missing send-email capability for Agent Builder's Outlook connector with support for both delegated and app-only authentication flows.