I

Imap MCP

by ni-c · io.github.ni-c/imap-mcp

Enables MCP clients to read, search, organise, and manage IMAP mailbox messages, including saving attachments and drafting replies, while treating mail content as untrusted and keeping write capabilities opt-in.

npm Local · stdio 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-ni-c-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<VALUE>",
        "IMAP_USER": "<VALUE>",
        "IMAP_PASSWORD": "<YOUR_VALUE>",
        "IMAP_PORT": "<VALUE>",
        "IMAP_TLS": "implicit",
        "IMAP_MAILBOX": "INBOX",
        "IMAP_SEEN_KEYWORD": "AiSeen",
        "IMAP_READ_ONLY": "true",
        "IMAP_ALLOW_TOOLS": "<VALUE>",
        "IMAP_DENY_TOOLS": "<VALUE>",
        "IMAP_DOWNLOAD_DIR": "<VALUE>",
        "IMAP_INSECURE_TLS": "false",
        "IMAP_DRAFTS_MAILBOX": "<VALUE>",
        "IMAP_MAX_MESSAGES": "100",
        "IMAP_MAX_ATTACHMENT_BYTES": "1048576",
        "IMAP_MAX_DOWNLOAD_BYTES": "26214400",
        "IMAP_MAX_EXTRACT_BYTES": "<VALUE>",
        "IMAP_COMMAND_TIMEOUT_SECONDS": "<VALUE>",
        "IMAP_ATTACHMENT_TYPES": "<VALUE>",
        "IMAP_TRUSTED_AUTHSERV_ID": "<VALUE>"
      }
    }
  }
}

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-ni-c-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<VALUE>",
        "IMAP_USER": "<VALUE>",
        "IMAP_PASSWORD": "<YOUR_VALUE>",
        "IMAP_PORT": "<VALUE>",
        "IMAP_TLS": "implicit",
        "IMAP_MAILBOX": "INBOX",
        "IMAP_SEEN_KEYWORD": "AiSeen",
        "IMAP_READ_ONLY": "true",
        "IMAP_ALLOW_TOOLS": "<VALUE>",
        "IMAP_DENY_TOOLS": "<VALUE>",
        "IMAP_DOWNLOAD_DIR": "<VALUE>",
        "IMAP_INSECURE_TLS": "false",
        "IMAP_DRAFTS_MAILBOX": "<VALUE>",
        "IMAP_MAX_MESSAGES": "100",
        "IMAP_MAX_ATTACHMENT_BYTES": "1048576",
        "IMAP_MAX_DOWNLOAD_BYTES": "26214400",
        "IMAP_MAX_EXTRACT_BYTES": "<VALUE>",
        "IMAP_COMMAND_TIMEOUT_SECONDS": "<VALUE>",
        "IMAP_ATTACHMENT_TYPES": "<VALUE>",
        "IMAP_TRUSTED_AUTHSERV_ID": "<VALUE>"
      }
    }
  }
}

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-ni-c-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<VALUE>",
        "IMAP_USER": "<VALUE>",
        "IMAP_PASSWORD": "<YOUR_VALUE>",
        "IMAP_PORT": "<VALUE>",
        "IMAP_TLS": "implicit",
        "IMAP_MAILBOX": "INBOX",
        "IMAP_SEEN_KEYWORD": "AiSeen",
        "IMAP_READ_ONLY": "true",
        "IMAP_ALLOW_TOOLS": "<VALUE>",
        "IMAP_DENY_TOOLS": "<VALUE>",
        "IMAP_DOWNLOAD_DIR": "<VALUE>",
        "IMAP_INSECURE_TLS": "false",
        "IMAP_DRAFTS_MAILBOX": "<VALUE>",
        "IMAP_MAX_MESSAGES": "100",
        "IMAP_MAX_ATTACHMENT_BYTES": "1048576",
        "IMAP_MAX_DOWNLOAD_BYTES": "26214400",
        "IMAP_MAX_EXTRACT_BYTES": "<VALUE>",
        "IMAP_COMMAND_TIMEOUT_SECONDS": "<VALUE>",
        "IMAP_ATTACHMENT_TYPES": "<VALUE>",
        "IMAP_TRUSTED_AUTHSERV_ID": "<VALUE>"
      }
    }
  }
}

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-ni-c-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<VALUE>",
        "IMAP_USER": "<VALUE>",
        "IMAP_PASSWORD": "<YOUR_VALUE>",
        "IMAP_PORT": "<VALUE>",
        "IMAP_TLS": "implicit",
        "IMAP_MAILBOX": "INBOX",
        "IMAP_SEEN_KEYWORD": "AiSeen",
        "IMAP_READ_ONLY": "true",
        "IMAP_ALLOW_TOOLS": "<VALUE>",
        "IMAP_DENY_TOOLS": "<VALUE>",
        "IMAP_DOWNLOAD_DIR": "<VALUE>",
        "IMAP_INSECURE_TLS": "false",
        "IMAP_DRAFTS_MAILBOX": "<VALUE>",
        "IMAP_MAX_MESSAGES": "100",
        "IMAP_MAX_ATTACHMENT_BYTES": "1048576",
        "IMAP_MAX_DOWNLOAD_BYTES": "26214400",
        "IMAP_MAX_EXTRACT_BYTES": "<VALUE>",
        "IMAP_COMMAND_TIMEOUT_SECONDS": "<VALUE>",
        "IMAP_ATTACHMENT_TYPES": "<VALUE>",
        "IMAP_TRUSTED_AUTHSERV_ID": "<VALUE>"
      }
    }
  }
}

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-ni-c-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<VALUE>",
        "IMAP_USER": "<VALUE>",
        "IMAP_PASSWORD": "<YOUR_VALUE>",
        "IMAP_PORT": "<VALUE>",
        "IMAP_TLS": "implicit",
        "IMAP_MAILBOX": "INBOX",
        "IMAP_SEEN_KEYWORD": "AiSeen",
        "IMAP_READ_ONLY": "true",
        "IMAP_ALLOW_TOOLS": "<VALUE>",
        "IMAP_DENY_TOOLS": "<VALUE>",
        "IMAP_DOWNLOAD_DIR": "<VALUE>",
        "IMAP_INSECURE_TLS": "false",
        "IMAP_DRAFTS_MAILBOX": "<VALUE>",
        "IMAP_MAX_MESSAGES": "100",
        "IMAP_MAX_ATTACHMENT_BYTES": "1048576",
        "IMAP_MAX_DOWNLOAD_BYTES": "26214400",
        "IMAP_MAX_EXTRACT_BYTES": "<VALUE>",
        "IMAP_COMMAND_TIMEOUT_SECONDS": "<VALUE>",
        "IMAP_ATTACHMENT_TYPES": "<VALUE>",
        "IMAP_TRUSTED_AUTHSERV_ID": "<VALUE>"
      }
    }
  }
}

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-ni-c-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<VALUE>",
        "IMAP_USER": "<VALUE>",
        "IMAP_PASSWORD": "<YOUR_VALUE>",
        "IMAP_PORT": "<VALUE>",
        "IMAP_TLS": "implicit",
        "IMAP_MAILBOX": "INBOX",
        "IMAP_SEEN_KEYWORD": "AiSeen",
        "IMAP_READ_ONLY": "true",
        "IMAP_ALLOW_TOOLS": "<VALUE>",
        "IMAP_DENY_TOOLS": "<VALUE>",
        "IMAP_DOWNLOAD_DIR": "<VALUE>",
        "IMAP_INSECURE_TLS": "false",
        "IMAP_DRAFTS_MAILBOX": "<VALUE>",
        "IMAP_MAX_MESSAGES": "100",
        "IMAP_MAX_ATTACHMENT_BYTES": "1048576",
        "IMAP_MAX_DOWNLOAD_BYTES": "26214400",
        "IMAP_MAX_EXTRACT_BYTES": "<VALUE>",
        "IMAP_COMMAND_TIMEOUT_SECONDS": "<VALUE>",
        "IMAP_ATTACHMENT_TYPES": "<VALUE>",
        "IMAP_TRUSTED_AUTHSERV_ID": "<VALUE>"
      }
    }
  }
}

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
IMAP_HOST Yes Hostname of the IMAP server, e.g. imap.example.net
IMAP_USER Yes Account username, usually the address
IMAP_PASSWORD secret Yes Password or app-specific password
IMAP_PORT No Port of the IMAP server; defaults by TLS mode (993 for implicit TLS, 143 for STARTTLS/none)
IMAP_TLS No TLS mode: implicit, starttls, or none Default: implicit
IMAP_MAILBOX No Mailbox the message tools default to Default: INBOX
IMAP_SEEN_KEYWORD No Keyword for new-mail tracking; empty turns it off Default: AiSeen
IMAP_READ_ONLY No Exactly 'false' registers the five mailbox tools; default is true Default: true
IMAP_ALLOW_TOOLS No Comma-separated tool names, list_* prefixes, or 'essential'
IMAP_DENY_TOOLS No Comma-separated tool names or prefixes to subtract from the allow list
IMAP_DOWNLOAD_DIR No Setting it allows saving attachments to this directory
IMAP_INSECURE_TLS No Exactly 'true' accepts a self-signed certificate Default: false
IMAP_DRAFTS_MAILBOX No Overrides the folder found via the \Drafts flag
IMAP_MAX_MESSAGES No Default page size for listing messages Default: 100
IMAP_MAX_ATTACHMENT_BYTES No Ceiling for returning an attachment inline Default: 1048576
IMAP_MAX_DOWNLOAD_BYTES No Ceiling for writing one attachment to disk Default: 26214400
IMAP_MAX_EXTRACT_BYTES No Ceiling for reading a document's text with mode=text (default: 10485760, maximum: 67108864)
IMAP_COMMAND_TIMEOUT_SECONDS No Seconds one IMAP command may take before the call is abandoned (default: 30, maximum: 600)
IMAP_ATTACHMENT_TYPES No Comma-separated content-type allowlist for attachments
IMAP_TRUSTED_AUTHSERV_ID No The authserv-id your provider stamps on Authentication-Results headers

Similar servers