FudanMailBox MCP
Click on "Deploy 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., "@FudanMailBox MCP check my unread emails in the inbox"
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.
FudanMailBox MCP
A small, privacy-conscious MCP server for Fudan Cloud Mail (@m.fudan.edu.cn) and compatible Tencent Enterprise Mail accounts.
It uses standard IMAP over SSL for mailbox operations and SMTP over SSL for sending. Credentials are read from operating-system environment variables and are never stored in this repository.
Community project. Not an official Fudan University or Tencent project.
Features
Mailbox
List folders and special-use folders (Inbox, Drafts, Sent, Trash, Junk when advertised)
Folder total/unread counts
List newest mail without marking it read
Search by text, sender, recipient, subject, date range, unread/starred
Read plain-text content, optional HTML, headers, attachment inventory
Download attachments
Mark read/unread and starred/unstarred
Move, archive, trash, or permanently delete messages
Create, rename, and delete folders
Drafts
Save server-side drafts through IMAP
Replace/update an existing draft
Drafts support To/Cc/Bcc, plain text, optional HTML, and attachments
Sending
Send To/Cc/Bcc mail
Plain-text and optional HTML body
File attachments
Reply / reply-all
Forward, optionally including original attachments
Configurable approved sender aliases
dry_run=trueby default for send/reply/forward so an agent can show a preview firstOptional copy to the server Sent folder
Contacts
The public v0.1 implementation deliberately does not reverse-engineer Tencent Webmail contacts.
Instead it provides a local private contact book, stored outside this Git repository:
list/search contacts
add/update/delete contacts
import recent correspondents from message headers
Native Tencent/Fudan contact and calendar sync is intentionally left for a future Exchange-compatible module.
Related MCP server: qqconnect
Not implemented in v0.1
These are not standard IMAP/SMTP features:
Native Tencent/Fudan webmail contact synchronization
Exchange calendar synchronization / meeting invitations
Webmail-only mail recall
Delivery-status query
2 GB webmail large-attachment transfer
Webmail notes, to-do, microdisk/docs/file-transfer features
Requirements
Python 3.11+
Fudan Cloud Mail account
Client protocol enabled in webmail settings
Client-specific password if secure login is enabled
Default servers:
IMAP:
imap.exmail.qq.com:993with SSLSMTP:
smtp.exmail.qq.com:465with SSL
Installation
git clone https://github.com/BuddyKang/FudanMailBox_MCP.git
cd FudanMailBox_MCP
py -3.11 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"Run directly:
.\.venv\Scripts\python.exe -m fudanmailbox_mcpWindows credential setup
Do not paste the client-specific password into config.json, README.md, .env, source code, Git, or an issue.
Set Windows user environment variables:
[Environment]::SetEnvironmentVariable(
"FUDAN_MAIL_USER",
"YOUR_STUDENT_ID@m.fudan.edu.cn",
"User"
)
[Environment]::SetEnvironmentVariable(
"FUDAN_MAIL_APP_PASSWORD",
"YOUR_CLIENT_SPECIFIC_PASSWORD",
"User"
)Optional approved From aliases:
[Environment]::SetEnvironmentVariable(
"FUDAN_MAIL_FROM_ALIASES",
"alias1@m.fudan.edu.cn,alias2@m.fudan.edu.cn",
"User"
)After changing environment variables, fully restart DSH / Super-MCP so the child MCP process inherits them.
Windows GUI path:
Search "Edit environment variables for your account" -> Environment Variables -> User variables
Create:
FUDAN_MAIL_USERFUDAN_MAIL_APP_PASSWORD
Super-MCP example
{
"mcpServers": {
"fudanmailbox": {
"command": "C:\\path\\to\\FudanMailBox_MCP\\.venv\\Scripts\\python.exe",
"args": ["-m", "fudanmailbox_mcp"]
}
}
}No credentials are written into this config. The process inherits Windows user environment variables.
Recommended agent policy
Read-only operations can usually be allowed.
Treat these as consequential:
send_message/reply_message/forward_message: preview first, then senddelete_message(permanent=true): require explicit confirmationdelete_folder: require explicit confirmationupdate_draft: require confirmation before replacing the old draftdelete_contact: require explicit confirmation
The server also has conservative defaults such as dry_run=true for outbound mail and confirmation gates for destructive actions.
Main MCP tools
capabilitiesaccount_statustest_connectionlist_foldersfolder_statuslist_messagessearch_messagesget_messagedownload_attachmentset_message_flagsmove_messagearchive_messagedelete_messagecreate_folderrename_folderdelete_foldersave_draftupdate_draftsend_messagereply_messageforward_messagelist_sender_aliaseslist_contactssearch_contactsupsert_contactdelete_contactimport_correspondents
Environment variables
Variable | Default | Purpose |
| required | Full mailbox address |
| required | Client-specific password |
|
| IMAP host |
|
| IMAP SSL port |
|
| SMTP host |
|
| SMTP SSL port |
| empty | Comma-separated approved From aliases |
|
| Append a copy to Sent after SMTP delivery |
|
| Attachment cap enforced by MCP |
|
| Local contact store |
|
| Attachment download folder |
| unset | Explicit archive folder if server advertises none |
Security
See SECURITY.md. Never commit credentials, exported session cookies, saved webmail HTML containing live session identifiers, private contact databases, or downloaded mail/attachments.
License
MIT
Available Tools
27 toolsaccount_statusB
Return non-secret configuration readiness. Never returns a password/token.
Inputs: no named parameters. Returns: object
archive_messageB
Move a message to the configured or server-advertised archive folder.
Inputs: uid (required), folder. Returns: object
capabilitiesA
Describe supported features and known server/webmail-only limitations.
Inputs: no named parameters. Returns: object
create_folderC
Create an IMAP folder.
Inputs: name (required). Returns: object
delete_contactA
Delete a local contact. Requires confirm=true.
Inputs: contact_id (required), confirm. Returns: object
delete_folderA
Delete an IMAP folder. Requires confirm=true.
Inputs: name (required), confirm. Returns: object
delete_messageA
Move to Trash by default. Permanent deletion requires permanent=true and confirm=true.
Inputs: uid (required), folder, confirm, permanent. Returns: object
download_attachmentC
Download one attachment by index to a local directory.
Inputs: uid (required), attachment_index (required), folder, output_dir. Returns: object
folder_statusC
Get total and unread counts for one folder.
Inputs: folder. Returns: object
forward_messageC
Forward an existing message. Defaults to dry_run=true.
Inputs: to (required), uid (required), folder, dry_run, +2 more. Returns: object
get_messageB
Read one message, returning headers/body/attachments without marking it read.
Inputs: uid (required), folder, max_chars, include_html. Returns: object
import_correspondentsC
Import recent sender addresses, and optionally recipients, into local contacts.
Inputs: limit, folder, include_recipients. Returns: object
list_contactsA
List the MCP local private contact book (not Tencent server-side contacts).
Inputs: no named parameters. Returns: result
list_foldersA
List IMAP folders and special-use roles such as Drafts, Sent, Trash, Junk.
Inputs: no named parameters. Returns: result
list_messagesB
List newest messages in a folder without marking them read.
Inputs: limit, folder, unread_only, starred_only. Returns: result
list_sender_aliasesB
List sender addresses explicitly allowed by environment configuration.
Inputs: no named parameters. Returns: object
move_messageC
Move a message between folders.
Inputs: uid (required), target_folder (required), folder. Returns: object
rename_folderC
Rename an IMAP folder.
Inputs: new_name (required), old_name (required). Returns: object
reply_messageC
Reply/reply-all to an existing message. Defaults to dry_run=true.
Inputs: uid (required), body (required), folder, dry_run, +2 more. Returns: object
save_draftC
Save a server-side draft without sending it.
Inputs: to (required), body (required), subject (required), cc, +4 more. Returns: object
search_contactsC
Search the MCP local private contact book.
Inputs: query (required). Returns: result
search_messagesC
Search one folder. since/before use ISO dates such as 2026-10-01.
Inputs: text, limit, since, before, +6 more. Returns: result
send_messageB
Compose/send mail. Defaults to dry_run=true; send only after user approves preview.
Inputs: to (required), body (required), subject (required), cc, +5 more. Returns: object
set_message_flagsC
Set read/unread and/or starred/unstarred flags.
Inputs: uid (required), read, folder, starred. Returns: object
test_connectionA
Test authenticated IMAP and SMTP connectivity without reading or sending mail.
Inputs: no named parameters. Returns: object
update_draftB
Replace an existing draft. Requires confirm_replace=true.
Inputs: to (required), uid (required), body (required), folder (required), +7 more. Returns: object
upsert_contactC
Add or update a local contact by email address.
Inputs: email (required), name, tags, notes, +2 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools clearly target distinct resources and actions: folders, messages, drafts, contacts, sending, and account diagnostics. Minor ambiguity exists between save_draft and update_draft (create vs. replace draft), and account_status vs. capabilities/test_connection are all informational though with different scopes.
The set uses consistent snake_case with verb_noun patterns for most tools. A few noun-only names (capabilities, account_status, folder_status) break the pattern, but overall naming remains predictable and readable.
27 tools exceeds the 25-tool threshold considered too many, creating a heavy selection surface for an agent. While the mailbox domain is broad, some account diagnostic tools could be consolidated to reduce cognitive load.
The surface covers folder CRUD, message list/search/read/flags/move/archive/delete, attachment download, draft save/update, send/reply/forward, contact CRUD/import, and account diagnostics. This provides near-complete lifecycle coverage for a webmail client with only very minor gaps.
Related MCP Connectors
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Search connected email, read and manage messages, draft and send, and manage rules for new mail.
Gmail, Outlook, iCloud, Fastmail and any IMAP mailbox for your agent. Scoped OAuth, approved sends.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI agents to securely interact with Gmail and QQ Mail, including IMAP search/read/organization, attachments, and preview-confirmed sending.412MIT
- AlicenseAqualityBmaintenanceEnables Grok Bot or Grok Build to connect to Chinese email accounts such as QQ, 163, 126, and Tencent exmail over IMAP, allowing email search, reading, draft management, and approved sending through natural language.151MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible agents to access QQ Mail and any IMAP/SMTP mailbox, providing tools to list, search, read, send, reply to, flag, move, delete, and download email over standard IMAP/SMTP using a provider authorization code.51 npmMIT
- AlicenseAqualityCmaintenanceEnables agents to read, search, organize, draft, and optionally send email from a cPanel mail account over IMAP and SMTP, with configurable safeguards for sending and permanent deletion.16MIT