MCP CSV Analysis with Gemini AI
Utilizes Google Gemini AI to perform advanced exploratory data analysis, pattern recognition, and detailed thinking generation on CSV datasets.
Integrates with Plotly to generate interactive data visualizations, including histograms, correlation heatmaps, scatter plots, and box plots.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP CSV Analysis with Gemini AI analyze sales_data.csv and create a scatter plot of revenue vs marketing spend"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 statisticsdetailed: 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 typesadvanced: Complex multi-variable visualizationscustom: 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
Clone and setup:
git clone [your-repo-url]
cd mcp-csv-analysis-gemini
npm installCreate
.envfile:
GEMINI_API_KEY=your_api_key_hereBuild the project:
npm run buildClaude Desktop Configuration
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"
}
}
}
}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 JavaScriptnpm run start: Start the MCP servernpm run dev: Run in development mode with ts-node
Environment Variables
GEMINI_API_KEY: Your Google Gemini API keyPLOTLY_USERNAME: Your Plotly usernamePLOTLY_API_KEY: Your Plotly API key
š Analysis Details
Basic Analysis Includes
Basic statistical summary for each column
Data quality assessment
Key insights and patterns
Potential correlations
Recommendations for further analysis
Detailed Analysis Includes
Comprehensive statistical analysis
Distribution analysis
Central tendency measures
Dispersion measures
Outlier detection
Advanced data quality assessment
Pattern recognition
Correlation analysis
Feature importance analysis
Preprocessing recommendations
Visualization suggestions
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
.envfileReview CSV data for sensitive information
Use custom output directories for sensitive analyses
Secure your Plotly credentials
š Troubleshooting
Common Issues
API Key Error
Verify
.envfile existsCheck API key validity
Ensure proper environment loading
CSV Parsing Error
Verify CSV file format
Check file permissions
Ensure file is not empty
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
Fork the repository
Create your feature branch
Commit your changes
Push to the branch
Create a Pull Request
š License
MIT License - See LICENSE file for details
Available Tools
3 toolsanalyze-csvC
Analyze CSV file using Gemini's AI capabilities for EDA and data science insights
Inputs: csvPath (required), outputDir, analysisType.
generate-thinkingC
Generate detailed thinking process text using Gemini's experimental thinking model
Inputs: prompt (required), outputDir.
visualize-dataC
Generate visualizations from CSV data using Chart.js
Inputs: csvPath (required), outputDir, visualizationType, columns, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 3 tools
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.
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.
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.
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
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceAn 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-
- FlicenseBqualityDmaintenanceAn 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-
- FlicenseNot gradedqualityDmaintenanceAn 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.-
- FlicenseNot gradedqualityDmaintenanceAn 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.-