FGJ Multimedios MCP Server

FGJ Multimedios MCP Server

Enables automated sending of institutional emails via Gmail SMTP with authentication and automatic signature from FGJ Multimedios' General Manager.

Category
Visit Server

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=verifier en el servidor
  • NO envíes headers Authorization: Bearer desde el cliente
  • ✅ FastMCP Cloud maneja la autenticación automáticamente
  • ✅ Usa app.py como punto de entrada (sin autenticación)

Desarrollo Local

  • ✅ Usa auth=verifier en el servidor (server.py)
  • ✅ Envía Authorization: Bearer {token} desde el cliente
  • ✅ Configura MCP_TOKEN en .env

Despliegue en FastMCP Cloud

Paso 1: Preparar el Repositorio

  1. Asegúrate de que tu código esté en un repositorio de GitHub
  2. 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

  1. Ve a FastMCP Cloud e inicia sesión con tu cuenta de GitHub
  2. Haz clic en "New Project" o "Crear Proyecto"
  3. Selecciona tu repositorio de GitHub
  4. 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: main o tu rama de desarrollo

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_PASS debe ser una Contraseña de Aplicación de Gmail (no tu contraseña normal)
  • NO agregues MCP_TOKEN en FastMCP Cloud - no es necesario
  • ✅ FastMCP Cloud maneja la autenticación automáticamente

Paso 4: Desplegar

  1. Haz clic en "Deploy" o "Desplegar"
  2. FastMCP Cloud construirá y desplegará tu servidor
  3. 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 institucionales
  • email_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:

  1. Verifica que usas app.py como punto de entrada en FastMCP Cloud

    • app.py NO tiene autenticación (correcto para FastMCP Cloud)
    • server.py tiene autenticación (solo para desarrollo local)
  2. Verifica las variables de entorno en FastMCP Cloud:

    EMAIL_USER=tu-correo@gmail.com
    EMAIL_PASS=app-password-de-gmail
    

    ❌ NO agregues MCP_TOKEN en FastMCP Cloud

  3. Ejecuta el test de conexión:

    python test_fastmcp.py
    
  4. 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:

  1. Verifica tu archivo .env:

    EMAIL_USER=tu-correo@gmail.com
    EMAIL_PASS=app-password-de-gmail
    MCP_TOKEN=tu-token-secreto
    
  2. Inicia el servidor con autenticación:

    python server.py
    
  3. 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.pyDEPRECADO (usar app.py)
  • client.py → Cliente que detecta automáticamente el modo
  • test_fastmcp.py → Prueba de conexión

Notas

  • Cada push a la rama main redeployará 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured