Skip to main content
Glama
falahgs

MCP CSV Analysis with Gemini AI

by falahgs

MCP CSV Analysis with Gemini AI

A powerful Model Context Protocol (MCP) server that provides advanced CSV analysis and thinking generation capabilities using Google's Gemini AI. This tool integrates seamlessly with Claude Desktop and offers sophisticated data analysis, visualization, and natural language processing features.

🌟 Features

1. CSV Analysis Tool (analyze-csv)

  • Comprehensive Data Analysis: Performs detailed Exploratory Data Analysis (EDA) on CSV files

  • Two Analysis Modes:

    • basic: Quick overview and essential statistics

    • detailed: In-depth analysis with advanced insights

  • Analysis Components:

    • Statistical analysis of all columns

    • Data quality assessment

    • Pattern recognition

    • Correlation analysis

    • Feature importance evaluation

    • Preprocessing recommendations

    • Business insights

    • Visualization suggestions

2. Data Visualization Tool (visualize-data)

  • Interactive Visualizations: Creates beautiful and informative charts using Plotly

  • Visualization Types:

    • basic: Automatic visualization selection based on data types

    • advanced: Complex multi-variable visualizations

    • custom: User-defined chart configurations

  • Chart Types:

    • Histograms for distribution analysis

    • Correlation heatmaps

    • Scatter plots

    • Line charts

    • Bar charts

    • Box plots

  • Features:

    • Automatic data type detection

    • Smart chart selection

    • Interactive plots

    • High-resolution exports

    • Customizable layouts

3. Thinking Generation Tool (generate-thinking)

  • Generates detailed thinking process text using Gemini's experimental model

  • Supports complex reasoning and analysis

  • Saves responses with timestamps

  • Customizable output directory

Related MCP server: Data Analytics MCP Toolkit

šŸš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)

  • TypeScript

  • Claude Desktop

  • Google Gemini API Key

  • Plotly Account (for visualizations)

Installation

  1. Clone and setup:

git clone [your-repo-url]
cd mcp-csv-analysis-gemini
npm install
  1. Create .env file:

GEMINI_API_KEY=your_api_key_here
  1. Build the project:

npm run build

Claude Desktop Configuration

  1. Create/Edit %AppData%/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "CSV Analysis": {
      "command": "node",
      "args": ["path/to/mcp-csv-analysis-gemini/dist/index.js"],
      "cwd": "path/to/mcp-csv-analysis-gemini",
      "env": {
        "GEMINI_API_KEY": "your_api_key_here",
        "PLOTLY_USERNAME": "your_plotly_username",
        "PLOTLY_API_KEY": "your_plotly_api_key"
      }
    }
  }
}
  1. Restart Claude Desktop

šŸ“Š Using the Tools

CSV Analysis

{
  "name": "analyze-csv",
  "arguments": {
    "csvPath": "./data/your_file.csv",
    "analysisType": "detailed",
    "outputDir": "./custom_output"
  }
}

Data Visualization

{
  "name": "visualize-data",
  "arguments": {
    "csvPath": "./data/your_file.csv",
    "visualizationType": "basic",
    "columns": ["column1", "column2"],
    "chartTypes": ["histogram", "scatter"],
    "outputDir": "./custom_output"
  }
}

Thinking Generation

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

šŸ“ Output Structure

output/
ā”œā”€ā”€ analysis/
│   ā”œā”€ā”€ csv_analysis_[timestamp]_part1.txt
│   ā”œā”€ā”€ csv_analysis_[timestamp]_part2.txt
│   └── csv_analysis_[timestamp]_summary.txt
ā”œā”€ā”€ visualizations/
│   ā”œā”€ā”€ histogram_[column]_[timestamp].png
│   ā”œā”€ā”€ scatter_[columns]_[timestamp].png
│   └── correlation_heatmap_[timestamp].png
└── thinking/
    └── gemini_thinking_[timestamp].txt

šŸ“Š Visualization Types

Basic Visualizations

  • Automatically generated based on data types

  • Includes:

    • Histograms for numeric columns

    • Correlation heatmaps

    • Basic scatter plots

Advanced Visualizations

  • More sophisticated charts

  • Multiple variables

  • Enhanced layouts

  • Custom color schemes

Custom Visualizations

  • User-defined chart types

  • Configurable parameters

  • Custom styling options

  • Advanced plot layouts

šŸ› ļø 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

  • PLOTLY_USERNAME: Your Plotly username

  • PLOTLY_API_KEY: Your Plotly API key

šŸ“ Analysis Details

Basic Analysis Includes

  1. Basic statistical summary for each column

  2. Data quality assessment

  3. Key insights and patterns

  4. Potential correlations

  5. Recommendations for further analysis

Detailed Analysis Includes

  1. Comprehensive statistical analysis

    • Distribution analysis

    • Central tendency measures

    • Dispersion measures

    • Outlier detection

  2. Advanced data quality assessment

  3. Pattern recognition

  4. Correlation analysis

  5. Feature importance analysis

  6. Preprocessing recommendations

  7. Visualization suggestions

  8. Business insights

āš ļø Limitations

  • Maximum file size: Dependent on system memory

  • Rate limits: Based on Gemini API and Plotly quotas

  • Output token limit: 65,536 tokens per response

  • CSV format: Standard CSV files only

  • Analysis time: Varies with data size and complexity

  • Visualization limits: Based on Plotly free tier restrictions

šŸ”’ Security Notes

  • Store your API keys securely

  • Don't share your .env file

  • Review CSV data for sensitive information

  • Use custom output directories for sensitive analyses

  • Secure your Plotly credentials

šŸ› Troubleshooting

Common Issues

  1. API Key Error

    • Verify .env file exists

    • Check API key validity

    • Ensure proper environment loading

  2. CSV Parsing Error

    • Verify CSV file format

    • Check file permissions

    • Ensure file is not empty

  3. Claude Desktop Connection

    • Verify config.json syntax

    • Check file paths in config

    • Restart Claude Desktop

Debug Mode

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

GEMINI_API_KEY=your_key_here
DEBUG=true

šŸ“š API Reference

CSV Analysis Tool

interface AnalyzeCSVParams {
  csvPath: string;          // Path to CSV file
  outputDir?: string;       // Optional output directory
  analysisType?: 'basic' | 'detailed';  // Analysis type
}

Data Visualization Tool

interface VisualizeDataParams {
  csvPath: string;          // Path to CSV file
  outputDir?: string;       // Optional output directory
  visualizationType?: 'basic' | 'advanced' | 'custom';  // Visualization type
  columns?: string[];       // Columns to visualize
  chartTypes?: ('scatter' | 'line' | 'bar' | 'histogram' | 'box' | 'heatmap')[];  // Chart types
  customConfig?: Record<string, any>;  // Custom configuration
}

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

Available Tools

3 tools
analyze-csvC

Analyze CSV file using Gemini's AI capabilities for EDA and data science insights

ParametersJSON Schema
NameRequiredDescriptionDefault
csvPathYesPath to the CSV file to analyze
outputDirNoDirectory to save analysis results (optional)
analysisTypeNoType of analysis to perform (basic or detailed)detailed

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'EDA and data science insights' but doesn't specify what the analysis entails, how results are returned (e.g., as text, files, or structured data), or any constraints like file size limits or processing time. For an AI-powered analysis tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. Every word earns its place, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an AI-powered analysis tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'analysis' outputs look like, how insights are delivered, or any behavioral traits. This is inadequate for a tool that likely produces varied results based on input parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema, such as explaining 'EDA' or 'data science insights' in relation to parameters. Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Analyze CSV file using Gemini's AI capabilities for EDA and data science insights.' It specifies the verb ('analyze'), resource ('CSV file'), and technology ('Gemini's AI capabilities'), distinguishing it from sibling tools like 'generate-thinking' and 'visualize-data' which likely serve different functions. However, it doesn't explicitly differentiate from siblings beyond the general domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools, prerequisites, or scenarios where this tool is preferred over others. The only implied usage is for CSV analysis with AI, but this is too vague for effective tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate-thinkingC

