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 "Install 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 AIanalyze 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
| Name | Required | Description | Default |
|---|---|---|---|
| csvPath | Yes | Path to the CSV file to analyze | |
| outputDir | No | Directory to save analysis results (optional) | |
| analysisType | No | Type of analysis to perform (basic or detailed) | detailed |
TDQS
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.
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.
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.
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.
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.
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
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Prompt for generating thinking process text | |
| outputDir | No | Directory to save output responses (optional) |
TDQS
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.
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.
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.
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.
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.
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
| Name | Required | Description | Default |
|---|---|---|---|
| csvPath | Yes | Path to the CSV file to visualize | |
| outputDir | No | Directory to save visualization results (optional) | |
| visualizationType | No | Type of visualization to generate | bar |
| columns | No | Columns to visualize (first column for labels, second for values) | |
| title | No | Chart title (optional) |
TDQS
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.
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.
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.
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.
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.
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
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
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
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.
MCP server for Gainium ā manage trading bots, deals, and balances via AI assistants
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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