home / mcp / mailnet mcp server

MailNet MCP Server

Provides unified Gmail and Outlook management via the MCP, including credential hygiene and a rich toolset for agent-driven email workflows.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "astroa7m-mailnet-mcp-server": {
      "command": "uv",
      "args": [
        "run",
        "-m",
        "mcp_launcher.server"
      ],
      "env": {
        "AZURE_CLIENT_SECRET_VALUE": "<AZURE_CLIENT_SECRET_VALUE>",
        "AZURE_APPLICATION_CLIENT_ID": "<AZURE_APPLICATION_CLIENT_ID>",
        "GOOGLE_CREDENTIALS_FILE_PATH": "C:\\Path\\To\\google_credentials.json",
        "AZURE_PREFERRED_TOKEN_FILE_PATH": "C:\\Path\\To\\azure_token.json",
        "GOOGLE_PREFERRED_TOKEN_FILE_PATH": "C:\\Path\\To\\google_token.json"
      }
    }
  }
}

MailNet MCP Server provides a unified, agentic orchestration layer for managing Gmail and Outlook within the Model Context Protocol. It standardizes credentials, offers a rich email tooling surface, and enables agent-driven workflows with secure token handling and easy provider extensions.

How to use

Start the MailNet MCP Server using your preferred launcher. You can run it through the local runtime or via the UCV launcher for asynchronous operation, and then connect an MCP client to issue actions such as sending, reading, drafting, and organizing emails. Use the available tools to compose, fetch, search, label, archive, reply, delete, and manage settings within your email workflow. The server exposes a consistent surface so your client can switch between Gmail and Outlook without changing your application logic.

Within your MCP client, load the email settings to tailor tone, signature, and thread context, then execute actions through the corresponding tool calls. For example, you can compose a message, draft it, review a thread, and apply labels all within a single, cohesive workflow. The system automatically handles token refresh and credential hygiene for supported providers, so you can focus on your automation logic.

How to install

Prerequisites: Ensure you have Python installed with access to pip for dependency management. You may also use the UV launcher for convenient process orchestration.

git clone https://github.com/Astroa7m/MailNet-MCP-Server.git
cd MailNet-MCP-Server

Install dependencies from the requirements file. If you plan to run with UV as the launcher, install UV first, then install the Python requirements.

pip install -r requirements.txt
```

If you intend to use UV as the launcher, install UV with the following command (powershell on Windows):

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

Launch options for the MCP server are shown here. Pick one approach to start the server and begin issuing MCP calls from your client.

uv run -m mcp_launcher.server
```

Or, run directly with Python without UV:

```
python -m mcp_launcher.server

Additional sections

Configuration and credentials are centralized in environment variables. Set up your provider credentials for Gmail and Outlook as shown in the environment examples. The server will automatically manage token refresh and credential hygiene for supported providers.

# 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

You can also integrate with Claude Desktop by adding the MCP server configuration to your Claude configuration. This allows you to drive email workflows directly from the Claude environment using the standard MCP runtime commands.

{
  "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"
      }
    }
  }
}

Available tools

send_email

Compose and send messages to recipients with optional attachments and headers

read_email

Fetch and inspect messages from inbox with filtering options

create_draft

Prepare messages to be sent later without delivering them immediately

send_draft

Finalize and send a previously created draft

search_email

Query inbox using semantic or keyword filters to locate messages

toggle_label

Apply or remove labels/categories on messages to organize them

archive_email

Move messages out of the primary inbox into an archive view

reply_email

Reply within the current thread context while preserving history

delete_email

Remove messages from the mailbox

load_email_settings

View the current email workflow and tone/signature settings

update_email_settings

Update runtime email settings such as language, tone, and signature