csv-analyzer
A local MCP server for analyzing CSV files from your filesystem, particularly suited for chatbot conversation logs. Allows listing, reading, filtering, merging, and statistical analysis of CSV data via natural language.
README
CSV Analyzer MCP Server (Local)
A local Model Context Protocol (MCP) server for analyzing CSV files directly from your filesystem. Specifically designed for chatbot conversation logs analysis, such as analyzing customer support logs, chatbot interactions, and any conversational data stored in CSV format.
Features
- š List CSV files in directories
- š Read and analyze conversation logs
- āļø Create and write analysis reports
- ā Append data for custom log addition
- š Filter and query specific logs
- š Merge multiple log files from different time periods
- š Statistical analysis of conversation metrics
- š¬ Conversational insights by custom topics (e.g. product area), user intent, sentiment
- š¤ AI-guided prompts for analysis workflows
Why Local?
This server uses local file access (not remote HTTP), which means:
- ā Direct filesystem access - just provide file paths
- ā Works with large CSV files efficiently
- ā No file upload/download needed
- ā Better security - files stay on your machine
- ā Simpler setup - no ports or networking
- ā Perfect for personal CSV analysis
Installation
Prerequisites
- Python 3.8 or higher
- Claude Desktop app
Step 1: Clone or Download
# Clone repository
git clone https://github.com/YOUR_USERNAME/csv-mcp-server.git
cd csv-mcp-server
# Or download and extract the ZIP file
Step 2: Create Virtual Environment
# Create virtual environment
python -m venv venv
# Activate it
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
Step 3: Install Dependencies
pip install -r requirements.txt
Step 4: Test the Server with MCP Inspector
npx @modelcontextprotocol/inspector python server.py
Configuration
Add to Claude Desktop
-
Find your config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Edit the config file (create if it doesn't exist):
{
"mcpServers": {
"csv-analyzer": {
"command": "python",
"args": ["/absolute/path/to/csv-mcp-server/server.py"]
}
}
}
Important: Replace /absolute/path/to/csv-mcp-server/server.py with your actual path!
Example paths:
- macOS:
/Users/yourname/projects/csv-mcp-server/server.py - Windows:
C:\\Users\\yourname\\projects\\csv-mcp-server\\server.py
-
Restart Claude Desktop
-
Verify it's working:
- Look for the šØ (hammer) icon in Claude Desktop
- You should see "csv-analyzer" listed with available tools
Usage Examples
Once configured, you can interact with CSV files naturally in Claude or Cursor:
Example 1: List CSV Files
You: Show me all CSV files in my Downloads folder
Claude: [Uses list_csv_files tool]
I found 5 CSV files in your Downloads folder:
- chatbot_logs.csv (1,234 rows, 8 columns, 2.3 MB)
- customer_data.csv (5,678 rows, 12 columns, 4.1 MB)
...
Example 2: Analyze a CSV
You: Analyze ~/Documents/chatbot_logs.csv
Claude: [Uses analyze_csv tool]
I've analyzed your chatbot_logs data. Here are the key findings:
š Dataset Overview:
- 1,234 rows Ć 8 columns
- Date range: July 2025 - September 2025
- File size: 2.3 MB
š Key Insights:
1. Overall Satisfaction Rate: 94% (thumbs up)
2. Dissatisfaction Rate: 6% (thumbs down)
3. Most Common Positive Feedback: Performance optimization guidance (6 instances)
4. Most Common Negative Feedback: Need for more examples/code implementations
...
Example 3: Filter and Save
You: Filter chatbot_logs.csv where feedback = negative and save to logs_negative_feedback.csv
Claude: [Uses filter_csv tool]
Filtered data:
- Original rows: 1,234
- Filtered rows: 187 (15.2%)
- Saved to: ~/Documents/logs_negative_feedback.csv
Example 4: Merge Files
You: Merge customer_data.csv and chatbot_logs.csv on customer_id
Claude: [Uses merge_csvs tool]
Successfully merged files:
- customer_data.csv: 500 rows
- chatbot_logs.csv: 1,234 rows
- Merged result: 1,234 rows
- Saved to: merged_output.csv
Available Tools
File Operations
| Tool | Description |
|---|---|
list_csv_files |
List all CSV files in a directory |
read_csv |
Read data from a CSV file |
write_csv |
Create and write a new CSV file |
append_csv |
Append rows to existing CSV |
create_csv |
Create new CSV with headers |
get_csv_info |
Get detailed file information |
Analysis Tools
| Tool | Description |
|---|---|
analyze_csv |
Comprehensive statistical analysis |
categorize_by_product |
Keyword based categorization (e.g. Product area) |
filter_csv |
Filter data with conditions |
merge_csvs |
Merge two CSV files |
Analysis Prompts
| Prompt | Description |
|---|---|
analyze_csv_data |
Complete workflow for CSV analysis |
create_report_from_csv |
Generate professional data report |
compare_csvs |
Compare two CSV files |
clean_csv_data |
Guide through data cleaning process |
Advanced Usage
Custom Analysis Workflows
You can create custom analysis workflows by chaining multiple tools:
You: I want to analyze all CSV files in my Downloads folder,
find the ones with sales data, filter for amounts over $1000,
and create a summary report.
Claude: [Will use multiple tools in sequence:
1. list_csv_files to find all CSVs
2. read_csv to peek at each file
3. filter_csv on relevant files
4. analyze_csv for statistics
5. Create formatted report]
Working with Large Files
For large CSV files (>100MB), the server:
- Reads data efficiently with pandas
- Can limit rows returned
- Analyzes without loading all data
- Provides streaming statistics
Tips:
- Use
rowsparameter to limit data read - Filter large files before analysis
- Save filtered results to new files
Data Cleaning Workflow
Use the clean_csv_data prompt for guided cleaning:
You: Help me clean my messy sales data at ~/messy_sales.csv
Claude: [Uses clean_csv_data prompt]
I'll analyze the data and guide you through cleaning it.
Step 1: Initial Assessment...
Found these issues:
- 23 duplicate rows (1.8%)
- Missing values in "amount" column (5%)
- Inconsistent date formats
Step 2: Recommended Fixes...
[Provides detailed recommendations]
[Once approved, creates cleaned version]
Security & Privacy
Data Privacy
- ā All data stays on your local machine
- ā No data sent to external servers
- ā Files accessed only via Claude Desktop
- ā No internet connection required
File Permissions
The server can:
- ā Read CSV files you have access to
- ā Write new files in writable directories
- ā Cannot access system files
- ā Cannot modify without explicit command
Best Practices
- Keep sensitive data local - perfect use case for this tool
- Use separate folder for analysis outputs
- Review changes before overwriting files
- Backup important data before cleaning operations
Development
Project Structure
csv-mcp-server/
āāā server.py # Main server implementation
āāā requirements.txt # Python dependencies
āāā README.md # This file
āāā .gitignore # Git ignore rules
āāā venv/ # Virtual environment (not in git)
āāā analysis/ # Sample analysis outputs
āāā test_data/ # Sample files
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.