Gemini Data Analysis & Research MCP Server is a powerful tool that leverages Google's Gemini Flash 2 AI model to analyze datasets, generate research papers, and automatically deliver results via email. This all-in-one solution helps you extract insights from your data and share them with stakeholders efficiently.
Before installing the server, ensure you have:
git clone [your-repo-url]
cd gemini-data-analysis-email-generator
npm install
.env
file in the root directory with your API keys:GEMINI_API_KEY=your_api_key_here
[email protected]
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": "[email protected]",
"NODEMAILER_PASSWORD": "your_app_password_here"
}
}
}
}
Use the analyze-data
command to process Excel or CSV files:
{
"name": "analyze-data",
"arguments": {
"fileData": "base64_encoded_file_content",
"fileName": "data.xlsx",
"analysisType": "detailed",
"outputDir": "./analysis_results"
}
}
This tool provides:
Send emails with AI-generated subject lines using the send-email
command:
{
"name": "send-email",
"arguments": {
"to": "[email protected]",
"subjectPrompt": "Create a professional subject line for a business report",
"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.</p>",
"images": [
{
"name": "chart.png",
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
]
}
}
Generate research papers and analysis using the generate-thinking
command:
{
"name": "generate-thinking",
"arguments": {
"prompt": "Analyze the market trends for Q1 2024",
"outputDir": "./thinking_output"
}
}
The server organizes outputs in the following directory structure:
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
API 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
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "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":"[email protected]","NODEMAILER_PASSWORD":"your_app_password_here"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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": "[email protected]",
"NODEMAILER_PASSWORD": "your_app_password_here"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"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": "[email protected]",
"NODEMAILER_PASSWORD": "your_app_password_here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect