Labsco
falahgs logo

Gemini Email Subject Generator MCP

โ˜… 2

from falahgs

Generates engaging email subjects and detailed thinking processes using Google's Gemini AI model.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

Gemini Email Subject Generator MCP

A powerful Model Context Protocol (MCP) server that leverages Google's Gemini Flash 2 AI model to generate engaging email subjects and detailed thinking processes. This tool integrates seamlessly with Claude Desktop to provide intelligent email subject generation and advanced content creation.

๐ŸŒŸ Features

1. Email Tool with AI Subject Generation (send-email)

  • Sends emails with AI-generated subjects using Gemini Flash 2
  • Features:
    • Dynamic subject generation based on provided prompt
    • Support for HTML and plain text email content
    • Image attachments with inline display capability
    • Secure authentication using environment variables
    • Error handling and status reporting
    • Fully customizable content with rich formatting options
    • Instant delivery with message tracking

2. Thinking Generation Tool (generate-thinking)

  • Generates detailed thinking process text using Gemini's Flash 2 model
  • Supports complex reasoning and analysis
  • Saves responses with timestamps
  • Customizable output directory
  • Ideal for brainstorming, planning, and content creation

๐Ÿ“Š Using the Tools

Email Sending with AI Subject Generation

{
  "name": "send-email",
  "arguments": {
    "to": "recipient@example.com",
    "subjectPrompt": "Create a catchy subject line for a marketing email about our new AI-powered analytics platform",
    "text": "Hello! This is the plain text version of our email.",
    "html": "<h1>Hello!</h1><p>This is the <b>HTML</b> version of our email with an inline image: <img src='cid:image0'/></p>",
    "images": [
      {
        "name": "chart.png",
        "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
      }
    ]
  }
}

Important Note About Email Tool: When you use the send-email tool, Claude will display a confirmation message that the email was sent successfully. This confirmation message is NOT the content of the email - it's just feedback to you that the operation succeeded. The actual email sent to the recipient will contain only the content you specified in the text and html fields, with the subject generated by Gemini based on your prompt.

Thinking Generation

{
  "name": "generate-thinking",
  "arguments": {
    "prompt": "Your complex analysis prompt here",
    "outputDir": "./custom_output"
  }
}

๐Ÿ“ Output Structure

output/
โ””โ”€โ”€ thinking/
    โ””โ”€โ”€ gemini_thinking_[timestamp].txt

๐Ÿ› ๏ธ Development

Available Scripts

  • npm run build: Compile TypeScript to JavaScript
  • npm run start: Start the MCP server
  • npm run dev: Run in development mode with ts-node

Environment Variables

  • GEMINI_API_KEY: Your Google Gemini API key
  • NODEMAILER_EMAIL: Your email address for sending emails
  • NODEMAILER_PASSWORD: Your email app password (for Gmail, use an app password)

๐Ÿ”’ Security Notes

  • Store your API keys securely
  • Don't share your .env file
  • For Gmail, use app passwords instead of your main account password
  • Be careful with the content of emails sent through the system
  • Never include sensitive or personal information in email examples

๐Ÿ“š API Reference

Email Sending Tool

interface SendEmailParams {
  to: string;              // Recipient email address
  subjectPrompt: string;   // Prompt for generating email subject
  text: string;            // Plain text version of email
  html?: string;           // HTML version of email (optional)
  images?: {               // Optional images to attach
    name: string;          // Image filename
    data: string;          // Base64 encoded image data
  }[];
}

Thinking Generation Tool

interface GenerateThinkingParams {
  prompt: string;           // Analysis prompt
  outputDir?: string;       // Optional output directory
}

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

๐Ÿ“„ License

MIT License - See LICENSE file for details