csv-mcp-server
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., "@csv-mcp-server Show me the first 10 rows of sales_data.csv."
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.
š CSV MCP Server ā Bring Your Data to Life in Claude
Why This Matters
If you've ever tried to analyze CSV files in Claude.ai, you know the pain ā it can't read your files directly. You end up:
Copying and pasting CSV snippets (and hitting character limits)
Uploading your data to other tools
Manually describing what's inside your CSV
That's time-consuming and breaks your workflow.
Related MCP server: mix_server
Enter the CSV MCP Server
This lightweight connector lets Claude directly access and analyze your local CSV files ā privately, efficiently, and in real time.
With it, you can simply say:
"Claude, show me all customers from New York with purchases over $1000,"
and Claude will query your actual file.
What This Server Does
Once connected, Claude can:
ā List your local CSV files
ā Preview structure and sample data
ā Run queries using natural language or Pandas syntax
ā Generate quick summaries (mean, median, count, etc.)
ā Handle large datasets ā all without sending data online
Everything runs locally ā your files never leave your system.
Why It's Different
Local-first & private: your data stays on your device
Fast: built using FastMCP
Extendable: easily add Excel, TSV, or custom logic
Seamless: Claude becomes your personal data assistant
Quick Start
Requirements
Python 3.11 or higher
Claude Desktop app
uv (recommended package manager)
1. Clone the Repository
git clone https://github.com/Navneet1710/csv_mcp_server.git
cd csv_mcp_server
uv init .2. Install Dependencies
Using uv, add the required packages:
uv add fastmcp
uv add pandas3. Set Your CSV Directory
Open main.py and edit line 14 to match where your CSV files are stored:
CSV_DIRECTORY = Path.home() / "Documents" / "csv_files" # customize this if needed4. Run the Server
Start the MCP server with:
uv run main.pyFor development or inspection mode (to see tools, logs, and capabilities):
uv run fastmcp dev main.pyConnecting to Claude Desktop
Open your Claude configuration file:
OS | Path |
Windows |
|
macOS |
|
Linux |
|
Add this MCP server entry:
"csv-analyzer": {
"command": uv,
"args": [
"--directory",
"path\\to\\csv_mcp_server",
"run",
"main.py"
]
}Save and restart Claude Desktop.
Using It Inside Claude
Once connected, try commands like:
List all CSVs
"What CSV files are available?"
Preview a file
"Show me the first few rows of sales_data.csv."
Run queries
"From customer_data.csv, show all entries where purchase > 500."
Summarize data
"Give me the average revenue in financial_report.csv."
Analyze relationships
"Find the correlation between 'age' and 'satisfaction_score' in survey_results.csv."
Tools and Resources
Type | Name | Description |
Resource |
| Lists all available CSV files |
Resource |
| Preview a CSV (first 10 rows) |
Tool |
| Read full or partial CSV data |
Tool |
| Get metadata and structure |
Tool |
| Filter data using Pandas query syntax |
Tool |
| Compute descriptive statistics |
Default Folder Structure
By default, CSV files live in:
Documents/
āāā csv_files/
āāā sales_data.csv
āāā customer_info.csv
āāā inventory.csv
āāā financial_report.csvCustomization
Change CSV directory ā edit
CSV_DIRECTORYinmain.pyAdd support for Excel/TSV ā update the file-reading logic
Create your own tools ā add new
@mcp.tool()functions for custom analysis
Troubleshooting
"Directory does not exist"
ā Make sure the path exists or create it:
mkdir -p ~/Documents/csv_files"File not found"
ā Check spelling and ensure the file is inside your configured directory.
Claude doesn't detect the server
ā Restart Claude Desktop and confirm the config file path.
Permission issues
ā Ensure Claude has read access to the directory (run as admin on Windows if needed).
Debugging
Run directly:
uv run main.pyContributing
Got an idea or improvement? Contributions are welcome!
Fork this repo
Create a feature branch
Add your changes
Submit a pull request
License
Open source ā use, modify, and share freely.
Built With
FastMCP ā for fast, local MCP integration
pandas ā for data manipulation and statistics
Anthropic's MCP ā for connecting Claude to your environment
Turn Claude Into Your Personal Data Analyst
Set this up once ā and from then on, you can explore and analyze your CSVs right inside Claude.
No uploads, no manual parsing, no limits.
Run it locally. Keep your data private. Get instant insights.
Make sure you don't forget to star the repo
Available Tools
4 toolsget_csv_infoC
Get detailed information about a CSV file
Args: filename: Name of the CSV file
Inputs: filename (required). Returns: result
get_csv_statisticsC
Get statistical summary of a CSV file or specific column
Args: filename: Name of the CSV file column: Optional specific column name to analyze
Inputs: filename (required), column. Returns: result
query_csvA
Query a CSV file using pandas query syntax
Args: filename: Name of the CSV file query: Pandas query string (e.g., "age > 30 and city == 'NYC'")
Inputs: filename (required), query (required). Returns: result
read_csvA
Read a CSV file and return its contents
Args: filename: Name of the CSV file to read rows: Optional number of rows to return (returns all if not specified)
Inputs: filename (required), rows. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 4 tools
Each tool has a clear, distinct purpose: metadata (get_csv_info), statistics (get_csv_statistics), query/filtering (query_csv), and raw data retrieval (read_csv). No overlapping functionality.
All tool names follow a consistent verb_noun pattern with snake_case, using 'get_csv_' for info and statistics, and straightforward verbs for the others.
4 tools is a well-scoped set for a CSV server, covering the essential read operations without unnecessary bloat.
The tool surface covers read operations comprehensively but lacks write or edit capabilities (e.g., create, update, delete rows or columns), which limits full CRUD coverage.
Maintenance
Related MCP Connectors
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Open, inspect, filter, edit and convert xlsx and csv files from your AI chat. Processing is local.
Ask questions about a CSV in plain English and get answers, charts and cleaned data back.
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables users to analyze local Excel and CSV files through natural language queries and a web dashboard while keeping data local. It supports saving specific analyses as reusable tools and building a custom analytics toolkit within Claude Desktop.10MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with local CSV and Parquet data files through natural language queries, facilitating tasks like summarizing datasets or retrieving specific information.4-
- FlicenseAqualityDmaintenanceEnables Claude to analyze local CSV or Parquet files, handling larger datasets without uploading full files.318-
- AlicenseNot gradedqualityDmaintenanceEnables Claude to read, analyze, and write directly to local Power BI semantic models and Excel workbooks without exporting to the cloud.1MIT