MCP SMTP Server MCP Server

SMTP integration for sending HTML emails and specialized intent detection prompts.

README.md

🚀 MCP Server - Model Context Protocol

MCP Server es una implementación robusta y eficiente de un servidor compatible con el Model Context Protocol (MCP). Diseñado para extender las capacidades de los Modelos de Lenguaje (LLMs), este servidor proporciona herramientas para el envío de correos electrónicos y prompts inteligentes para la detección de intenciones y gestión de datos de clientes.


✨ Características Principales

  • 📧 Integración SMTP Completa: Envío de correos electrónicos enriquecidos (HTML) a través de Gmail u otros proveedores SMTP.
  • 🧠 Prompts Inteligentes:
    • Detección de Intención: Clasifica mensajes de usuarios automáticamente.
    • Extracción de Información: Identifica datos clave como nombres y correos.
    • Generación de Contenido: Crea emails de bienvenida personalizados dinámicamente.
  • 🔒 Seguridad Primero: Gestión de credenciales mediante variables de entorno y validación de tokens.
  • ⚡ Alto Rendimiento: Construido sobre FastAPI y FastMCP para una latencia mínima.

🛠️ Requisitos Previos

Antes de comenzar, asegúrate de tener instalado:

  • Python 3.13 o superior.
  • uv: Un gestor de paquetes de Python extremadamente rápido.

📦 Instalación

  1. Clonar el repositorio:

    git clone https://github.com/TUSUARIO/mcp-server.git
    cd mcp-server
    
  2. Instalar dependencias:

    Utilizando uv para sincronizar el entorno virtual:

    uv sync
    

⚙️ Configuración

  1. Crea un archivo .env en la raíz del proyecto basándote en el siguiente ejemplo:

    # .env
    EMAIL_USER=tu_correo@gmail.com
    EMAIL_PASS=tu_contraseña_de_aplicacion
    

    Nota: Para Gmail, debes usar una "Contraseña de Aplicación" si tienes la verificación en dos pasos activada.


🚀 Uso

Para iniciar el servidor en modo desarrollo:

uv run main.py

El servidor estará disponible en: http://0.0.0.0:8000

Endpoints Disponibles

Tipo Nombre Descripción
Tool send_email Envía correos HTML vía SMTP.
Prompt detect_action Clasifica la intención del usuario (saludo/info).
Prompt client_info Extrae nombre y email de un texto.
Prompt welcome_email Genera el cuerpo de un email de bienvenida.

📂 Estructura del Proyecto

mcp-server/
├── main.py              # Punto de entrada y lógica del servidor
├── pyproject.toml       # Definición de dependencias
├── .gitignore           # Archivos ignorados por git
├── .env                 # Variables de entorno (NO COMMITEAR)
└── README.md            # Documentación del proyecto

🤝 Contribución

¡Las contribuciones son bienvenidas! Por favor, abre un issue o envía un pull request para mejoras o correcciones.

  1. Haz un Fork del proyecto.
  2. Crea tu rama de funcionalidad (git checkout -b feature/AmazingFeature).
  3. Haz Commit de tus cambios (git commit -m 'Add some AmazingFeature').
  4. Push a la rama (git push origin feature/AmazingFeature).
  5. Abre un Pull Request.

👤 Autor

MKevyn


Desarrollado con ❤️ y Python

Tools 1

send_emailSends HTML emails via SMTP.

Environment Variables

EMAIL_USERrequiredThe email address used for SMTP authentication.
EMAIL_PASSrequiredThe password or app-specific password for the email account.

Try it

Analyze this user message and classify if it is a greeting or a request for information.
Extract the name and email address from the following customer inquiry text.
Draft a personalized welcome email for a new client named John Doe.
Send a welcome email to john.doe@example.com using the generated template.

Frequently Asked Questions

What are the key features of MCP SMTP Server?

Full SMTP integration for sending enriched HTML emails. Automated user message intent classification. Key information extraction from unstructured text. Dynamic generation of personalized welcome emails. Built on FastAPI and FastMCP for high performance.

What can I use MCP SMTP Server for?

Automating customer onboarding by sending personalized welcome emails. Classifying incoming support tickets to route them to the correct department. Extracting lead contact information from unstructured email inquiries. Building automated email notification workflows for LLM-based applications.

How do I install MCP SMTP Server?

Install MCP SMTP Server by running: git clone https://github.com/TUSUARIO/mcp-server.git && cd mcp-server && uv sync

What MCP clients work with MCP SMTP Server?

MCP SMTP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP SMTP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare