Skip to main content
Glama
luleigreat

issue-collector

by luleigreat

send_issue_email MCP

Sends the contact email and problem description left when a user is transferred to a human agent to a fixed service mailbox via SMTP.

The Agent only sees one tool: send_issue_email(email, question).

What the three email addresses are

Role

Source

Purpose

Sender From

SENDER_EMAIL / SMTP_USERNAME in .env

The account that actually logs into SMTP and sends

Recipient To

TARGET_EMAIL in .env

The fixed service mailbox you use to receive issues

User email

Tool argument email

Written into the subject and body, and set as Reply-To so support can reply to the user directly

.env is infrastructure, deployed once. email / question differ per conversation and are passed by the Agent from conversation variables (e.g. $邮箱, $问题).

Related MCP server: MCP Sendmail Server

Environment requirements

  • Python 3.10+

  • Access to the SMTP server in use (direct connection to Gmail from this machine requires outbound 465/587)

Installation

cd send_issue_email_mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Fill in .env as described below, do not commit .env to the repository.

Configuring .env

Required: recipient and SMTP

TARGET_EMAIL=issues@example.com

SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_USERNAME=your_account@gmail.com
SMTP_PASSWORD=xxxx xxxx xxxx xxxx
SMTP_USE_SSL=true

SENDER_EMAIL=your_account@gmail.com
SENDER_NAME=问题收集机器人

Variable

Description

TARGET_EMAIL

Issue inbox, required

SMTP_HOST / SMTP_PORT

SMTP server

SMTP_USERNAME / SMTP_PASSWORD

Login credentials. Gmail must use an app-specific password, not the login password

SMTP_USE_SSL

true = SSL (465); false = STARTTLS (587)

SENDER_EMAIL

Sender, defaults to SMTP_USERNAME

SENDER_NAME

Sender display name

Two equivalent Gmail combinations:

Method

SMTP_PORT

SMTP_USE_SSL

SSL (recommended)

465

true

STARTTLS

587

false

Workspace / school Google accounts may have SMTP disabled by the admin; in that case it won't work.

MCP transport (remote client)

智齿 sends POST / to the root path of the URL you fill in, so the remote defaults are as follows:

MCP_TRANSPORT=streamable-http
MCP_HOST=0.0.0.0
MCP_PORT=8765
MCP_PATH=/

Variable

Description

MCP_TRANSPORT

streamable-http: remote (智齿); stdio: local Agent spawns the process; sse: legacy GET /sse (智齿 is currently not this type)

MCP_HOST

Listen address; use 0.0.0.0 for remote

MCP_PORT

Listen port. Local 8000 is often taken by other projects; 8765 works

MCP_PATH

HTTP endpoint path. Must be / for 智齿

After changing .env, if you have already exported variables with the same names in the terminal, load_dotenv() will not override them. Open a new terminal, or unset MCP_TRANSPORT TARGET_EMAIL before starting.

Verify sending first (without starting MCP)

source .venv/bin/activate
python test_email.py

On success it prints: 成功:问题已发送至服务邮箱 ...

The first argument in the script is the simulated user contact email, not the sender. It's recommended to change it to your own real email for testing, to avoid example.com being blocked into spam by the recipient.

SMTP success only means the post office accepted the mail. If the target is an enterprise Feishu or similar mailbox, also check the sent folder "Sent", for bounce-backs, and the recipient's spam/quarantine.

Start MCP (智齿 / remote)

source .venv/bin/activate
python server.py

The log should show something like:

transport 'streamable-http' (stateless) on http://0.0.0.0:8765/

Do not run two instances at once, otherwise you'll get address already in use. When restarting, stop the old process first, then start.

URL to fill in 智齿

Select Streamable HTTP / HTTP as the transport type (not SSE).

The URL should not include /sse or /mcp; fill in the root address that can reach this machine:

http://<这台机器的可达地址>:<MCP_PORT>/

For example, on LAN: http://192.168.x.x:8765/

If 智齿 is a cloud SaaS, it cannot reach an intranet IP. You need a public IP, domain, or tunnel; the URL is still the root path, without a suffix.

Save and reconnect. The service log should show POST / HTTP/1.1" 200, not 404.

Local self-check

curl -sS -X POST http://127.0.0.1:8765/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"check","version":"0.0.1"}}}'

A normal response returns JSON with "jsonrpc":"2.0" and "serverInfo":{"name":"issue-collector"...}.

Start MCP (local stdio)

After setting MCP_TRANSPORT=stdio in .env, local clients like Cursor launch it with a command, for example:

{
  "mcpServers": {
    "issue-collector": {
      "command": "/绝对路径/send_issue_email_mcp/.venv/bin/python",
      "args": ["/绝对路径/send_issue_email_mcp/server.py"]
    }
  }
}

In stdio mode, do not write normal logs to stdout.

Tool conventions

send_issue_email(email: str, question: str) -> str

  • email: user contact email

  • question: problem/request

  • Returns a string starting with 成功: or 错误: for the Agent to branch on

Email subject: [问题收集] 来自用户 {email} ({时间})
The body contains the user email, submission time, and problem description; Reply-To is the user email.

After send_message succeeds, the MCP result is returned immediately; SMTP QUIT/connection close happens in a background thread to avoid SSL close dragging past 智齿's timeout.

Logs

Execution logs are written to log/ under the project, one file per day; multiple starts on the same day append:

log/2026-08-19.log

Includes HTTP request start/end, tool calls, SMTP connect/login/send timing, and background close results. Does not include the SMTP password.

Troubleshooting

Symptom

Cause

Fix

智齿 "abnormal service response format"; log POST / 404

Client POSTs the root path, but the service is on /sse or the corresponding transport is not started

MCP_TRANSPORT=streamable-http, MCP_PATH=/, URL without /sse

[Errno 48] address already in use

Port already occupied by a previous MCP instance

Stop the old process before starting; don't run two at once

Log POST /sse 404

URL has extra /sse

Change to root path /

Script still sends to old TARGET_EMAIL

Old env vars already in the terminal; load_dotenv() doesn't override

unset TARGET_EMAIL or open a new terminal

SMTP succeeds but inbox is empty

Went to spam/quarantine, or wrong recipient account

Check sent folder, bounce-backs, recipient's spam

Gmail 535 / Password not accepted

Used login password or 2FA not enabled

Use an app-specific password instead

load_dotenv() runs once when server.py starts. If you only change .env without restarting the process, the running service won't read the new values.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Enables sending emails via SMTP with template management, supporting multiple SMTP configurations, template creation with variable substitution, and bulk email sending with rate limiting.
    6
    434
    19
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables sending emails via SMTP with support for HTML content, attachments, bulk sending, and template-based emails. Features session management and full MCP Streamable HTTP transport compliance.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables sending emails through SMTP using nodemailer, allowing AI assistants to send plain text and HTML emails with configurable SMTP credentials.
    107
    2
    ISC

View all related MCP servers

Related MCP Connectors

  • Send transactional email over a verified domain — templates, attachments, custom headers.

  • Fully-managed email as MCP tools - register domains, real mailboxes, send and receive mail.

  • Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.

View all MCP Connectors

Latest Blog Posts

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/luleigreat/send_issue_email_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server