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 read the sales data from /home/user/data/sales.csv and show me the first 5 rows"
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
A Model Context Protocol (MCP) server for comprehensive CSV file management using stdio transport exclusively. This server provides tools for creating, editing, analyzing, and managing CSV files using the MCP protocol over standard input/output.
Features
File Management: Create, read, update, and delete CSV files
Absolute Path Support: Work with CSV files anywhere in the filesystem using absolute paths
Data Analysis: Basic statistical analysis and data exploration
Data Transformation: Filter, sort, group, and transform data
Data Validation: Check data integrity and format validation
Import/Export: Support for various CSV formats and encodings
Stdio Transport: Uses JSON-RPC 2.0 over standard input/output for communication
Related MCP server: CSV Editor
Installation
uv add csv-mcp-serverUsage
Running the Server
# Using stdio transport (default and only option)
uv run csv-mcp-server
# With custom log level
uv run csv-mcp-server --log-level DEBUG
# Development mode
uv run mcp dev csv_mcp_server/server.pyAvailable Tools
create_csv: Create a new CSV file with headers and initial datacreate_csv_at_path: Create a CSV file at a specific absolute or relative pathread_csv: Read and display CSV file contentsupdate_csv: Update specific cells or rows in a CSV filedelete_csv: Delete a CSV fileadd_row: Add new rows to an existing CSV fileremove_row: Remove specific rows from a CSV fileget_info: Get basic information about a CSV fileget_statistics: Get statistical summary of numeric columnsfilter_data: Filter CSV data based on conditionssort_data: Sort CSV data by specified columnsgroup_data: Group and aggregate CSV datavalidate_data: Validate CSV data integrity and formatget_path_info: Get detailed information about a file path (supports absolute paths)
Available Resources
csv://{filename}: Access CSV file contents as a resourcecsv-info://{filename}: Get metadata about a CSV file
Available Prompts
analyze_csv: Generate analysis prompts for CSV datatransform_csv: Generate transformation suggestions
Configuration
The server can be configured with environment variables:
CSV_STORAGE_PATH: Base path for CSV file storage (default: current directory)CSV_MAX_FILE_SIZE: Maximum file size in MB (default: 50)CSV_BACKUP_ENABLED: Enable automatic backups (default: true)CSV_SUPPORT_ABSOLUTE_PATHS: Enable absolute path support (default: true)
Absolute Path Support
The CSV MCP server now supports working with CSV files anywhere in the filesystem using absolute paths. This feature allows you to:
Create CSV files in any accessible directory
Read and modify existing CSV files from anywhere on the system
Work with files outside the default storage directory
Maintain backward compatibility with relative paths
Security Features
Path Validation: Automatically validates absolute paths for safety
System Directory Protection: Prevents access to critical system directories
Permission Checking: Verifies directory and file access permissions
Symlink Resolution: Safely resolves symbolic links to prevent path traversal attacks
Usage Examples
# Create a CSV file at an absolute path
create_csv_at_path(
filepath="/path/to/your/data/sales.csv",
headers=["Date", "Product", "Sales"],
data=[["2024-01-01", "Laptop", 1200]]
)
# Get information about any file path
get_path_info(filepath="/path/to/your/file.csv")
# All existing tools work with absolute paths
read_csv("/path/to/your/data/analysis.csv")
update_csv("/path/to/your/data/analysis.csv", row_index=0, column="Sales", value=1500)Transport
This server exclusively uses stdio transport with JSON-RPC 2.0 protocol, making it ideal for:
Integration with MCP clients that support stdio transport
Command-line tools and scripts
Development and testing environments
Containerized deployments
Examples
See the examples/ directory for usage examples with various MCP clients:
demo_client.py: Basic MCP client demonstrationsales_analysis.py: Sales data analysis exampleabsolute_path_demo.py: Demonstration of absolute path functionality
Available Tools
15 toolsadd_rowC
Add a new row to the CSV file.
Args:
filename: Name of the CSV file
row_data: Dictionary mapping column names to values
Returns:
Dictionary with addition results
Inputs: filename (required), row_data (required). Returns: result
create_csvB
Create a new CSV file with headers and optional initial data.
Args:
filename: Name of the CSV file to create (without .csv extension)
headers: List of column headers
data: Optional list of rows, where each row is a list of values
Returns:
Dictionary with creation results and file information
Inputs: filename (required), headers (required), data. Returns: result
create_csv_at_pathB
Create a new CSV file at a specific path (absolute or relative).
Args:
filepath: Full path where the CSV file should be created
headers: List of column headers
data: Optional list of rows, where each row is a list of values
Returns:
Dictionary with creation results and file information
Inputs: filepath (required), headers (required), data. Returns: result
delete_csvB
Delete a CSV file (with backup if enabled).
Args:
filename: Name of the CSV file to delete
Returns:
Dictionary with deletion results
Inputs: filename (required). Returns: result
filter_dataB
Filter CSV data based on conditions.
Args:
filename: Name of the CSV file
conditions: Dictionary of column conditions.
Simple: {"column": "value"}
Complex: {"column": {"gt": 5, "lt": 10, "contains": "text"}}
limit: Optional limit on number of rows to return
Returns:
Dictionary with filtered data
Inputs: filename (required), conditions (required), limit. Returns: result
get_infoB
Get basic information about a CSV file.
Args:
filename: Name of the CSV file
Returns:
Dictionary with file metadata and structure information
Inputs: filename (required). Returns: result
get_path_infoA
Get detailed information about a file path, supporting both relative and absolute paths.
Args:
filepath: The file path to analyze (can be relative or absolute)
Returns:
Dictionary with comprehensive path information including:
- Whether the path is absolute or relative
- Resolved path (following symlinks)
- Parent directory information
- File existence and accessibility
- Safety validation for absolute paths
Inputs: filepath (required). Returns: result
get_statisticsC
Get statistical summary of numeric columns in the CSV file.
Args:
filename: Name of the CSV file
Returns:
Dictionary with statistical analysis of numeric columns
Inputs: filename (required). Returns: result
group_dataA
Group and aggregate CSV data.
Args:
filename: Name of the CSV file
group_by: Column name or list of column names to group by
aggregations: Dictionary mapping column names to aggregation functions
(sum, mean, count, min, max, std, etc.)
Returns:
Dictionary with grouped and aggregated data
Inputs: filename (required), group_by (required), aggregations (required). Returns: result
list_csv_filesB
List all CSV files in the storage directory.
Returns:
Dictionary with list of CSV files and their metadata
Inputs: no named parameters. Returns: result
read_csvB
Read and return CSV file contents.
Args:
filename: Name of the CSV file to read
limit: Optional limit on number of rows to return
Returns:
Dictionary with file contents and metadata
Inputs: filename (required), limit. Returns: result
remove_rowB
Remove a specific row from the CSV file.
Args:
filename: Name of the CSV file
row_index: Zero-based index of the row to remove
Returns:
Dictionary with removal results
Inputs: filename (required), row_index (required). Returns: result
sort_dataB
Sort CSV data by specified columns.
Args:
filename: Name of the CSV file
columns: Column name or list of column names to sort by
ascending: Whether to sort in ascending order
limit: Optional limit on number of rows to return
Returns:
Dictionary with sorted data
Inputs: filename (required), columns (required), ascending, limit. Returns: result
update_csvB
Update a specific cell in the CSV file.
Args:
filename: Name of the CSV file to update
row_index: Zero-based index of the row to update
column: Name of the column to update
value: New value for the cell
Returns:
Dictionary with update results
Inputs: filename (required), row_index (required), column (required), value (required). Returns: result
validate_dataB
Validate CSV data integrity and format.
Args:
filename: Name of the CSV file
Returns:
Dictionary with validation results, issues, and warnings
Inputs: filename (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools have distinct purposes focused on different CSV operations like creation, reading, filtering, and updating. However, create_csv and create_csv_at_path have overlapping functionality that could cause confusion, as both create CSV files with only a minor path specification difference. The other tools are clearly differentiated by their specific actions on CSV data.
All tools follow a consistent snake_case naming convention with clear verb_noun patterns. The naming is predictable throughout, using verbs like create, read, update, delete, filter, sort, and validate paired with appropriate nouns like csv, data, row, or statistics. There are no deviations in naming style across the toolset.
With 15 tools, this server provides comprehensive coverage for CSV operations without being overwhelming. The count is well-suited for the domain, offering a complete set of operations including file management, data manipulation, analysis, and validation. Each tool serves a distinct purpose that contributes to the overall CSV processing capability.
The toolset provides complete coverage for CSV operations including full CRUD lifecycle (create, read, update, delete), data manipulation (filter, sort, group), analysis (statistics, validation), and file management (list, info, path info). There are no obvious gaps in functionality for working with CSV files, and the tools support both basic operations and advanced data processing workflows.
Maintenance
Related MCP Connectors
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Dedupe, compare, merge, split and profile CSV or TSV files that are too big to paste into a chat.
Validate and clean CSV before import. Find duplicates, missing values and invalid dates with row-level reports. Apply only the cleanup you request; files are not retained. Run view_csv_demo free without a key. Custom CSV: EUR 9 for 100 operations, valid 90 days, no subscription. Setup: https://check.orvel.dev/docs/
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to preprocess, analyze, and visualize CSV data through comprehensive tools for data manipulation, statistical analysis, and graph generation.3-
- AlicenseBqualityDmaintenanceComprehensive CSV processing MCP server with 40+ operations for data manipulation, analysis, and validation. Features auto-save, undo/redo, and handles GB+ files3925MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server for exploring and analyzing CSV files, providing tools for inspection, sampling, schema inference, statistics, filtering, and more.12MIT
- FlicenseCqualityDmaintenanceA stdio MCP server for safely reading, analyzing, validating, and transforming CSV/TSV files, with sandboxed file system access and configurable parsing options.14-