Skip to main content
Glama
96b2gwbdg8-dev

imap-mail-mcp

imap-mail-mcp

An MCP (Model Context Protocol) server that lets Claude read, search, and send email over standard IMAP/SMTP. Works with any provider that supports username/password authentication over IMAP and SMTP — IONOS, GMX, Web.de, and most other non-Gmail/non-Microsoft providers.

Tools

Tool

Description

list_mailboxes

List all folders (INBOX, Sent, Drafts, Trash, custom folders, ...)

list_messages

List the most recent messages in a mailbox

search_messages

Search by sender, recipient, subject, body text, or date range

get_message

Fetch the full text/HTML body and attachment metadata of one message

mark_message

Mark a message as read/unread or flagged/unflagged

send_mail

Send a new email or reply to an existing one

Related MCP server: imail-mcp

Setup

  1. Install dependencies and build:

    npm install
    npm run build
  2. Copy .env.example to .env and fill in your mailbox credentials (only needed for local testing via npm start — see below for how credentials are supplied when running through Claude Desktop).

  3. If your provider supports 2FA / app-specific passwords, use one of those instead of your main account password.

Using it with Claude Desktop

Add an entry to your claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "imap-mail": {
      "command": "node",
      "args": ["/absolute/path/to/imap-mail-mcp/dist/index.js"],
      "env": {
        "EMAIL_USER": "you@example.com",
        "EMAIL_PASSWORD": "your-password-or-app-password",
        "IMAP_HOST": "imap.example.com",
        "IMAP_PORT": "993",
        "SMTP_HOST": "smtp.example.com",
        "SMTP_PORT": "587"
      }
    }
  }
}

Restart Claude Desktop fully (quit and reopen) after editing the config.

Environment variables

Variable

Required

Default

Notes

EMAIL_USER

yes

Mailbox login (usually your email address)

EMAIL_PASSWORD

yes

Password or app-specific password

IMAP_HOST

yes

e.g. imap.ionos.de

IMAP_PORT

no

993

IMAP over implicit TLS

SMTP_HOST

yes

e.g. smtp.ionos.de

SMTP_PORT

no

587

STARTTLS; use 465 for implicit TLS

For backwards compatibility, IONOS_EMAIL, IONOS_PASSWORD, IONOS_IMAP_HOST, IONOS_IMAP_PORT, IONOS_SMTP_HOST, and IONOS_SMTP_PORT are also accepted as aliases.

Security notes

  • Credentials are only ever read from environment variables. They are never logged, written to disk, or included in any response text beyond what the IMAP/SMTP server itself returns.

  • Claude Desktop's mcpServers config stores the env block in plain text on your machine. Anyone with access to your user account can read it, same as any other locally saved password.

  • .env is git-ignored — never commit real credentials.

Requirements

  • Node.js 18+

Available Tools

6 tools
get_messageB

Fetch the full content (text, html, attachments metadata) of a single message by UID.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYesMessage UID, from list_messages or search_messages
mailboxNoINBOX

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It states what is returned but does not mention whether the message is marked as read, if there are any side effects, or rate limits. For a read-like operation, the description could be more explicit about its non-destructive nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that conveys the core purpose without extraneous words. It is well-structured and easily scannable. A slight improvement could be front-loading the return value structure, but it is already efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and 50% parameter description coverage, the description is minimally complete for a simple fetch tool. It states what is returned but does not detail the structure (e.g., format of attachments metadata). Without annotations, it could provide more context about typical usage, but it covers the basics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only uid described). The description does not add extra meaning beyond the schema; it only says 'by UID'. The mailbox parameter is mentioned in schema but its purpose (e.g., which mailbox to fetch from) is not elaborated. This leaves ambiguity for the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Fetch', the resource 'full content of a single message', and the method 'by UID'. It specifies exactly what content is included (text, html, attachments metadata), which distinguishes it from siblings like list_messages (which returns metadata only) and search_messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives like list_messages (for listing) or search_messages (for searching). While the sibling list implies differentiation, the description lacks explicit usage guidance, such as 'Use this when you need the full message content rather than just the subject/date.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_mailboxesA

List all IMAP folders/mailboxes in the mailbox (e.g. INBOX, Sent, Drafts, Trash).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description accurately reflects the tool's behavior as a read-only listing operation. With no annotations provided, the description correctly indicates no side effects or special requirements. It could add more detail (e.g., 'this operation is non-destructive'), but the simplicity of the tool limits the need.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence (17 words) that is front-loaded with the verb and resource, followed by examples. Every word earns its place, and there is no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no output schema, and a straightforward purpose, the description fully covers what an agent needs to know: what it lists and representative examples. No additional information is necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist in the schema, so the description does not need to explain parameters. The description adds no parameter semantics, but the baseline for zero parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'List' and the resource 'all IMAP folders/mailboxes in the mailbox', with concrete examples (INBOX, Sent, Drafts, Trash). It distinguishes from sibling tools which deal with messages rather than folders.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly indicates when to use this tool (to list IMAP folders), and the context implicitly excludes alternatives since no sibling tool lists folders. It could be improved by explicitly stating 'use this to see the folder structure before working with messages', but the current text is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_messagesC

List the most recent messages in a mailbox, newest first.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
mailboxNoMailbox path, e.g. INBOX, Sent, TrashINBOX
unseenOnlyNoOnly return unread messages

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It mentions ordering but omits key behavioral traits like pagination, rate limits, or whether the operation is read-only. The description is too sparse.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the core purpose. Every word is necessary, and there is no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (3 optional params, no output schema), the description covers the basic purpose but leaves gaps in behavioral context such as return format or pagination. It is minimally adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 67%, but the description adds no additional parameter information beyond what the schema provides. It does not explain the 'limit' parameter meaning or compensate for the missing schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list', the resource 'messages in a mailbox', and the ordering 'newest first'. It provides a specific purpose but does not explicitly differentiate from sibling tools like 'search_messages'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives (e.g., 'search_messages' for filtered queries). The description lacks context about prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mark_messageC

Change the read or flagged status of a message.

ParametersJSON Schema
NameRequiredDescriptionDefault
uidYes
flagYes
mailboxNoINBOX

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states it changes status, but does not disclose if the operation is destructive, requires authentication, or has side effects. The mutating nature is implied but not explicitly noted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, very concise with no redundant words. It effectively communicates the core action. However, it may be too brief, lacking necessary details, but conciseness alone is strong.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given three parameters, an enum, and no output schema, the description is insufficiently complete. It does not describe return values, behavior on errors, or the effect on the message. The tool's simplicity is not fully captured.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description does not elaborate on any parameters. It does not explain the 'uid' (message identifier), the 'flag' values (seen, unseen, etc.), or the optional 'mailbox'. The enum is self-explanatory, but the description adds no value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'change' and the resource 'read or flagged status of a message', indicating the tool modifies message flags. It distinguishes from sibling tools like send_mail, list_messages, etc., which perform different operations. However, it does not mention that a specific message uid is required, which could be inferred from context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. The description does not indicate when to use this tool versus alternatives (e.g., get_message for reading, send_mail for sending). It lacks context on prerequisites or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_messagesA

Search messages in a mailbox by sender, recipient, subject, body text, or date range.

ParametersJSON Schema
NameRequiredDescriptionDefault
toNoFilter by recipient address/name
fromNoFilter by sender address/name
textNoFilter by body text substring
limitNo
sinceNoISO date, only messages on/after this date
beforeNoISO date, only messages before this date
unseenNoOnly unread messages
mailboxNoINBOX
subjectNoFilter by subject substring

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses filtering capabilities but lacks details on return format, pagination (implied by limit), side effects (e.g., if messages are marked as read), or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, lean sentence of 13 words that immediately states the tool's purpose, with no superfluous content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 9 parameters, no output schema, and no annotations, the description is adequate but incomplete. It doesn't explain output format, pagination, or potential combination logic, leaving gaps for an agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is high (78%), so baseline 3 is appropriate. The description adds natural-language grouping of filter parameters but doesn't elaborate on how they combine or the meaning of limit and mailbox beyond defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Search') and resource ('messages'), and lists common filtering criteria (sender, recipient, subject, body text, date range), clearly distinguishing this from sibling tools like list_messages or get_message.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (when needing to filter by those criteria) but provides no explicit guidance on when not to use it or how it compares to alternatives like list_messages.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_mailA

Send a new email, or reply to an existing one, via SMTP.

ParametersJSON Schema
NameRequiredDescriptionDefault
ccNo
toYesRecipient address(es), comma-separated
bccNo
htmlNoHTML body
textNoPlain text body
subjectYes
inReplyToNoMessage-Id being replied to
referencesNoReferences header for threading

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Only mentions 'via SMTP', implying network and auth requirements, but no details on rate limits, size constraints, error handling, or whether replies require existing message IDs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no unnecessary words. Information is front-loaded and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 parameters, no output schema, and no annotations, the description is too minimal. It lacks explanation of parameter formats (e.g., comma-separated recipients), required auth setup, success/error responses, and any limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 63%, so baseline is 3. Description does not add any additional meaning to parameters beyond what schema already provides. The reply functionality implies use of inReplyTo/references but is not explicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Send' or 'reply', resource 'email', and method 'via SMTP'. Distinguishes between new and reply operations. No sibling tool has overlapping purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States when to use: sending new email or replying to existing. Does not explicitly state when not to use or alternatives, but siblings are distinct operations, so context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

Each tool targets a distinct action: flagging, sending, listing mailboxes, listing messages, searching, and fetching. No overlaps or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with lowercase and underscores (e.g., list_mailboxes, send_mail). No mixing of styles.

Tool Count5/5

Six tools is well-scoped for an email server, covering essential operations without being too few or overly numerous.

Completeness4/5

Covers core email tasks (list, send, search, read, flag) but lacks operations like delete/move messages or manage mailboxes, which are minor gaps.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    B
    maintenance
    MCP server that connects Claude to iCloud Mail, enabling reading, searching, sending, and organizing emails via IMAP/SMTP.
    14
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that enables Claude Desktop to manage emails via SMTP and IMAP. Send emails, fetch unread messages, and create draft replies directly from conversations.
    45
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A cross-platform MCP server that provides Claude with email access via IMAP, supporting multiple email providers and account management.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/96b2gwbdg8-dev/imap_mail_connector'

If you have feedback or need assistance with the MCP directory API, please join our Discord server