MCP Connector

Orchestrate Email with Gmail and Outlook

MailNet MCP Server connects Gmail and Outlook email operations through a shared interface with local or request-scoped OAuth credentials.

Works with gmailoutlook

88
Spark score
out of 100
Updated 2 months ago
Source checked Sep 24, 2026
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Unify your email management across Gmail and Outlook with a robust MCP server. Automate complex email tasks and integrate with agentic assistants for enhanced productivity.

Outcomes

What it gets done

01

Manage email across Gmail and Outlook via a unified interface.

02

Automate email sending, searching, archiving, and replying.

03

Securely inject credentials for seamless provider access.

04

Enable agentic workflows for advanced email management.

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Capabilities

Tools your agent gets

send_email

Create and send email messages

read_email

Retrieve and view email messages

create_draft

Prepare email messages as drafts

send_draft

Finalize and send prepared draft messages

search_email

Search mailbox with semantic filters

toggle_label

Change email categories and labels

archive_email

Archive messages to clean up mailbox

reply_email

Reply to messages in conversation context

+3 tools

Overview

An MCP server that exposes Gmail and Outlook mailbox operations and email composition settings. It supports both a deployed request-scoped credential flow and standalone local token files. Use it to connect an MCP application to Gmail or Outlook. Check the installed tool schemas and resolve the documented configuration-name inconsistencies during setup.

What it does

MailNet MCP Server exposes Gmail and Outlook operations through a shared MCP interface. It supports reading, searching, sending, replying, drafting, labeling, archiving, and deleting email. The MailNet application uses this server, but the server can also run independently for another MCP client. It provides an email integration layer rather than a complete autonomous inbox workflow.

The documented deployed architecture places a LangGraph API and APScheduler upstream of a streamable HTTP MCP server, which calls Gmail API or Microsoft Graph. In that deployment, encrypted credentials arrive in request headers, are decrypted for the operation, and can be refreshed before use. The server describes this path as avoiding a user database and discarding request credentials afterward. Local standalone operation instead uses token files, so its credential lifecycle differs from the deployed request-scoped path.

When to use - and when NOT to

Use it when an MCP client needs access to either supported provider without maintaining a separate email tool interface for each one. It also suits applications that need configurable drafting preferences alongside mailbox operations. Sending or deleting messages still requires the client to select the intended account, recipient, content, and action. A successful connection does not establish that an email action is appropriate.

The documented providers are Gmail and Outlook. Additional providers require implementation work through the base client abstraction and provider hooks. Do not assume that an arbitrary email service works merely because the server presents a unified interface.

Capabilities

The tool table includes read_email and search_email alongside send, reply, draft, label, archive, and delete operations. Some surrounding examples use plural tool names, so inspect the schemas exposed by the installed server before configuring tool calls.

The load_email_settings and update_email_settings tools manage preferences including language, tone, writing style, sender information, organization, signature, greeting, automatic tone adjustment, thread context, character limit, prompt prefix, and default provider. These preferences guide email composition; they do not replace provider authorization or account selection.

How to install

Clone the MailNet MCP Server repository, install its requirements, and launch the module. One documented launch command is:

uv run -m mcp_launcher.server

Local OAuth helpers obtain provider tokens through browser authorization. Outlook's helper uses a local callback on port 3000 and a manual authorization-code step; Gmail's helper opens the provider approval flow. Configure the resulting token-file locations and the provider application credentials, and enable the documented is_local setting for local token mode.

Check configuration names against the installed implementation. The Outlook helper example uses AZURE_SECRET_VALUE, while the configuration table names AZURE_CLIENT_SECRET_VALUE. Gmail's prose and configuration table also differ about credential versus token paths: the table distinguishes GOOGLE_CREDENTIALS_FILE_PATH from GOOGLE_PREFERRED_TOKEN_FILE_PATH. Resolve these differences before supplying credentials.

Who it's for

The server is for developers connecting MCP applications to Gmail or Outlook, including those extending the provider abstraction or integrating the email settings tools into a drafting experience.

Source README

MailNet MCP Server

MailNet Server is a unified, agentic email orchestration server built for the Model Context Protocol. It supports Gmail and Outlook with standardized metadata, secure credential injection, and a rich toolset for assistant-driven workflows. It is the MCP server that powers MailNet Mailing Agentic AI, live at getmailnet.com.


Features

  • Unified Gmail + Outlook abstraction
  • Automatic token refresh and credential hygiene
  • Standardized base class for provider extension
  • Agentic email settings endpoint (tone, signature, thread context, etc.)
  • Modular toolset: send, read, search, label, archive, reply, delete, draft

How it fits into MailNet

In the deployed MailNet stack this server runs as its own container (mcp, streamable HTTP on port 9111) and is the only component that talks to mailboxes. Everything email-shaped goes through it:

LangGraph agent (api)  ──┐
                         ├──>  MCP server :9111  ──>  provider layer  ──>  Gmail API
Scheduler (APScheduler) ─┘        (this repo)                        └──>  Microsoft Graph
  • Per-request credentials, no stored state. The agent and the scheduler pass each user's OAuth tokens as encrypted HTTP headers on every call; the server decrypts, refreshes if needed, acts, and forgets. It holds no user database.
  • One tool surface, two providers. Tools like send_email, read_emails, and search_emails accept an optional provider parameter; the provider layer hides the differences between the Gmail API and Microsoft Graph.
  • Standalone by design. The same server also runs solo for local/Claude Desktop use with token files, as described below - MailNet is one consumer of it, not a requirement.

Installation

