Gemini Data Analysis & Research MCP server

Bridges to Google's Gemini model for data analysis, email communication, and reasoning process generation with tools for Excel/CSV processing, statistical visualization, and AI-generated content.
Back to servers
Setup instructions
Provider
falahgs
Release date
Apr 15, 2025
Language
TypeScript
Stats
1 star

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.

Installation

Prerequisites

Before installing the server, ensure you have:

  • Node.js (v16 or higher)
  • TypeScript
  • Claude Desktop
  • Google Gemini API Key
  • SMTP Email Account (for email functionality)

Setup Process

  1. Clone the repository and install dependencies:
git clone [your-repo-url]
cd gemini-data-analysis-email-generator
npm install
  1. Create a .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
  1. Build the project:
npm run build

Claude Desktop Configuration

  1. Create or edit the Claude Desktop configuration file at %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"
      }
    }
  }
}
  1. Restart Claude Desktop to apply the changes

Usage

Data Analysis

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:

  • Statistical analysis of numeric columns
  • Interactive visualizations using Chart.js
  • AI-powered insights from Gemini Flash 2
  • Detailed HTML reports with interactive plots
  • Direct email delivery of analysis results

Email Sending

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..."
      }
    ]
  }
}

Research Generation

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"
  }
}

Output Structure

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

Troubleshooting

Common Issues

  1. API Key Error

    • Verify .env file exists
    • Check API key validity
    • Ensure proper environment loading
  2. Claude Desktop Connection

    • Verify config.json syntax
    • Check file paths in config
    • Restart Claude Desktop
  3. Email Sending Issues

    • Check that NODEMAILER_EMAIL and NODEMAILER_PASSWORD are set correctly
    • For Gmail, ensure you've created an app password
    • Verify that less secure app access is enabled for non-Gmail providers
  4. Data Analysis Issues

    • Ensure file format is supported (.xlsx, .xls, .csv)
    • Check file encoding (UTF-8 recommended)
    • Verify file size is within limits

Debug Mode

Add DEBUG=true to your .env file for verbose logging:

GEMINI_API_KEY=your_key_here
DEBUG=true

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later