FGJ Multimedios MCP Server
Enables automated sending of institutional emails via Gmail SMTP with authentication and automatic signature from FGJ Multimedios' General Manager.
README
FGJ Multimedios MCP Server
Servidor MCP para envío automático de correos institucionales de FGJ Multimedios.
Características
- ✅ Envío de correos institucionales vía SMTP (Gmail)
- ✅ Contexto personalizado para respuestas de IA
- ✅ Integración con FastMCP Cloud y desarrollo local
- ✅ Firma automática de Bélgica Jiménez (Gerente General)
🔑 Autenticación - IMPORTANTE
FastMCP Cloud y desarrollo local manejan la autenticación de manera diferente:
FastMCP Cloud (Producción)
- ❌ NO uses
auth=verifieren el servidor - ❌ NO envíes headers
Authorization: Bearerdesde el cliente - ✅ FastMCP Cloud maneja la autenticación automáticamente
- ✅ Usa
app.pycomo punto de entrada (sin autenticación)
Desarrollo Local
- ✅ Usa
auth=verifieren el servidor (server.py) - ✅ Envía
Authorization: Bearer {token}desde el cliente - ✅ Configura
MCP_TOKENen.env
Despliegue en FastMCP Cloud
Paso 1: Preparar el Repositorio
- Asegúrate de que tu código esté en un repositorio de GitHub
- Verifica que tengas estos archivos:
- ✅
app.py- Punto de entrada para FastMCP Cloud (SIN autenticación) - ✅
requirements.txt- Dependencias completas - ✅
server.py- Servidor local con autenticación (para desarrollo)
- ✅
Paso 2: Crear Proyecto en FastMCP Cloud
- Ve a FastMCP Cloud e inicia sesión con tu cuenta de GitHub
- Haz clic en "New Project" o "Crear Proyecto"
- Selecciona tu repositorio de GitHub
- Configura el proyecto:
- Nombre del proyecto:
fgj-multimedios-mcp(o el que prefieras) - Punto de entrada:
app.py⚠️ IMPORTANTE: Usar app.py, NO server.py - Rama:
maino tu rama de desarrollo
- Nombre del proyecto:
Paso 3: Configurar Variables de Entorno
En la configuración del proyecto, añade SOLO estas variables:
EMAIL_USER=tu-correo@gmail.com
EMAIL_PASS=tu-app-password-de-gmail
⚠️ IMPORTANTE:
EMAIL_PASSdebe ser una Contraseña de Aplicación de Gmail (no tu contraseña normal)- ❌ NO agregues
MCP_TOKENen FastMCP Cloud - no es necesario - ✅ FastMCP Cloud maneja la autenticación automáticamente
Paso 4: Desplegar
- Haz clic en "Deploy" o "Desplegar"
- FastMCP Cloud construirá y desplegará tu servidor
- Una vez completado, recibirás una URL como:
https://tu-proyecto.fastmcp.app/api/mcp
Paso 5: Actualizar Cliente
Actualiza tu client.py para usar la URL de FastMCP Cloud:
client = MultiServerMCPClient(
{
"fgj-server": {
"transport": "streamable_http",
"url": "https://tu-proyecto.fastmcp.app/api/mcp", # ← Cambia esto
"headers": {
"Authorization": f"Bearer {os.getenv('MCP_TOKEN')}"
}
}
}
)
Variables de Entorno Requeridas
| Variable | Descripción | Ejemplo |
|---|---|---|
EMAIL_USER |
Correo de Gmail para envío | menymedia@gmail.com |
EMAIL_PASS |
Contraseña de aplicación Gmail | icph zmog qhlc nocx |
MCP_TOKEN |
Token secreto para autenticación | my-secret-token |
Uso Local
# Instalar dependencias
pip install -r requirements.txt
# Configurar variables de entorno
cp .env.example .env
# Edita .env con tus credenciales
# Ejecutar servidor
python server.py
El servidor estará disponible en http://localhost:8000/api/mcp
Herramientas Disponibles
send_email: Envía correos institucionalesemail_context: Prompt con contexto de FGJ Multimedios
Solución de Problemas
Error de Autenticación en FastMCP Cloud
Si recibes errores 401 Unauthorized o problemas de autenticación:
-
Verifica que usas
app.pycomo punto de entrada en FastMCP Cloudapp.pyNO tiene autenticación (correcto para FastMCP Cloud)server.pytiene autenticación (solo para desarrollo local)
-
Verifica las variables de entorno en FastMCP Cloud:
EMAIL_USER=tu-correo@gmail.com EMAIL_PASS=app-password-de-gmail❌ NO agregues
MCP_TOKENen FastMCP Cloud -
Ejecuta el test de conexión:
python test_fastmcp.py -
Revisa los logs en FastMCP Cloud Dashboard
- Busca errores de SMTP o autenticación
- Verifica que el servidor esté "running"
Error de Autenticación en Local
Si tienes problemas en desarrollo local:
-
Verifica tu archivo
.env:EMAIL_USER=tu-correo@gmail.com EMAIL_PASS=app-password-de-gmail MCP_TOKEN=tu-token-secreto -
Inicia el servidor con autenticación:
python server.py -
Verifica que el cliente use localhost:
export MCP_URL=http://localhost:8000/api python client.py
Archivos del Proyecto
app.py→ Para FastMCP Cloud (sin autenticación)server.py→ Para desarrollo local (con autenticación)server_cloud.py→ DEPRECADO (usarapp.py)client.py→ Cliente que detecta automáticamente el modotest_fastmcp.py→ Prueba de conexión
Notas
- Cada push a la rama
mainredeployará automáticamente el servidor - Los logs están disponibles en el dashboard de FastMCP Cloud
- El servidor se reinicia automáticamente si hay errores
- El cliente detecta automáticamente si conecta a FastMCP Cloud o localhost
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.