Repository navigation
Releases
v0.2.0
save_draft can now quote the original email below a reply. The server copies the original text itself, so the AI never rewrites it.
Added
save_draftcan quote the original email below a reply:quote: "full"(the defaultnonekeeps the 0.1 behaviour). The server copies the original text with>on each line under a Gmail-style Japanese header line (2026年11月19日(木) 10:51 Name <address>:), so the AI never rewrites it.max_quote_charslimits the quote (default 20000, at mostpolicy.body_max_chars); a cut quote ends with(以下省略). The response gainsquoted,quoteandquote_truncated; the audit log records only the method and the number of quoted characters.
Upgrading
No configuration changes. On the server: git pull and composer install --no-dev --optimize-autoloader. The files in public/ are unchanged. Existing connectors keep working; a new conversation in Claude picks up the new quote argument.
Full changelog: v0.1.0...v0.2.0
v0.1.0
First public release of php-imap-mcp: a remote MCP server in plain PHP that lets Claude read, search and draft email over IMAP, on shared hosting with no daemon.
Read the Security section of the README before connecting a mailbox. The server cannot send or delete mail, and a dedicated mailbox for the AI is recommended.
Added
- Remote MCP server in plain PHP for shared hosting: no daemon, one IMAP connection per request, no session state. MCP protocol version 2026-07-28, with 2025-11-25 clients supported.
- Tools:
list_folders,search_emails,get_email(read-only) andsave_draft(saves to the Drafts folder; replies getIn-Reply-ToandReferences). There is no way to send or delete mail. - Japanese mail support: ISO-2022-JP, Shift_JIS (CP932 extensions), HTML-only messages converted to text, Japanese folder names (modified UTF-7). Only the text parts are fetched; attachments are listed by name, type and size.
- Sign-in with the mail account (OAuth 2.1 with PKCE, pre-registered clients): the server checks the address and password with a real IMAP login and seals them into the tokens it issues. No mail password is stored on the server.
- OAuth discovery: Protected Resource Metadata (RFC 9728), Authorization Server Metadata (RFC 8414), resource indicators (RFC 8707).
- Defences: IP allow-list (Anthropic's outbound ranges by default), Origin check, lockout after repeated failed logins or client authentication, audit log without passwords, tokens or message bodies, email content wrapped as untrusted data.
bin/check-config.php,bin/generate-key.php,bin/generate-client-secret.php,bin/revoke-grant.php.- Tested with Courier-IMAP and Dovecot, on PHP 8.1 to 8.4.
Installation
See Installation in the README (日本語).