connect
Establish a secure IMAP connection to your mail server for reading, searching, and organizing email messages through the IMAP MCP Server.
Instructions
Establish IMAP connection to mail server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | IMAP server hostname | |
| port | No | IMAP port (default: 993) | |
| secure | No | Use SSL/TLS (default: true) |
Implementation Reference
- src/imap_mcp/imap_client.py:51-54 (handler)The `connect` method in `ImapClientWrapper` establishes the IMAP connection using `imapclient.IMAPClient`.
def connect(self, host: str, port: int = 993, secure: bool = True) -> bool: """Establish IMAP connection.""" self.client = IMAPClient(host, port=port, ssl=secure) return True - src/imap_mcp/server.py:475-480 (registration)The `connect` tool is registered and handled in `server.py` within `handle_tool_call` by calling `imap_client.connect`.
if name == "connect": return imap_client.connect( host=args["host"], port=args.get("port", 993), secure=args.get("secure", True), )