csv-mcp-server
Enables Claude to directly access, query, and analyze local CSV files using natural language, keeping data private and local.
README
🚀 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.
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 pandas
3. 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 needed
4. Run the Server
Start the MCP server with:
uv run main.py
For development or inspection mode (to see tools, logs, and capabilities):
uv run fastmcp dev main.py
Connecting to Claude Desktop
Open your Claude configuration file:
| OS | Path |
|---|---|
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
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 | csv://list |
Lists all available CSV files |
| Resource | csv://{filename} |
Preview a CSV (first 10 rows) |
| Tool | read_csv(filename, rows) |
Read full or partial CSV data |
| Tool | get_csv_info(filename) |
Get metadata and structure |
| Tool | query_csv(filename, query) |
Filter data using Pandas query syntax |
| Tool | get_csv_statistics(filename, column) |
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.csv
Customization
- Change CSV directory → edit
CSV_DIRECTORYinmain.py - Add 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.py
Contributing
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。