MCP server for VisiData - a terminal spreadsheet multitool for discovering and arranging tabular data
Project description
VisiData MCP Server
A Model Context Protocol (MCP) server that provides access to VisiData functionality. VisiData is a terminal spreadsheet multitool for discovering and arranging tabular data.
Features
This MCP server exposes VisiData's powerful data manipulation capabilities through the following tools:
🔧 Tools
load_data- Load and inspect data files from various formatsget_data_sample- Get a preview of your data with configurable row countanalyze_data- Perform comprehensive data analysis with column types and statisticsconvert_data- Convert between different data formats (CSV ↔ JSON ↔ Excel, etc.)filter_data- Filter data based on conditions (equals, contains, greater/less than)get_column_stats- Get detailed statistics for specific columnssort_data- Sort data by any column in ascending or descending orderget_supported_formats- List all supported file formats
📚 Resources
visidata://help- Comprehensive help documentation and usage examples
🎯 Prompts
analyze_dataset_prompt- Generate structured prompts for comprehensive dataset analysis
Supported Data Formats
VisiData supports a wide variety of data formats:
- Spreadsheets: CSV, TSV, Excel (XLSX/XLS)
- Structured Data: JSON, JSONL, XML, YAML
- Databases: SQLite
- Scientific: HDF5, Parquet, Arrow
- Archives: ZIP, TAR, GZ, BZ2, XZ
- Web: HTML tables
- Python: Pickle files
Installation
🚀 Quick Install (Recommended)
The easiest way to install visidata-mcp is via npm. This automatically handles Python dependencies and setup:
npm install -g @moeloubani/visidata-mcp@beta
Prerequisites: Python 3.10+ (the installer will check and guide you if needed)
That's it! The npm package automatically:
- ✅ Checks for Python 3.10+
- ✅ Installs the Python package and all dependencies
- ✅ Creates a global
visidata-mcpcommand - ✅ Works with both Claude Desktop and Cursor
Alternative: Python-only Install
Install from PyPI
pip install visidata-mcp
Install from Source
git clone https://github.com/moeloubani/visidata-mcp.git
cd visidata-mcp
pip install -e .
Usage
With Claude Desktop (npm install)
After installing via npm, simply add this to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"visidata": {
"command": "visidata-mcp"
}
}
}
With Cursor AI (npm install)
Create .cursor/mcp.json in your project:
{
"mcpServers": {
"visidata": {
"command": "visidata-mcp"
}
}
}
Restart your AI application and you're ready to go! 🎉
Legacy Configuration (Python-only install)
Click to expand legacy configuration instructions
With Cursor AI
-
Navigate to your project directory and ensure the virtual environment is activated:
cd /path/to/your/visidata-mcp source venv/bin/activate
-
Create/Edit Cursor MCP configuration at
.cursor/mcp.jsonin your project:{ "mcpServers": { "visidata": { "command": "/path/to/your/visidata-mcp/venv/bin/python", "args": ["-m", "visidata_mcp.server"], "cwd": "/path/to/your/visidata-mcp" } } }
⚠️ Important: Use the full path to your virtual environment's Python executable. This ensures Cursor uses the correct Python interpreter with all dependencies installed.
-
Restart Cursor completely (Cmd+Q and reopen)
-
Start using VisiData tools in your AI chat! Look for "Available MCP Tools" in the chat interface.
With Claude Desktop
Add the server to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"visidata": {
"command": "visidata-mcp"
}
}
}
Direct Execution
# Run the server directly
visidata-mcp
# Or with Python module
python -m visidata_mcp.server
Development Mode
# Using MCP Inspector for debugging
npx @modelcontextprotocol/inspector visidata-mcp
Example Usage
Loading and Analyzing Data
# Load a CSV file
load_data("/path/to/sales_data.csv")
# Get a sample of the first 5 rows
get_data_sample("/path/to/sales_data.csv", 5)
# Perform comprehensive analysis
analyze_data("/path/to/sales_data.csv")
# Get statistics for a specific column
get_column_stats("/path/to/sales_data.csv", "revenue")
Data Transformation
# Convert CSV to JSON
convert_data("/path/to/data.csv", "/path/to/output.json")
# Filter data
filter_data("/path/to/sales_data.csv", "revenue", "greater_than", "1000", "/path/to/high_revenue.csv")
# Sort data by column
sort_data("/path/to/sales_data.csv", "date", False, "/path/to/sorted_data.csv")
Getting Help
# Access the help resource
# This will provide comprehensive documentation and examples
Troubleshooting
Common Issues
"0 tools available" in Cursor
- Solution: Ensure you're using the full path to your virtual environment's Python in the MCP configuration
- Example: Use
/path/to/visidata-mcp/venv/bin/pythoninstead of justpython - Restart Cursor completely after changing the configuration
VisiData Warning Messages
You may see warnings like:
setting unknown option confirm_overwrite
These warnings are harmless and don't affect functionality. They occur because the MCP server sets VisiData options that may not be recognized in all versions.
Server Not Starting
- Verify your virtual environment has all dependencies:
pip list | grep visidata - Check that Python 3.8+ is being used:
python --version - Try running the server directly:
python -m visidata_mcp.server
Permission Errors
- Ensure the virtual environment Python executable is accessible
- Check file permissions on your project directory
- Try running with
python -m visidata_mcp.serverto test manually
Testing Your Installation
Run the comprehensive verification script to check your entire setup:
cd /path/to/visidata-mcp
source venv/bin/activate
python verify_setup.py
This script will check:
- Python version and virtual environment
- Package installations
- MCP server tools registration (should show 8 tools)
- Configuration files
- Server startup capability
For just testing tools registration:
python test_tools.py
API Reference
Tools
load_data(file_path: str, file_type: Optional[str] = None) -> str
Load and inspect a data file.
Parameters:
file_path: Path to the data filefile_type: Optional file type hint (csv, json, xlsx, etc.)
Returns: JSON string with file information (rows, columns, column names, types)
get_data_sample(file_path: str, rows: int = 10) -> str
Get a sample of data from the file.
Parameters:
file_path: Path to the data filerows: Number of rows to return (default: 10)
Returns: JSON string with sample data and metadata
analyze_data(file_path: str) -> str
Perform comprehensive data analysis.
Parameters:
file_path: Path to the data file
Returns: JSON string with detailed analysis including column types and sample values
convert_data(input_path: str, output_path: str, output_format: Optional[str] = None) -> str
Convert data between formats.
Parameters:
input_path: Path to input fileoutput_path: Path for output fileoutput_format: Target format (inferred from extension if not provided)
Returns: Success message or error details
filter_data(file_path: str, column: str, condition: str, value: str, output_path: Optional[str] = None) -> str
Filter data based on conditions.
Parameters:
file_path: Path to the data filecolumn: Column name to filter oncondition: Filter condition (equals,contains,greater_than,less_than)value: Value to filter byoutput_path: Optional path to save filtered data
Returns: JSON string with filtering results
get_column_stats(file_path: str, column: str) -> str
Get statistics for a specific column.
Parameters:
file_path: Path to the data filecolumn: Column name to analyze
Returns: JSON string with column statistics
sort_data(file_path: str, column: str, descending: bool = False, output_path: Optional[str] = None) -> str
Sort data by a column.
Parameters:
file_path: Path to the data filecolumn: Column name to sort bydescending: Sort in descending order (default: False)output_path: Optional path to save sorted data
Returns: JSON string with sorting results
get_supported_formats() -> str
Get list of supported file formats.
Returns: JSON string with supported formats and descriptions
Error Handling
The server includes comprehensive error handling:
- File Access Errors: Clear messages when files cannot be read
- Format Errors: Helpful messages for unsupported or corrupted files
- Processing Errors: Detailed error information with stack traces for debugging
- Validation Errors: Clear messages for invalid parameters or conditions
Performance Considerations
- Large Files: The server handles large datasets efficiently through VisiData's streaming capabilities
- Memory Usage: VisiData uses lazy loading and efficient data structures
- Batch Operations: Operations are optimized for batch processing
Development
Project Structure
visidata-mcp/
├── src/
│ └── visidata_mcp/
│ ├── __init__.py
│ └── server.py
├── pyproject.toml
├── README.md
└── requirements.txt
Building and Testing
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Build package
python -m build
# Run with debugging
python -m visidata_mcp.server
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
About VisiData
VisiData is an interactive multitool for tabular data. It combines the clarity of a spreadsheet, the efficiency of the terminal, and the power of Python, into a lightweight utility that can handle millions of rows with ease.
Key VisiData features exposed through this MCP server:
- Universal Data Loader: Open data from any format or source
- Efficient Processing: Handle large datasets with streaming and lazy evaluation
- Rich Type System: Automatic type detection and conversion
- Powerful Filtering: Complex filtering and selection capabilities
- Format Conversion: Convert between dozens of data formats
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
Support
For issues and questions:
- VisiData Issues: Related to data processing functionality
- MCP Issues: Related to the Model Context Protocol integration
- General Issues: Use the GitHub issue tracker
Changelog
Version 0.1.0
- Initial release
- Core VisiData functionality exposed through MCP
- Support for major data formats
- Comprehensive data analysis tools
- Format conversion capabilities
- Data filtering and sorting
- Column statistics and analysis
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file visidata_mcp-0.1.2.tar.gz.
File metadata
- Download URL: visidata_mcp-0.1.2.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3f07c94bbccb769e314cb3955a71af698668a6e6b64deb08f58191c1230fce7
|
|
| MD5 |
dc0fb9becc1a5076cdbcdcbbbfc30797
|
|
| BLAKE2b-256 |
56b0eacdb4ee878241ce68a17bd33b61d1cfba8d40da585eeb26c666e7421e19
|
File details
Details for the file visidata_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: visidata_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f6329364aef880361c8519f3d9c18bff802c50958aa294008b5d6c975238067
|
|
| MD5 |
60cb68ac407da83783e6b71267f9ae34
|
|
| BLAKE2b-256 |
9275957dfeddb0acca233afc8fa6c387b348350a911defaa83cbcf9a7dba266d
|