Generate detailed thinking process text using Gemini's experimental thinking model

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesPrompt for generating thinking process text
outputDirNoDirectory to save output responses (optional)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the model is 'experimental', hinting at potential instability or variability, but lacks details on rate limits, authentication needs, output format, or error handling. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It is front-loaded with the core purpose and includes a key detail (experimental model) without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits, return values, or error handling, which are critical for a generation tool with experimental aspects. The description does not compensate for these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (prompt and outputDir). The description adds no additional meaning beyond what the schema provides, such as examples or constraints, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('generate') and resource ('detailed thinking process text'), specifying it uses 'Gemini's experimental thinking model'. It doesn't explicitly differentiate from sibling tools (analyze-csv, visualize-data), but those appear to be unrelated data processing tools, so the purpose is clear without direct comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives or in what context. The description states what it does but offers no usage context, prerequisites, or exclusions, leaving the agent to infer applicability.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

visualize-dataC

Generate visualizations from CSV data using Chart.js

ParametersJSON Schema
NameRequiredDescriptionDefault
csvPathYesPath to the CSV file to visualize
outputDirNoDirectory to save visualization results (optional)
visualizationTypeNoType of visualization to generatebar
columnsNoColumns to visualize (first column for labels, second for values)
titleNoChart title (optional)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'generate visualizations' but doesn't specify what happens (e.g., saves files, displays charts, requires specific permissions, or has rate limits). For a tool with 5 parameters and no annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Generate visualizations from CSV data using Chart.js'. It's front-loaded with the core purpose, has zero wasted words, and appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., file paths, chart objects, errors) or behavioral aspects like file handling. For a data visualization tool with multiple inputs, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no additional parameter semantics beyond implying CSV data visualization. It doesn't explain parameter interactions or provide context beyond what's in the schema, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate visualizations from CSV data using Chart.js'. It specifies the action (generate visualizations), resource (CSV data), and technology (Chart.js). However, it doesn't explicitly differentiate from sibling tools like 'analyze-csv' or 'generate-thinking', which might have overlapping data processing functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'analyze-csv' or 'generate-thinking', nor does it specify scenarios where visualization is preferred over other data processing methods. The user must infer usage from the purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.1/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: analyze-csv focuses on data analysis and insights, generate-thinking produces text-based reasoning, and visualize-data creates charts. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency4/5

The tools follow a consistent verb-object pattern (analyze-csv, generate-thinking, visualize-data), all using kebab-case. The naming is predictable and readable, with only minor deviations like 'visualize-data' using a verb-noun structure while others use verb-ing-noun.

Tool Count3/5

With only 3 tools, the server feels thin for a CSV analysis domain that could include operations like data cleaning, filtering, or exporting. While the tools cover core AI-driven tasks, the scope is limited and might require workarounds for common data workflows.

Completeness2/5

There are significant gaps in the tool surface for CSV analysis: no tools for basic operations like loading/reading CSV files, filtering data, handling missing values, or exporting results. The server relies heavily on AI and visualization without foundational data manipulation capabilities, which could lead to agent failures in typical data processing tasks.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    Not graded
    maintenance
    An MCP server that enables AI assistants to load, query, and analyze local CSV files using tools for filtering, aggregation, and grouping. It provides capabilities to describe schemas, calculate statistics, and sample data directly from CSV files.
    6
  • F
    license
    B
    quality
    D
    maintenance
    An MCP server that provides data visualization and machine learning tools, featuring automated intent-based pipeline routing for data cleaning and model training. It enables LLMs to process CSV or JSON data to generate visual charts, perform regressions, or execute clustering analysis.
    16
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for data analysis and visualization supporting CSV and Excel files. It enables users to generate statistical summaries and create multi-dimensional charts like heatmaps and bar plots through natural language.
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables the analysis of CSV and Parquet files by providing tools for statistical summaries, data previews, and structure exploration. It allows users to query local datasets and create sample data using natural language.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/falahgs/MCP-CSV-Analysis-with-Gemini-AI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server