M

Mailindex MCP

by alexanderkrauck · io.github.alexanderkrauck/mailindex-mcp

A self-hosted mail client MCP server that indexes email in PostgreSQL, enabling AI agents to search, move, mark, delete, and draft messages with bulk operations and attachment text extraction via OCR.

oci Unknown transport GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-alexanderkrauck-mailindex-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "EMAILSERVER_DATABASE_URL=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_AUTH_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_API_TOKEN=<YOUR_VALUE>",
        "-e",
        "CREDENTIAL_ENCRYPTION_KEY=<YOUR_VALUE>",
        "-e",
        "SESSION_SECRET=<YOUR_VALUE>",
        "-e",
        "JWT_SIGNING_KEY=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_ID=<YOUR_VALUE>",
        "-e",
        "POSTGRES_PASSWORD=<YOUR_VALUE>",
        "-e",
        "REGISTRATION_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DOMAIN=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_SECRET=<YOUR_VALUE>",
        "-e",
        "ALLOWED_GOOGLE_EMAILS=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_OCR_LANGUAGES=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_SEARCH_TEXT_CONFIGS=<YOUR_VALUE>",
        "-e",
        "CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DELETION_RECONCILE_INTERVAL=<YOUR_VALUE>",
        "ghcr.io/alexanderkrauck/mailindex-mcp:0.3.3"
      ]
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-alexanderkrauck-mailindex-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "EMAILSERVER_DATABASE_URL=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_AUTH_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_API_TOKEN=<YOUR_VALUE>",
        "-e",
        "CREDENTIAL_ENCRYPTION_KEY=<YOUR_VALUE>",
        "-e",
        "SESSION_SECRET=<YOUR_VALUE>",
        "-e",
        "JWT_SIGNING_KEY=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_ID=<YOUR_VALUE>",
        "-e",
        "POSTGRES_PASSWORD=<YOUR_VALUE>",
        "-e",
        "REGISTRATION_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DOMAIN=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_SECRET=<YOUR_VALUE>",
        "-e",
        "ALLOWED_GOOGLE_EMAILS=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_OCR_LANGUAGES=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_SEARCH_TEXT_CONFIGS=<YOUR_VALUE>",
        "-e",
        "CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DELETION_RECONCILE_INTERVAL=<YOUR_VALUE>",
        "ghcr.io/alexanderkrauck/mailindex-mcp:0.3.3"
      ]
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-alexanderkrauck-mailindex-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "EMAILSERVER_DATABASE_URL=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_AUTH_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_API_TOKEN=<YOUR_VALUE>",
        "-e",
        "CREDENTIAL_ENCRYPTION_KEY=<YOUR_VALUE>",
        "-e",
        "SESSION_SECRET=<YOUR_VALUE>",
        "-e",
        "JWT_SIGNING_KEY=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_ID=<YOUR_VALUE>",
        "-e",
        "POSTGRES_PASSWORD=<YOUR_VALUE>",
        "-e",
        "REGISTRATION_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DOMAIN=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_SECRET=<YOUR_VALUE>",
        "-e",
        "ALLOWED_GOOGLE_EMAILS=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_OCR_LANGUAGES=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_SEARCH_TEXT_CONFIGS=<YOUR_VALUE>",
        "-e",
        "CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DELETION_RECONCILE_INTERVAL=<YOUR_VALUE>",
        "ghcr.io/alexanderkrauck/mailindex-mcp:0.3.3"
      ]
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-alexanderkrauck-mailindex-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "EMAILSERVER_DATABASE_URL=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_AUTH_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_API_TOKEN=<YOUR_VALUE>",
        "-e",
        "CREDENTIAL_ENCRYPTION_KEY=<YOUR_VALUE>",
        "-e",
        "SESSION_SECRET=<YOUR_VALUE>",
        "-e",
        "JWT_SIGNING_KEY=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_ID=<YOUR_VALUE>",
        "-e",
        "POSTGRES_PASSWORD=<YOUR_VALUE>",
        "-e",
        "REGISTRATION_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DOMAIN=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_SECRET=<YOUR_VALUE>",
        "-e",
        "ALLOWED_GOOGLE_EMAILS=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_OCR_LANGUAGES=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_SEARCH_TEXT_CONFIGS=<YOUR_VALUE>",
        "-e",
        "CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DELETION_RECONCILE_INTERVAL=<YOUR_VALUE>",
        "ghcr.io/alexanderkrauck/mailindex-mcp:0.3.3"
      ]
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-alexanderkrauck-mailindex-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "EMAILSERVER_DATABASE_URL=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_AUTH_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_API_TOKEN=<YOUR_VALUE>",
        "-e",
        "CREDENTIAL_ENCRYPTION_KEY=<YOUR_VALUE>",
        "-e",
        "SESSION_SECRET=<YOUR_VALUE>",
        "-e",
        "JWT_SIGNING_KEY=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_ID=<YOUR_VALUE>",
        "-e",
        "POSTGRES_PASSWORD=<YOUR_VALUE>",
        "-e",
        "REGISTRATION_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DOMAIN=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_SECRET=<YOUR_VALUE>",
        "-e",
        "ALLOWED_GOOGLE_EMAILS=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_OCR_LANGUAGES=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_SEARCH_TEXT_CONFIGS=<YOUR_VALUE>",
        "-e",
        "CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DELETION_RECONCILE_INTERVAL=<YOUR_VALUE>",
        "ghcr.io/alexanderkrauck/mailindex-mcp:0.3.3"
      ]
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-alexanderkrauck-mailindex-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "EMAILSERVER_DATABASE_URL=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_AUTH_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_API_TOKEN=<YOUR_VALUE>",
        "-e",
        "CREDENTIAL_ENCRYPTION_KEY=<YOUR_VALUE>",
        "-e",
        "SESSION_SECRET=<YOUR_VALUE>",
        "-e",
        "JWT_SIGNING_KEY=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_ID=<YOUR_VALUE>",
        "-e",
        "POSTGRES_PASSWORD=<YOUR_VALUE>",
        "-e",
        "REGISTRATION_MODE=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DOMAIN=<YOUR_VALUE>",
        "-e",
        "GOOGLE_CLIENT_SECRET=<YOUR_VALUE>",
        "-e",
        "ALLOWED_GOOGLE_EMAILS=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_OCR_LANGUAGES=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_SEARCH_TEXT_CONFIGS=<YOUR_VALUE>",
        "-e",
        "CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN=<YOUR_VALUE>",
        "-e",
        "EMAILSERVER_DELETION_RECONCILE_INTERVAL=<YOUR_VALUE>",
        "ghcr.io/alexanderkrauck/mailindex-mcp:0.3.3"
      ]
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
EMAILSERVER_DATABASE_URL Yes PostgreSQL connection URL. This server keeps its own index and does not run without a database; the repository ships docker-compose files that start one for you.
EMAILSERVER_AUTH_MODE No Authentication mode: 'development', 'single_user', or 'google'. Defaults to 'development'. Default: development
EMAILSERVER_API_TOKEN secret No A static bearer token for single-user mode. Must be at least 32 characters.
CREDENTIAL_ENCRYPTION_KEY secret No Secret used to encrypt mailbox credentials at rest. Generate with `openssl rand -base64 32`.
SESSION_SECRET No Secret used for session management. Generate with `openssl rand -base64 32`.
JWT_SIGNING_KEY No Secret used to sign JSON Web Tokens for OAuth. Generate with `openssl rand -base64 32`.
GOOGLE_CLIENT_ID No Google OAuth Web application client ID.
POSTGRES_PASSWORD No The password for the PostgreSQL database.
REGISTRATION_MODE No Either 'open' or 'allowlist'. Defaults to 'open'. Set to 'allowlist' to restrict registration. Default: open
EMAILSERVER_DOMAIN No The domain name of your server, used for TLS and OAuth redirect URIs.
GOOGLE_CLIENT_SECRET No Google OAuth Web application client secret.
ALLOWED_GOOGLE_EMAILS No JSON array of email addresses allowed to register when REGISTRATION_MODE=allowlist, e.g. ["owner@example.com"].
EMAILSERVER_OCR_LANGUAGES No Space-separated list of Tesseract OCR languages, e.g. 'deu+eng'.
EMAILSERVER_SEARCH_TEXT_CONFIGS No JSON array of language configurations for full-text search, e.g. ["simple", "english", "german"].
CLAIM_LEGACY_ACCOUNTS_ON_FIRST_LOGIN No Set to 'true' to allow an existing single-user owner to claim legacy accounts on first login after upgrading to Google auth.
EMAILSERVER_DELETION_RECONCILE_INTERVAL No Interval for reconciling deletions and flags, in seconds.

Similar servers