- Home
- MCP servers
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"rickyqzh-email_mcp": {
"command": "python",
"args": [
"email_mcp_server.py"
],
"env": {
"EMAIL_ACCOUNT": "your_email@163.com",
"EMAIL_PASSWORD": "your_password",
"EMAIL_IMAP_SERVER": "imap.163.com",
"EMAIL_SMTP_SERVER": "smtp.163.com"
}
}
}
}You can run this Gradio-based MCP server to access and manage163邮箱 email directly from your LLM workflows. It supports fetching unread emails, checking and saving emails and attachments, and sending plain text, HTML, or attachment-laden messages. This makes it easy to automate email tasks or build email-aware assistants.
How to use
Once the MCP server is running, you connect to it with an MCP client and call the available tools to interact with your 163邮箱 account. You can retrieve new messages, inspect specific types of emails, save attachments, and compose emails with plain text, HTML, or attachments. Use the environment variables to configure your mailbox details, then invoke the tools by name with any overridden connection settings you provide.
Primary tools you can use include get_newest_email, check_emails, save_attachment, send_text_email, send_html_email, and send_email_with_attachment. You can override connection parameters for any tool (imap_server, account, password for reads; smtp_server, account, password for sends) as needed for different mailboxes. The server exposes a Gradio-based MCP API at the dedicated endpoint for interoperation with your MCP client.
How to install
Prerequisites: Python 3.8+ and pip are required on your system.
Install dependencies via the requirements file or manual packages.
Option A — install via requirements.txt:
pip install -r requirements.txt
Option B — manual installation:
pip install gradio[mcp] bs4 python-dotenv
Start the MCP server directly with Python.
python email_mcp_server.py
If you want to configure mailbox credentials via environment variables, prepare them in advance and then start the server. You can set variables in your shell or use a starter script as shown here.
chmod +x start_with_env.sh
./start_with_env.sh
Additional notes
Environment variables you can configure to point the MCP server at your 163邮箱 account include: EMAIL_IMAP_SERVER, EMAIL_SMTP_SERVER, EMAIL_ACCOUNT, and EMAIL_PASSWORD. These variables let you connect securely to both IMAP (to fetch/read emails) and SMTP (to send emails).
To run with explicit values without a script, export the variables in your shell and start the server with Python as shown above.
Access the MCP interface via the Gradio endpoint after the server starts at the URL exposed by Gradio, typically http://localhost:7860/gradio\_api/mcp/sse for server-sent events based client connections.
Connection URL
MCP client connections for this server are exposed through the standard Gradio interface under the /gradio_api/mcp path. You can connect your client to the server using the SSE endpoint to receive updates and call the MCP tools.
Available tools
get_newest_email
Fetches the latest unread email from your mailbox. Can optionally override the IMAP server, account, and password.
check_emails
Checks and retrieves emails based on type and quantity you specify. Supports overriding IMAP settings.
save_attachment
Saves a specified attachment from an email to your local storage. Supports overriding IMAP settings.
send_text_email
Sends a plain text email. You can override SMTP server, account, and password for authentication.
send_html_email
Sends an email using HTML content. You can override SMTP server, account, and password for authentication.
send_email_with_attachment
Sends an email with one or more attachments. You can override SMTP server, account, and password for authentication.