MCPCorreos

Provides automated Gmail-based institutional email sending with IA-contextual responses via MCP, supporting cloud deployment and local development.
  • 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

You can run and connect to the FGJ Multimedios MCP Server to automate the sending of institutional emails via SMTP, while providing IA-driven context for replies. This setup supports cloud deployment for production and a local development flow with authentication, giving you a flexible way to test, customize, and operate reliable email sending from FGJ Multimedios.

How to use

You will use an MCP client to connect to either the FastMCP Cloud URL for production or the local server for development. In production, the client talks to the cloud endpoint and authentication is handled automatically. In development, you run the local server with explicit authentication and provide a bearer token from the client to access the MCP.

How to install

Prerequisites you need before starting:

  • Python 3.8+ installed on your machine
  • Internet access to install dependencies and reach the cloud URL or localhost
  • A Gmail account to send emails via SMTP (or use your preferred SMTP provider via the provided credentials) and an App Password for Gmail if using Gmail SMTP.
Step-by-step setup for development and production paths:

1) Prepare your project files
- Ensure you have these files in your project:
  - `app.py` as the entry point for FastMCP Cloud (no authentication in production)
  - `requirements.txt` with all dependencies
  - `server.py` for local development (with authentication)

2) Install dependencies locally
- Install Python dependencies:

pip install -r requirements.txt


3) Configure environment variables (local development)
- Create or edit your `.env` file to include Gmail credentials and your MCP token:

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


4) Run the local server (development path)
- Start the local MCP server with authentication:

python server.py


5) Use the cloud path (production path)
- Deploy to FastMCP Cloud following the cloud deployment steps below, which will expose a cloud URL like https://tu-proyecto.fastmcp.app/api/mcp

No local server needed for production; app.py is the entry point used by the cloud service


6) Connect the MCP client to the appropriate endpoint
- For production, point your client to the cloud URL
- For development, point your client to http://localhost:8000/api

7) Optional: test the connection

python test_fastmcp.py

## Configuration and security notes

Production (FastMCP Cloud): authentication is handled automatically. Do not send `Authorization: Bearer` headers from the client. Use `app.py` as the entry point. Do not set `MCP_TOKEN` in production configuration.

Development (Local): enable explicit authentication. Use `server.py` as the entry point and include `Authorization: Bearer {token}` headers from the client. Set `MCP_TOKEN` in your `.env` file to your secret token.

## Environment variables

The following environment variables are required for production and development workflows:
- `EMAIL_USER`: Gmail address used to send emails
- `EMAIL_PASS`: Gmail App Password for SMTP access
- `MCP_TOKEN`: Secret token used for local authentication
These variables are used to configure the SMTP client and the MCP authentication flow.

## Runtime and server endpoints

Two MCP connection methods are available based on deployment:
- HTTP (production cloud): use the cloud URL provided after deployment
- STDIO (local): run the local Python server and connect via localhost
The cloud URL (example) is:
```https://tu-proyecto.fastmcp.app/api/mcp```To run locally, start the server with:```python server.py```

## Examples of MCP configuration

{ "mcpServers": { "fgj_cloud": { "type": "http", "name": "fgj_cloud_mcp", "url": "https://tu-proyecto.fastmcp.app/api/mcp", "args": [] }, "fgj_local": { "type": "stdio", "name": "fgj_local_mcp", "command": "python", "args": ["server.py"], "env": [ {"name": "EMAIL_USER", "value": "tu-correo@gmail.com"}, {"name": "EMAIL_PASS", "value": "tu-app-password-de-gmail"}, {"name": "MCP_TOKEN", "value": "tu-token-secreto"} ] } } }

## Troubleshooting

Common issues include authentication errors in development and SMTP authentication failures. Ensure you are using the correct entry point for each environment, and verify your environment variables are set correctly. If you encounter `401 Unauthorized` in production, verify that you are not sending client-side `Authorization` headers and that you are pointing to the correct cloud URL. If you encounter SMTP issues, double-check your Gmail App Password and SMTP settings.

## Notes

Pushes to the main development branch will redeploy automatically in production. Logs are available in the cloud dashboard, and the client automatically detects whether it is connecting to FastMCP Cloud or localhost. The client will use the appropriate authentication flow based on the endpoint detected.

## Available tools

### send\_email

Sends institutional emails via the configured SMTP provider using the MCP interface.

### email\_context

Provides a contextual prompt for the AI to tailor email responses for FGJ Multimedios.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational