Get the FREE Ultimate OpenClaw Setup Guide →

MailNet

MailNet Mailing MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio astroa7m-mailnet-mcp-server uv --directory /path/to/mcp-server run -m mcp_launcher.server \
  --env is_local="true" \
  --env AZURE_CLIENT_SECRET_VALUE="<your_azure_client_secret>" \
  --env AZURE_APPLICATION_CLIENT_ID="<your_azure_client_id>" \
  --env GOOGLE_CREDENTIALS_FILE_PATH="<path/to/google_credentials.json>" \
  --env AZURE_PREFERRED_TOKEN_FILE_PATH="<path/to/azure_token.json>" \
  --env GOOGLE_PREFERRED_TOKEN_FILE_PATH="<path/to/google_token.json>"

How to use

MailNet MCP Server provides a unified interface to manage Gmail and Outlook through a set of agentic tools. It exposes operations such as sending, reading, drafting, replying, searching, labeling, archiving, and deleting emails, all through a consistent provider-agnostic API. The server supports automatic token refresh and credential hygiene, and it includes an administrator-friendly settings surface to tune tone, signatures, thread context, and other preferences for generated email content. To operate it locally, launch the MCP server using your preferred launcher (uv or standard Python) and then interact with the tools via the provided endpoints or client wrappers. The included tools enable an assistant to perform end-to-end email workflows, from composing a draft to sending a reply or updating labels, while honoring the configured agentic email settings.

How to install

Prerequisites:

  • Python 3.8+ and pip
  • git
  • Optional: uv (for faster local launches) as a convenience launcher
  1. Clone the repository git clone https://github.com/Astroa7m/MailNet-MCP-Server.git cd MailNet-MCP-Server

  2. Install dependencies pip install -r requirements.txt

  3. Configure credentials (example env vars shown; replace with your values)

    • Create or update your environment with credentials for Gmail and Outlook as described in the README: GOOCGLE_CREDENTIALS_FILE_PATH=/path/to/google_credentials.json GOOGLE_PREFERRED_TOKEN_FILE_PATH=/path/to/google_token.json AZURE_APPLICATION_CLIENT_ID=your-client-id AZURE_CLIENT_SECRET_VALUE=your-secret AZURE_PREFERRED_TOKEN_FILE_PATH=/path/to/azure_token.json is_local=true
  4. Launch the MCP server Using uv (recommended): uv run -m mcp_launcher.server

    Or using Python directly: python -m mcp_launcher.server

  5. Optional: set up Claude Desktop integration by configuring claude_desktop_config.json as shown in the README, pointing to the uv invocation and providing the necessary environment variables.

Additional notes

Tips and notes:

  • Ensure your Azure and Google credentials are kept secure and never committed to version control.
  • The is_local flag is used to control how credentials are provided to the server; set it to true for local development.
  • If you encounter token refresh issues, verify that the token file paths (GOOGLE_PREFERRED_TOKEN_FILE_PATH, AZURE_PREFERRED_TOKEN_FILE_PATH) exist and have the correct permissions.
  • The agentic email settings block can be updated at runtime via the provided tools (load_email_settings, update_email_settings) to customize tone, signature, and threading behavior.
  • For Claude Desktop integration, ensure the directory path to the MCP server is correct and that the env vars for credentials are present in the integration config.

Related MCP Servers

Sponsor this space

Reach thousands of developers