mcp-csv-database
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., "@mcp-csv-database analyze missing data in the sales table"
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 Database Server
A Model Context Protocol (MCP) server that provides comprehensive tools for loading CSV files into a temporary SQLite database and performing advanced data analysis with AI assistance.
Features
Smart CSV Loading: Automatically detect CSV separators and load multiple files from a folder
Advanced SQL Queries: Execute any SQL query with automatic result formatting and pagination
Schema Inspection: View database schema, table structures, and relationships
Data Quality Analysis: Comprehensive missing data analysis, duplicate detection, and data profiling
Statistical Analysis: Column statistics, data summaries, and distribution analysis
Export Capabilities: Export query results or tables back to CSV with custom formatting
Performance Tools: Create indexes, analyze query execution plans, and optimize performance
AI-Ready: Designed for seamless integration with AI assistants for data analysis workflows
Related MCP server: mcp-server
Installation
From PyPI
pip install mcp-csv-databaseFrom source
git clone https://github.com/Lasitha-Jayawardana/mcp-csv-database.git
cd mcp-csv-database
pip install -e .Usage
Command Line
Start the server with stdio transport:
mcp-csv-databaseRecommended: Auto-load CSV files from a folder using positional argument:
mcp-csv-database /path/to/csv/filesAlternative syntax with explicit flag:
mcp-csv-database --csv-folder /path/to/csv/filesWith custom table prefix:
mcp-csv-database /path/to/csv/files --table-prefix sales_For remote access with HTTP transport:
mcp-csv-database /path/to/csv/files --transport sse --port 8080Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"csv-database": {
"command": "mcp-csv-database",
"args": ["/path/to/your/csv/files"]
}
}
}Alternative configuration with explicit options:
{
"mcpServers": {
"csv-database": {
"command": "mcp-csv-database",
"args": ["--csv-folder", "/path/to/csv/files", "--table-prefix", "analytics_"]
}
}
}Available Tools
Data Loading & Management
load_csv_folder(folder_path, table_prefix="")- Load all CSV files from a folder with smart separator detectionlist_loaded_tables()- List currently loaded tables with source file informationclear_database()- Clear all loaded data and temporary filesbackup_database(backup_path)- Create complete database backups
Data Querying & Schema
execute_sql_query(query, limit=100)- Execute any SQL query with automatic result formattingget_database_schema()- View complete database schema with column types and sample dataget_table_info(table_name)- Get detailed information about specific tablesget_query_plan(query)- Analyze query execution plans for performance optimization
Data Quality & Analysis
get_data_summary(table_name)- Comprehensive data overview with insights and data typesget_column_stats(table_name, column_name)- Detailed statistical analysis for specific columnsanalyze_missing_data(table_name)- Complete missing data analysis across all columnsfind_duplicates(table_name, columns="all")- Advanced duplicate detection with configurable column sets
Performance & Export
create_index(table_name, column_name, index_name="")- Create indexes for query optimizationexport_table_to_csv(table_name, output_path, include_header=True)- Export tables with custom formatting
Examples
Basic Usage
# Load CSV files
result = load_csv_folder("/path/to/csv/files")
# View what's loaded
schema = get_database_schema()
# Query the data
result = execute_sql_query("SELECT * FROM my_table LIMIT 10")
# Export results
export_table_to_csv("my_table", "/path/to/output.csv")Advanced Data Analysis
# Get comprehensive data overview
summary = get_data_summary("sales_data")
# Detailed statistical analysis for specific columns
price_stats = get_column_stats("sales_data", "price")
quantity_stats = get_column_stats("sales_data", "quantity")
# Data quality assessment
missing_analysis = analyze_missing_data("sales_data")
duplicates = find_duplicates("sales_data", "customer_id,product")
# Complex analytical queries
result = execute_sql_query("""
SELECT
category,
COUNT(*) as count,
AVG(price) as avg_price,
SUM(quantity) as total_quantity,
MIN(price) as min_price,
MAX(price) as max_price,
STDDEV(price) as price_stddev
FROM sales_data
GROUP BY category
ORDER BY total_quantity DESC
""")
# Performance optimization
create_index("sales_data", "category")
query_plan = get_query_plan("SELECT * FROM sales_data WHERE category = 'Electronics'")Data Quality Workflow
# Step 1: Load and inspect data
load_csv_folder("/path/to/data")
schema = get_database_schema()
# Step 2: Data quality assessment
missing_data = analyze_missing_data("customers")
duplicates = find_duplicates("customers", "email")
summary = get_data_summary("customers")
# Step 3: Statistical analysis
age_stats = get_column_stats("customers", "age")
income_stats = get_column_stats("customers", "income")
# Step 4: Clean and analyze
clean_data = execute_sql_query("""
SELECT customer_id, name, email, city, age, income
FROM customers
WHERE email IS NOT NULL
AND age BETWEEN 18 AND 100
AND income > 0
""")Transport Options
The server supports multiple transport methods:
stdio(default): Standard input/outputsse: Server-sent eventsstreamable-http: HTTP streaming
# SSE transport
mcp-csv-database --transport sse --port 8080
# HTTP transport
mcp-csv-database --transport streamable-http --port 8080Requirements
Python 3.10+ (required for MCP framework compatibility)
pandas >= 1.3.0
sqlite3 (built-in)
mcp >= 1.0.0
CLI Reference
mcp-csv-database [folder_path] [OPTIONS]
# Positional Arguments:
# folder_path Path to folder containing CSV files (recommended)
# Options:
# --csv-folder PATH Alternative way to specify CSV folder path
# --table-prefix PREFIX Optional prefix for table names (e.g., 'sales_')
# --transport TYPE Transport type: stdio (default), sse, streamable-http
# --port PORT Port for HTTP transport (default: 3000)
# -h, --help Show help message and exit
# Examples:
mcp-csv-database /data/sales # Load CSV files from /data/sales
mcp-csv-database --csv-folder /data --table-prefix t_ # Load with table prefix
mcp-csv-database /data --transport sse --port 8080 # HTTP transport on port 8080Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
v0.1.3 (Latest)
Enhanced CLI interface with positional argument support for CSV folder paths
Improved command-line help with comprehensive examples and tool descriptions
Fixed mypy type checking and added pandas-stubs for better development experience
Resolved GitHub Actions CI/CD pipeline configuration issues
Updated Python requirement to 3.10+ for MCP framework compatibility
v0.1.2
Added comprehensive data analysis tools:
get_data_summary(),get_column_stats(),analyze_missing_data(),find_duplicates()Enhanced statistical analysis capabilities with numeric data detection
Improved data quality assessment and missing data visualization
Added advanced duplicate detection with configurable column sets
Enhanced table information display with better formatting
v0.1.1
Improved CSV separator auto-detection (semicolon, comma, tab)
Enhanced error handling and user feedback
Better table naming with special character handling
Added comprehensive test coverage
Improved documentation and examples
v0.1.0
Initial release
Basic CSV loading and SQL querying
Schema inspection tools
Data export capabilities
Multiple transport support
Available Tools
14 toolsanalyze_missing_dataA
Analyze missing data patterns in a table.
Args: table_name: Name of the table to analyze
Returns: Summary of missing data patterns across all columns
Inputs: table_name (required). Returns: result
backup_databaseB
Create a backup of the current database to a file.
Args: backup_path: Path where to save the backup file
Returns: Status message
Inputs: backup_path (required). Returns: result
clear_databaseC
Clear the temporary database and remove all loaded tables.
Returns: Status message
Inputs: no named parameters. Returns: result
create_indexA
Create an index on a table column for better query performance.
Args: table_name: Name of the table column_name: Name of the column to index index_name: Optional custom index name
Returns: Status message
Inputs: table_name (required), column_name (required), index_name. Returns: result
execute_sql_queryA
Execute any SQL query on the loaded database.
Args: query: Any SQL query to execute (SELECT, INSERT, UPDATE, DELETE, CREATE, etc.) limit: Maximum number of rows to return for SELECT queries (default: 100)
Returns: Query results formatted as XML or execution status
Inputs: query (required), limit. Returns: result
export_table_to_csvB
Export a table to a CSV file.
Args: table_name: Name of the table to export output_path: Path for the output CSV file include_header: Whether to include column headers
Returns: Status message
Inputs: table_name (required), output_path (required), include_header. Returns: result
find_duplicatesA
Find duplicate rows in a table.
Args: table_name: Name of the table to check columns: Comma-separated column names to check for duplicates, or "all" for all columns
Returns: Information about duplicate rows found
Inputs: table_name (required), columns. Returns: result
get_column_statsB
Get statistical summary for a specific column.
Args: table_name: Name of the table column_name: Name of the column to analyze
Returns: Statistical summary including count, nulls, unique values, and distribution info
Inputs: table_name (required), column_name (required). Returns: result
get_database_schemaA
Get the current database schema showing all loaded tables and their structure
Inputs: no named parameters. Returns: result
get_data_summaryC
Get a comprehensive summary of the table data.
Args: table_name: Name of the table to summarize
Returns: Quick overview with key insights about the data
Inputs: table_name (required). Returns: result
get_query_planB
Get the execution plan for a query to understand performance.
Args: query: SQL query to analyze
Returns: Query execution plan
Inputs: query (required). Returns: result
get_table_infoB
Get detailed information about a specific table.
Args: table_name: Name of the table to inspect
Returns: Detailed table information including schema and sample data
Inputs: table_name (required). Returns: result
list_loaded_tablesA
List all currently loaded tables with their source CSV files
Inputs: no named parameters. Returns: result
load_csv_folderA
Load all CSV files from a folder into a temporary SQLite database.
Args: folder_path: Path to folder containing CSV files table_prefix: Optional prefix for table names
Returns: Status message with details of loaded files
Inputs: folder_path (required), table_prefix. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have clearly distinct purposes, but there is some overlap among info tools (get_table_info, get_database_schema, get_data_summary) that could cause confusion if an agent doesn't read descriptions carefully.
All tool names follow a consistent verb_noun pattern (e.g., load_csv_folder, find_duplicates, get_column_stats), making it easy to predict functionality from the name.
14 tools cover the core operations of a CSV database server (loading, querying, analysis, management, export) without being excessive or sparse.
The tool surface covers loading, querying, analysis, schema inspection, indexing, backup, and export. Missing dedicated tools for dropping tables or bulk data modifications, but these can be handled via execute_sql_query.
Maintenance
Related MCP Connectors
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Ask questions about a CSV in plain English and get answers, charts and cleaned data back.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
ParseHub.dev is a hosted document-to-records service with a remote MCP server. Agents can upload a CSV, PDF, or Word file, summarize and analyze CSV data (filter, sort, group_by, and more), read text from PDF and Word files, extract attendees, agenda items, and action items from meeting notes, ask a question about an uploaded document, and store files as database records to list and read later. Each account sees only its own files and records. **Endpoint:** `https://parsehub.dev/mcp` (Streamable HTTP, stateless) **Auth:** API key in the `X-API-Key` header (keys start with `mcp_`), or `Authorization: Bearer <API key or JWT>`. Every request without credentials returns 401. **Plans:** Free (100 API requests/month, 1 document upload), or 5,000 requests/month on the $9/month or $42/year plan. Every MCP request counts toward the allowance. **Tools:** upload_csv, summarize_csv, analyze_csv, upload_document, read_document, extract_meeting_notes, ask_document, database_status, list_database_documents, get_database_document, store_document, extract_stored_meeting_notes, export_database (administrators only). Not affiliated with ParseHub (parsehub.com), the web-scraping tool. ParseHub.dev does not scrape websites. By Poietes LLC. Docs: https://parsehub.dev/guide#connect-via-mcp
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-
- FlicenseNot gradedqualityDmaintenanceEnables AI models to interact with local CSV and Parquet data through MCP tools, providing summarization and analysis capabilities.-
- FlicenseNot gradedqualityDmaintenanceA 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.-
- AlicenseAqualityCmaintenanceEnables AI assistants to analyze CSV files by providing statistical analysis and structural summaries via MCP tools.2MIT