IMAP Mail MCP
Allows reading and searching emails from a Proton Mail account via the Proton Bridge IMAP interface.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@IMAP Mail MCPfind unread billing emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
IMAP Mail MCP
IMAP Mail MCP is an MCP (Model Context Protocol) server that lets LLM clients read email through IMAP tools.
It is designed for:
local AI workflows (Cursor, ollmcp, other MCP hosts)
mailbox exploration/search/summarization
extension by developers who want to add mail tools
Current implementation is read-only (list/search/fetch/status/thread context/attachment metadata).
What You Get
10 MCP tools for common mail workflows
consistent sorting and cursor pagination support
guardrails for result size and snippet size
deterministic tests plus CI
TypeScript codebase that is easy to extend
Related MCP server: mcp-imap-server
Quick Start
1. Install
git clone https://github.com/FaisalFehad/imap-mail-mcp.git
cd imap-mail-mcp
cp .env.example .env
npm install
npm run build2. Configure .env
Set IMAP credentials in .env:
Variable | Required | Description | Typical Example |
| yes | IMAP host |
|
| yes | IMAP port |
|
| yes |
|
|
| yes | IMAP username |
|
| yes | IMAP password |
|
| no | validate TLS cert chain |
|
| no | max body chars in |
|
| no | global cap for list/search limits |
|
| no | max snippet chars when enabled |
|
Proton Bridge users usually run with IMAP_HOST=127.0.0.1, IMAP_PORT=1143, IMAP_SECURE=false.
3. Run
node dist/index.jsOr via package bin:
npx imap-mail-mcpCompatibility alias still works:
npx proton-bridge-mcpMCP Client Setup
Cursor
Add server config (Settings -> MCP):
{
"mcpServers": {
"imap-mail": {
"command": "node",
"args": ["/absolute/path/to/imap-mail-mcp/dist/index.js"],
"env": {
"IMAP_HOST": "127.0.0.1",
"IMAP_PORT": "1143",
"IMAP_SECURE": "false",
"IMAP_USER": "your@proton.me",
"IMAP_PASS": "your-bridge-password"
}
}
}
}ollmcp
Create
~/.config/ollmcp/mcp-servers/servers.json:
{
"mcpServers": {
"imap-mail": {
"command": "node",
"args": ["/absolute/path/to/imap-mail-mcp/dist/index.js"],
"env": {
"IMAP_HOST": "127.0.0.1",
"IMAP_PORT": "1143",
"IMAP_SECURE": "false",
"IMAP_USER": "your@proton.me",
"IMAP_PASS": "your-bridge-password"
},
"disabled": false
}
}
}Run:
ollmcp -j ~/.config/ollmcp/mcp-servers/servers.jsonIf ollmcp is not in PATH, use ~/.local/bin/ollmcp.
Tool Reference
Use mail_search_advanced as the default search entry point.
Tool | Use For | Notes |
| list mailboxes/folders | start here |
| list messages in one mailbox | supports |
| full message body by UID | returns envelope + body text |
| basic filter search | convenience wrapper |
| keyword/sender/receiver/subject/body/date/sent-date/read-state/message-id | primary search tool |
| counters for one mailbox | messages, unseen, recent, UID metadata |
| unread messages in a mailbox | same pagination/sort options as list/search |
| attachment metadata by UID | no binary download |
| free text query by selected fields | convenience wrapper |
| related messages around a UID | thread continuity for summarization/reply |
Common List/Search Options
Supported by list/search tools:
limit: requested size (clamped byMAIL_MAX_RESULTS)sort:ascordesc(defaultdesc)cursor: opaque cursor for next pageincludeSnippet: include snippet text in envelope resultsreturnPage: return{ items, nextCursor }instead of only array
Envelope result fields are stable:
{
"uid": 123,
"subject": "string",
"from": "comma-separated addresses",
"to": "comma-separated addresses",
"date": "ISO-8601 string",
"messageId": "optional string",
"snippet": "optional string"
}Example Workflows
Find unread billing mail in INBOX
mail_search_advancedwithmailbox=INBOX,keyword=bill,unseen=true,limit=20mail_get_messageon the most relevant UID
Summarize a conversation before drafting a reply
mail_get_thread_contextwith target UID andlimitfetch one or two full messages with
mail_get_messagesummarize using context
Scan a large folder in pages
mail_list_messageswithreturnPage=truepass returned
nextCursorto next call until absent
Developer Guide (Use This Codebase)
Project Layout
src/index.ts MCP server, tool schemas, handlers
src/imap.ts IMAP operations and query behavior
src/query.ts sorting/pagination/cursor/snippet helpers
src/config.ts environment parsing and defaults
tests/*.test.mjs deterministic testsAdd a New Tool
Add schema in
src/index.tstool list.Add handler branch in
src/index.tscall handler.Implement IMAP logic in
src/imap.ts.Add deterministic tests in
tests/.Update this README tool table.
Keep LLM Behavior Predictable
keep envelope field names stable
prefer additive changes (avoid breaking existing tool args)
keep default ordering deterministic
keep limits clamped
avoid expensive full-mailbox scans where possible
Testing
Run deterministic tests (no live mailbox required):
npm testRun live smoke test (requires real IMAP credentials):
node scripts/test-mcp.mjsCI runs:
npm cinpx tsc --noEmitnpm test
Troubleshooting
Error: Command failed no such user (NO)
Usually bad IMAP_USER/IMAP_PASS or temporary server lockout after failed attempts.
Check:
IMAP_USERis your IMAP login identity, not host/IPIMAP_PASSis correct for that IMAP accountfor Proton Bridge, use the Bridge-generated password
wait a few minutes after repeated failed login attempts
TLS errors (wrong version number, ssl3_get_record)
You are likely using TLS against a plain IMAP port.
Fix:
set
IMAP_SECURE=falsefor local plain IMAP endpoints (common with Bridge)verify port matches secure/non-secure mode
Self-signed cert errors
If your IMAP endpoint uses self-signed certs:
set
IMAP_TLS_REJECT_UNAUTHORIZED=false
ollmcp: command not found
Install via pip/pipx/uvx, or run with full path:
~/.local/bin/ollmcp -j ~/.config/ollmcp/mcp-servers/servers.jsonSecurity
never commit
.envor credential fileskeep IMAP credentials in MCP client env or local
.envthis implementation does not send or modify mail
License
MIT
Available Tools
10 toolsmail_get_mailbox_statusA
Get message counters for one folder (messages, unseen, recent, UID metadata).
| Name | Required | Description | Default |
|---|---|---|---|
| mailbox | Yes | Folder name, e.g. INBOX |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It transparently discloses that the tool returns specific counter types. However, it lacks details on authentication scope or whether the operation involves any side effects, though the read-only nature is implied.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that front-loads the key purpose and includes specifics. No filler or redundant information; every word adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description sufficiently covers the return values. No additional information is necessary for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already describes the mailbox parameter (100% coverage). The description adds value by specifying that it targets 'one folder' and lists the returned counters, aiding parameter understanding beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves message counters for a folder, listing specific counters (messages, unseen, recent, UID metadata). This distinguishes it from siblings that return message lists or individual messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for getting counters but provides no explicit guidance on when to use this tool over alternatives like mail_list_messages or mail_list_unread. No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_get_messageA
Fetch one full message by folder and UID (envelope + body text).
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Message UID from mail_list_messages or mail_search | |
| mailbox | Yes | Folder name |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Discloses it fetches a full message including envelope and body text, but does not mention read-only nature, auth needs, rate limits, or error behavior. Adequate but not detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, fully front-loaded, no redundant words. Every word adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, description explains return content (envelope + body text) which is helpful. Lacks details on error conditions or output format, but for a simple tool it's nearly complete. Sibling tools are many but purpose is clear.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description only mentions 'folder' and 'UID' without adding new meaning beyond schema. The mention of 'envelope + body text' hints at output but not parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states action ('Fetch'), resource ('one full message'), method ('by folder and UID'), and content ('envelope + body text'). Differentiates from sibling tools like mail_list_messages (listing only) and mail_search (searching).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage when a specific folder and UID are known, but no explicit when/not-to-use or alternatives mentioned. No guidance on prerequisites or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_get_thread_contextA
Get related messages in the same thread context using Message-ID/References/In-Reply-To. Includes snippets by default.
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Message UID to anchor thread context | |
| sort | No | Sort by UID (default: desc/newest-first) | desc |
| limit | No | Max related messages to return (default 20, capped globally) | |
| cursor | No | Opaque pagination cursor from previous thread-context response | |
| mailbox | Yes | Folder name | |
| includeSnippet | No | Include short plain-text snippet per message (default true) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description adds value by noting the default inclusion of snippets and the use of email headers. However, it omits other behavioral traits such as read-only nature, authentication needs, rate limits, or pagination behavior, which are relevant but not disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences with no redundant information. It front-loads the primary action and essential detail (headers, snippets). Every word contributes to understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 6 parameters and no output schema, requiring the description to explain return values. It does not describe the response structure (e.g., list of messages, ordering) beyond implying related messages. Pagination and limits are not addressed, leaving a gap in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description does not provide additional meaning beyond the schema for any parameter—it merely restates the overall functionality. No parameter-specific elaboration is given.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Get' and identifies the resource as 'related messages in the same thread context'. It clarifies the mechanism (Message-ID/References/In-Reply-To), which distinguishes it from sibling tools like mail_get_message or mail_list_messages that do not assemble thread context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for retrieving thread context but does not explicitly state when to use it over alternatives. No exclusion criteria or sibling comparisons are provided, leaving the agent to infer usage from the purpose alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_list_attachmentsA
List attachment metadata for one message by folder and UID (no binary download).
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Message UID from mail_list_messages or mail_search | |
| mailbox | Yes | Folder name |
TDQS
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 the non-download nature, but lacks details on permissions, pagination, or list size limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence conveys all essential information without waste, earning its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description could specify what metadata fields are returned (e.g., filename, size). It is adequate but not fully complete for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers 100% of parameters with descriptions. The description adds context by stating the message is identified by folder and UID, reinforcing the schema's hints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists attachment metadata for one message by folder and UID, and explicitly clarifies that it does not download binaries. This distinguishes it from other mail tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description indicates use case (list metadata for a specific message) and inputs, but does not explicitly contrast with siblings like mail_get_message or provide when-not-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_list_foldersA
List all mail folders (mailboxes). Use this to see INBOX, Sent, etc.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description describes a read operation without side effects, but does not discuss rate limits, error conditions, or behavior for edge cases (e.g., empty mailbox).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no superfluous words. Purpose is front-loaded and immediately actionable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema; description does not specify return format (e.g., list of strings or objects). For a simple listing, it is adequate but could clarify structure for complex clients.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist (schema_empty, 100% coverage). Description adds value by giving examples of folder types (INBOX, Sent), which is more than the schema alone provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'List' and resource 'mail folders' with examples (INBOX, Sent), distinguishing it from sibling tools that list messages or search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when wanting to see folder names but lacks explicit guidance on when not to use or how it differs from siblings like mail_list_messages or mail_query_by_folder.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_list_messagesA
List recent messages in a folder (envelope only by default). Supports sort/cursor/snippet options.
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort by UID (default: desc/newest-first) | desc |
| limit | No | Max number of messages to return (default 50, capped globally) | |
| cursor | No | Opaque pagination cursor from previous response | |
| mailbox | Yes | Folder name, e.g. INBOX or Sent | |
| returnPage | No | Return {items,nextCursor} instead of raw array | |
| includeSnippet | No | Include short plain-text snippet per message |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that results are envelope-only by default and supports sort/cursor/snippet, but lacks details on authentication, rate limits, or what 'envelope' information includes. Adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, perfectly front-loaded with the primary action ('List recent messages in a folder'), followed by key options. Every word earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 6 parameters, one required, and no output schema, the description is adequate but misses important details like pagination behavior (cursor usage), the definition of 'envelope', and snippet format. It covers the basics but leaves gaps for new users.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% coverage, so baseline is 3. The description adds no additional meaning beyond what each parameter's schema description already provides (e.g., default values, enum). The phrase 'envelope only by default' is not directly tied to any parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List recent messages in a folder' with a specific verb and resource, and distinguishes itself from siblings like `mail_get_message` by defaulting to envelope-only. It mentions supported features (sort/cursor/snippet), making its purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives such as `mail_search` or `mail_list_unread`. There is no explicit context about prerequisites or scenarios where this tool is preferred.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_list_unreadA
List unread messages in a folder (envelope only by default). Supports sort/cursor/snippet options.
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort by UID (default: desc/newest-first) | desc |
| limit | No | Max number of unread messages to return (default 50, capped globally) | |
| cursor | No | Opaque pagination cursor from previous response | |
| mailbox | Yes | Folder name, e.g. INBOX | |
| returnPage | No | Return {items,nextCursor} instead of raw array | |
| includeSnippet | No | Include short plain-text snippet per message |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing behavioral traits. It explains that only envelope fields are returned by default and that sort, cursor, and snippet options are available. However, it does not mention that the operation is read-only or any potential side effects, though the name implies read.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of two concise sentences that immediately convey the primary function and key options. No extraneous information is included.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of six parameters, a required mailbox, and no output schema, the description should provide more context about the response structure and pagination behavior. It mentions cursor support but does not explain the envelope fields or the difference between returnPage options, leaving some gaps for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, so the parameter details are already well-documented. The description adds no further meaning beyond restating the availability of sort/cursor/snippet options, earning a baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'List unread messages' and specifies the resource 'in a folder', making the purpose specific. It also hints at differentiation from sibling 'mail_list_messages' by focusing only on unread messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit guidance on when to use this tool versus alternatives like mail_search or mail_list_messages. It only mentions the envelope-only default and available options, but lacks contextual cues for choosing among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_query_by_folderB
Convenience free-text query in one folder. Prefer mail_search_advanced for canonical searches.
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort by UID (default: desc/newest-first) | desc |
| limit | No | Max results (default 50, capped globally) | |
| query | Yes | Free-text query to match | |
| cursor | No | Opaque pagination cursor from previous response | |
| fields | No | Fields to search. Defaults to subject, body, from, to. | |
| mailbox | Yes | Folder name, e.g. INBOX | |
| returnPage | No | Return {items,nextCursor} instead of raw array | |
| includeSnippet | No | Include short plain-text snippet per message |
TDQS
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 fails to mention whether the tool is read-only, has side effects, requires authentication, or has rate limits. This lack of transparency could lead to misuse.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of two short, focused sentences. The first defines the tool's purpose, and the second provides guidance. No unnecessary words or information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 8 parameters and no output schema. The description is very brief and does not cover return values, pagination (cursor, returnPage), or snippet inclusion. However, the schema provides full parameter details, so the description is adequate for basic understanding but not complete for complex use cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema covers all parameters with descriptions, so the baseline is 3. The description adds minimal value beyond the schema, just noting it is a free-text query. It does not explain parameter interactions or nuances.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it is a convenience free-text query within one folder. It distinguishes itself from mail_search_advanced by noting the latter is preferred for canonical searches, though it could better differentiate from other sibling tools like mail_search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description tells the agent to prefer mail_search_advanced for canonical searches, providing some guidance on when to use this tool versus alternatives. However, it does not specify what constitutes a 'canonical' search or when not to use this tool, leaving room for interpretation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_searchA
Convenience folder search by basic fields. Prefer mail_search_advanced for richer filters and agent reliability.
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Recipient contains | |
| body | No | Body contains | |
| from | No | Sender contains | |
| sort | No | Sort by UID (default: desc/newest-first) | desc |
| limit | No | Max results (default 50, capped globally) | |
| since | No | Date since (ISO) | |
| before | No | Date before (ISO) | |
| cursor | No | Opaque pagination cursor from previous response | |
| unseen | No | Only unread | |
| mailbox | Yes | Folder to search (e.g. INBOX) | |
| subject | No | Subject contains | |
| returnPage | No | Return {items,nextCursor} instead of raw array | |
| includeSnippet | No | Include short plain-text snippet per message |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. The description calls it a 'search,' implying read-only, but does not confirm safety, disclose side effects, or explain response behavior beyond parameter schema hints (e.g., returnPage changes output format).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: first states purpose, second gives usage guidance. No fluff, front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite 13 parameters and no output schema, the description is very brief. It does not explain return format, pagination, or what 'basic fields' encompasses. Agent needs more context to use effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers all 13 parameters with descriptions (100% coverage). The description adds no extra meaning beyond the name 'basic fields,' so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it is a 'convenience folder search by basic fields,' which specifies verb, resource, and scope. It distinguishes from sibling 'mail_search_advanced' by noting the latter offers richer filters and reliability.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises to 'prefer mail_search_advanced for richer filters and agent reliability,' providing clear when-not-to-use guidance and directing to an alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mail_search_advancedC
Primary advanced search tool: keyword, sender/receiver, subject/body, date/date-range, sent-date-range, read state, message-id.
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | CC contains | |
| bcc | No | BCC contains | |
| body | No | Body contains | |
| date | No | Received on date (ISO, e.g. 2026-02-21) | |
| seen | No | Only read messages | |
| sort | No | Sort by UID (default: desc/newest-first) | desc |
| limit | No | Max results (default 50, capped globally) | |
| cursor | No | Opaque pagination cursor from previous response | |
| dateTo | No | Received until date/time (ISO). Date-only is inclusive. | |
| sender | No | Sender contains (alias for from) | |
| unseen | No | Only unread messages | |
| keyword | No | Match any text in headers and body | |
| mailbox | Yes | Folder to search (e.g. INBOX) | |
| subject | No | Subject contains | |
| dateFrom | No | Received since date/time (ISO) | |
| receiver | No | Receiver contains (alias for to) | |
| sentDate | No | Sent on date (ISO) | |
| messageId | No | Message-ID header contains | |
| returnPage | No | Return {items,nextCursor} instead of raw array | |
| sentDateTo | No | Sent until date/time (ISO). Date-only is inclusive. | |
| sentDateFrom | No | Sent since date/time (ISO) | |
| includeSnippet | No | Include short plain-text snippet per message |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, and the description does not disclose behavioral traits such as read-only nature, authentication requirements, rate limits, or side effects. The cursor parameter implies pagination, but this is not mentioned in the description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that immediately states the tool's primary role and key capabilities. Every word earns its place, making it highly concise and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 22 parameters, no output schema, and no annotations, the description is insufficient. It omits details on return format, pagination behavior, and usage context, which are critical for an agent to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds high-level grouping of parameters (keyword, sender/receiver, etc.) but does not add significant meaning beyond the schema's own parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it is an 'advanced search tool' and lists the searchable fields (keyword, sender/receiver, etc.), which conveys the purpose and distinguishes it from sibling tools like mail_list_messages or mail_search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. The term 'primary' suggests it is the default for advanced searches, but no conditions, exclusions, or alternative tool names are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
10 tool updates
v1.0.0- First observed
mail_get_mailbox_status - First observed
mail_get_message - First observed
mail_get_thread_context - First observed
mail_list_attachments - First observed
mail_list_folders - First observed
mail_list_messages - First observed
mail_list_unread - First observed
mail_query_by_folder - First observed
mail_search - First observed
mail_search_advanced
TDQS
Most tools have distinct purposes, but the three search tools (mail_query_by_folder, mail_search, mail_search_advanced) have overlapping functionality, which could lead to confusion despite the descriptions advising preference for mail_search_advanced.
The naming pattern is mostly 'mail_verb_noun' but uses inconsistent verbs (get vs list vs query) and mixes conventions between retrieval actions, creating slight inconsistency.
With 10 tools, the set is well-scoped for an IMAP-focused server, covering the essential operations for reading and searching emails without being excessive.
The server covers reading, searching, and thread context well, but notable gaps exist for common IMAP actions like marking messages as read/unread, deleting, or moving messages.
Maintenance
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
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
AI email inbox and sending tools with attachments, search, live events, and webhooks.
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Stateful email for AI agents — read inboxes, reply in-thread, draft with approval.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables users to connect to their email inbox via IMAP to search, filter, and summarize emails based on criteria like subject, date, and sender. Supports marking emails as read and provides customizable email summarization with various prompt options.273ISC
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to read, search, and manage emails via IMAP with secure, read-only access to email accounts.6-
- FlicenseAqualityCmaintenanceEnables AI assistants to read recent emails and fetch full email content from an IMAP inbox, allowing natural language queries about email summaries.3-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/FaisalFehad/imap-mail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server