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
Installation
Usage
Running the Server
Available 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
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
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables comprehensive CSV file management including creating, editing, analyzing, and transforming CSV data anywhere in the filesystem. Provides statistical analysis, data validation, filtering, and grouping capabilities through MCP protocol over stdio transport.
Related MCP Servers
- AsecurityFlicenseAqualityAn MCP server that provides comprehensive Excel file operations, data analysis, and visualization capabilities for working with various spreadsheet formats like XLSX, CSV, and JSON.Last updated -868
- -securityFlicense-qualityEnables users to preprocess, analyze, and visualize CSV data through comprehensive tools for data manipulation, statistical analysis, and graph generation.Last updated -2
- -securityFlicense-qualityAn MCP server that allows LLMs to read, analyze, and interact with Excel files through file operations, data discovery, and comprehensive analysis tools.Last updated -1
- AsecurityAlicenseAqualityComprehensive CSV processing MCP server with 40+ operations for data manipulation, analysis, and validation. Features auto-save, undo/redo, and handles GB+ filesLast updated -395MIT License