CSV MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CSV MCP Server
A Python MCP (Model Context Protocol) server that enables AI assistants to answer natural language questions about company processes and operational data stored in CSV files. Built with FastMCP and Polars for efficient CSV processing with server-side filter expressions.
Technologies
Technology | Purpose |
Python 3.10+ | Runtime |
MCP server framework | |
High-performance CSV loading and filtering | |
Containerized deployment | |
Testing framework |
Related MCP server: mix_server
Available Tools
Tool | Description |
| Lists all CSV files in the configured directory |
| Shows column names, data types, and sample rows for a CSV file |
| Queries a CSV file using a Polars filter expression |
Quick Start
Without Docker
Install dependencies:
pip install mcp polarsPlace your CSV files in the
./data/directory (or setCSV_DIRto a custom path).Run the server:
python server.pyThe server starts in
stdiomode by default, which is what AI clients like Claude Desktop and Cursor expect.
With Docker
Place your CSV files in the
./data/directory.Build and start the container:
docker compose up -dThe server runs in HTTP mode on
http://localhost:8000/mcp.Verify connectivity:
curl -X POST http://localhost:8000/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1"}},"id":1}'
Configuration
Environment Variables
Variable | Default | Description |
|
| Path to the directory containing CSV files |
|
| Transport mode: |
|
| Host address for HTTP mode |
|
| Port for HTTP mode |
AI Client Integration
OpenCode
Add to your opencode.json:
Local (stdio):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"csv-mcp": {
"type": "local",
"command": ["python", "server.py"],
"environment": {
"CSV_DIR": "./data"
},
"enabled": true
}
}
}Docker (HTTP):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"csv-mcp": {
"type": "remote",
"url": "http://localhost:8000/mcp",
"enabled": true
}
}
}Claude Desktop / Cursor
For stdio mode:
{
"mcpServers": {
"csv-mcp": {
"command": "python",
"args": ["/path/to/server.py"],
"env": {
"CSV_DIR": "/path/to/data"
}
}
}
}For Docker (HTTP):
{
"mcpServers": {
"csv-mcp": {
"url": "http://localhost:8000/mcp"
}
}
}Usage Examples
Once connected, ask your AI assistant questions like:
"List all available CSV files"
"Show the schema of processes.csv"
"Find all rows where status equals 'active' in processes.csv"
The ask_csv_question tool accepts Polars filter expressions:
Expression | Description |
| Filter by exact match |
| Filter by numeric comparison |
| Filter by substring match |
Testing
# Run all tests
python -m pytest tests/ -v
# Run with coverage
COVERAGE_FILE=/tmp/.coverage python -m pytest tests/ --cov=server --cov-report=term-missingSecurity
Path traversal protection: All file paths are resolved and validated to stay within
CSV_DIRExpression sanitization: Filter expressions are checked against dangerous patterns (
import,exec,eval, etc.) before evaluation
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask questions about a CSV in plain English and get answers, charts and cleaned data back.
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.
Every spreadsheet is a table: Excel, CSV, Parquet and JSON as SQL tables for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables conversational analysis of CSV and Parquet files through natural language, providing statistics, summaries, data type information, and comprehensive multi-step data analysis.-
- 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-
- AlicenseNot gradedqualityDmaintenanceEnables querying Excel and CSV files using SQL via natural language, allowing AI assistants to analyze data without manual SQL writing.1MIT
- AlicenseNot gradedqualityBmaintenanceQuery local CSV, Parquet, JSON and TSV files with real SQL via DuckDB. Gives your AI coding tool ground-truth data access instead of hallucinated answers.5MIT