A Model Context Protocol server leveraging Google's Gemini Flash 2 to analyze datasets, generate research papers, and deliver results via email.
A powerful Model Context Protocol (MCP) server that leverages Google's Gemini Flash 2 AI model for comprehensive data analysis, research paper generation, and automated email delivery. This server provides an integrated solution for analyzing datasets, generating research content, and distributing results directly to stakeholders via email.
analyze-data
)send-email
)generate-thinking
)git clone [your-repo-url] cd gemini-data-analysis-email-generator npm install
.env
file:GEMINI_API_KEY=your_api_key_here NODEMAILER_EMAIL=your.email@gmail.com NODEMAILER_PASSWORD=your_app_password_here
npm run build
%AppData%/Claude/claude_desktop_config.json
:{ "mcpServers": { "Gemini Data Analysis": { "command": "node", "args": ["path/to/gemini-data-analysis-email-generator/dist/index.js"], "cwd": "path/to/gemini-data-analysis-email-generator", "env": { "GEMINI_API_KEY": "your_api_key_here", "NODEMAILER_EMAIL": "your.email@gmail.com", "NODEMAILER_PASSWORD": "your_app_password_here" } } } }
{ "name": "analyze-data", "arguments": { "fileData": "base64_encoded_file_content", "fileName": "data.xlsx", "analysisType": "detailed", "outputDir": "./analysis_results" } }
{ "name": "send-email", "arguments": { "to": "recipient@example.com", "subjectPrompt": "Create a professional subject line for a business report", "text": "Hello! This is the plain text version of our email.", "html": "Hello!This is the HTML version of our email.", "images": [ { "name": "chart.png", "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." } ] } }
{ "name": "generate-thinking", "arguments": { "prompt": "Analyze the market trends for Q1 2024", "outputDir": "./thinking_output" } }
output/
āāā analysis/
ā āāā plots/
ā ā āāā column1_histogram_[timestamp].html
ā ā āāā column2_histogram_[timestamp].html
ā āāā analysis_[timestamp].txt
ā āāā report_[timestamp].html
āāā thinking/
ā āāā gemini_thinking_[timestamp].txt
āāā emails/
āāā email_log_[timestamp].txt
npm run build
: Compile TypeScript to JavaScriptnpm run start
: Start the MCP servernpm run dev
: Run in development mode with ts-nodeGEMINI_API_KEY
: Your Google Gemini API keyNODEMAILER_EMAIL
: Your email address for sending emailsNODEMAILER_PASSWORD
: Your email app password (for Gmail, use an app password).env
fileAPI Key Error
.env
file existsClaude Desktop Connection
Email Sending Issues
Data Analysis Issues
Add DEBUG=true
to your .env
file for verbose logging:
GEMINI_API_KEY=your_key_here DEBUG=true
interface AnalyzeDataParams { fileData: string; // Base64 encoded file content fileName: string; // File name (must be .xlsx, .xls, or .csv) analysisType: 'basic' | 'detailed'; // Analysis type outputDir?: string; // Optional output directory }
interface SendEmailParams { to: string; // Recipient email address subjectPrompt: string; // Prompt for Gemini to generate 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 }[]; }
interface GenerateThinkingParams { prompt: string; // Analysis prompt outputDir?: string; // Optional output directory }
Falah G. Salieh
š Baghdad, Iraq
š
2025
MIT License - See LICENSE file for details
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!