Running the full MailNet application (web UI, agent, and this server together)? Follow the MailNet repo's Getting started instead; it wires this server up via Docker Compose automatically. The steps below are for running the MCP server standalone (for example with Claude Desktop).

1. Manual Clone & Launch
git clone https://github.com/Astroa7m/MailNet-MCP-Server.git
cd MailNet-MCP-Server
Install requirements

pip install -r requirements.txt

Note if you are going to use uv for launching you should first install it via:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Launch

Either with uv via:

uv run -m mcp_launcher.server

or

python -m mcp_launcher.server

Acquiring Azure Token (Personal local use)
  1. Go to email_client/outlook_helpers.py.
  2. run the file (by default runs acquiring_azure_token_for_personal_use function. To acquire client_id & client_secret Please check Azure Authorization Guide And make sure to add them to your env vars with the names shown below.
def acquiring_azure_token_for_personal_use():
    load_dotenv()
    client_id = os.getenv("AZURE_APPLICATION_CLIENT_ID")
    client_secret = os.getenv("AZURE_SECRET_VALUE")
    OutlookClient(client_id=client_id, client_secret=client_secret,
                                 redirect_uri="http://localhost:3000/callback")

It will do the following:

  • launch the browser and prompt you to sign in to your outlook account.
  • After successful login and approval of permissions, it will redirect you to http://localhost:3000/callback unless you specified different url in the constructor via redirect_uri param.
  • Copy the code after code= and before &client_info within the browser url and paste it in the terminal where you launched the file.
  • Done now you will have your azure token under email_client named azure_token.json by default (can be changed via token_file_name param in OutlookClient constructor).
  1. Provide that path to AZURE_PREFERRED_TOKEN_FILE_PATH env variable and you are good to go.

Acquiring Google Token (Personal local use)
  1. Go to email_client/gmail_helpers.py.
  2. run the file (by default runs acquiring_google_token_for_personal_use function. To acquire google_credentials_file Please check Google Authorization Guide And make sure to add the path to it in your env vars with the name shown below.
def acquiring_google_token_for_personal_use():
    load_dotenv()
    google_credentials_file = os.getenv("GOOGLE_CREDENTIALS_FILE_PATH")
    GmailClient(credential_file=google_credentials_file)

It will do the following:

  • launch the browser and prompt you to sign in to your gmail account.
  • After successful login and approval of permissions, it will redirect you to a window with a message The authentication flow has completed. You may close this window. that means you are done here.
  • Done now you will have your google token under email_client named google_token.json by default (can be changed via token_file_name param in GmailClient constructor).
  1. Provide that path to GOOGLE_CREDENTIALS_FILE_PATH env variable and you are good to go.

Environment Variables

Check the Azure Authorization Guide and Google Authorization Guide to learn how to set up both accounts and get your credentials ready.

Set your environment variables for provider credentials:

Gmail

GOOGLE_CREDENTIALS_FILE_PATH=path/to/google_credentials.json
GOOGLE_PREFERRED_TOKEN_FILE_PATH=path/to/google_token.json

Outlook (Azure)

AZURE_APPLICATION_CLIENT_ID=your-client-id
AZURE_CLIENT_SECRET_VALUE=your-secret
AZURE_PREFERRED_TOKEN_FILE_PATH=path/to/azure_token.json

Other (Important for local use)

The following env variable is important to be set when running it locally or for Claude Desktop. The value deosn't matter but as long as the field is there you will be able to run it locally. It was introduced to make the server flexible to be run over http/s or stdio and to route the server to either look for credentials in local files or expect it from the client via http/s headers.

is_local="true"


Claude Desktop Integration

Add the following to your claude_desktop_config.json:

{
  "mcpservers": {
    "email_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\Path\\To\\mcp-server",
        "run",
        "-m",
        "mcp_launcher.server"
      ],
      "env": {
        "AZURE_APPLICATION_CLIENT_ID": "<AZURE_APPLICATION_CLIENT_ID>",
        "AZURE_CLIENT_SECRET_VALUE": "<AZURE_CLIENT_SECRET_VALUE>",
        "AZURE_PREFERRED_TOKEN_FILE_PATH": "C:\\Path\\To\\azure_token.json",
        "GOOGLE_CREDENTIALS_FILE_PATH": "C:\\Path\\To\\google_credentials.json",
        "GOOGLE_PREFERRED_TOKEN_FILE_PATH": "C:\\Path\\To\\google_token.json",
        "is_local": "true"
      }
    }
  }
}

Agentic Email Settings

You can view settings via the load_email_settings tool or update them via the update_email_settings tool.

{
  "language": "en",
  "tone": "formal",
  "writing_style": "clear_and_concise",
  "sender_name": "Ahmed Samir",
  "organization_name": "Kalima Tech",
  "include_signature": true,
  "signature": "Best regards,\n{{sender_name}}\n{{organization_name}}",
  "preferred_greeting": "Dear {{recipient_name}},",
  "auto_adjust_tone": true,
  "include_thread_context": true,
  "character_limit": 1000,
  "prompt_prefix": "You are an AI email assistant for {{organization_name}}. Keep messages professional, polite, and to the point.",
  "default_provider": "google"
}

Tools Supported

Tool Description
send_email Compose and send messages
read_email Fetch and inspect messages
create_draft Prepare messages
send_draft Finalize and send
search_email Query inbox with semantic filters
toggle_label Modify categories/labels
archive_email Clean up inbox
reply_email Respond in thread context
delete_email Remove messages
load_email_settings View current email settings
update_email_settings Update runtime email settings

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.