DataLens MCP
Lists SQLite files in the configured data directory for discovery; SQLite querying is not yet supported by the current flat-dataset tools.
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.
DataLens MCP
A lightweight Model Context Protocol (MCP) server for data exploration and quality checks.
DataLens gives AI assistants a practical way to inspect local datasets, understand their structure, identify common data-quality issues, and run read-only analytical SQL — without manually opening a notebook.
Why this project?
Data work often starts with repetitive questions:
What datasets are available?
How many rows and columns does this file contain?
Which columns have missing values?
Are there duplicate records?
Can I quickly aggregate or filter the data?
DataLens exposes these workflows as MCP tools so an MCP-compatible client can call them directly.
Related MCP server: tabulite-mcp
Features
MCP tool | What it does |
| Finds supported files and reports their format and size |
| Returns row count, column names, and inferred types |
| Reports null percentages, distinct counts, and sample values |
| Flags missing values and duplicate-row groups |
| Executes capped, read-only SQL against a selected dataset |
Also includes a small datalens://about resource.
Supported inputs: CSV and Parquet for querying. SQLite files are listed for discovery but are not yet queryable through the current flat-dataset tools.
Quick start
1. Clone and install
git clone https://github.com/YOUR_USERNAME/datalens-mcp.git
cd datalens-mcp
python -m venv .venv
# macOS/Linux
source .venv/bin/activate
# Windows PowerShell
# .venv\Scripts\Activate.ps1
pip install -e ".[dev]"2. Add a dataset
Create a data/ directory and copy a CSV or Parquet file into it:
mkdir data
cp examples/employees.csv data/employees.csvOr point DataLens to another folder:
# macOS/Linux
export DATALENS_DATA_DIR="/absolute/path/to/your/data"
# Windows PowerShell
$env:DATALENS_DATA_DIR = "C:\path\to\your\data"3. Run the MCP server
datalens-mcpThe server uses stdio transport, which is the standard local MCP setup for desktop clients.
Example MCP client configuration
For an MCP client that supports local stdio servers, use a configuration similar to:
{
"mcpServers": {
"datalens": {
"command": "python",
"args": ["-m", "datalens_mcp.server"],
"env": {
"DATALENS_DATA_DIR": "/absolute/path/to/datalens-mcp/data"
}
}
}
}If your client launches the installed console script instead, use datalens-mcp as the command.
Example prompts
Once connected, try asking your assistant:
"What datasets can you access?"
"Profile the employees dataset and explain the columns."
"Find missing values and duplicate records in employees."
"Show average salary by department."
"Which department has the highest average salary?"
Example SQL for run_sql:
SELECT department, ROUND(AVG(salary), 2) AS average_salary
FROM employees
GROUP BY department
ORDER BY average_salary DESCDesign and safety notes
SQL is restricted to a single
SELECTorWITHstatement.Mutating and administrative SQL keywords are rejected.
Query results are capped (maximum 500 rows).
Dataset names and column identifiers are validated before being interpolated into SQL.
Only files directly inside the configured data directory are discovered.
Treat datasets as trusted local inputs. This is a developer utility, not a hardened multi-tenant data service.
The SQL guard is a useful safety layer, not a substitute for operating-system sandboxing. Do not expose this local server to untrusted users or place sensitive files in its data directory.
Run tests
pytestRoadmap
SQLite table discovery and querying
Parquet partition and large-file profiling optimizations
Configurable quality rules (uniqueness, ranges, regex, freshness)
Exportable Markdown/JSON profiling reports
Optional semantic descriptions for columns
More granular per-dataset access controls
Tech stack
Python
Model Context Protocol (MCP) Python SDK
DuckDB
Author
Alaina Rahim
MSc Advanced Computer Science (Artificial Intelligence), University of Leeds
If you build on DataLens, feel free to open an issue or submit a pull request.
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
Messy CSV, JSON, Excel, SPSS/Stata/SAS and PDF tables to typed Parquet; inspect, query, join.
Company and industrial data for AI assistants: datasets, SQL, dashboards, alarms, with approvals.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Related MCP Servers
- 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 gradedqualityBmaintenanceEnables AI assistants to analyze large CSV files locally by importing them into SQLite, profiling columns, and running read-only SQL queries without data leaving the machine.MIT
- AlicenseAqualityCmaintenanceEnables read-only analytical access to local CSV, Parquet, JSON files or a DuckDB database through MCP, with table discovery, column profiling, guarded SQL querying, and explain plans for safe use with Claude Desktop and Claude Code.81MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to explore and analyse local CSV, Parquet or JSON files through validated read-only SELECT queries, with schema discovery, profiling and query-plan tools. Results are capped, timed, PII-masked and audit-logged inside a locked DuckDB sandbox that cannot write, reach the network or read other files.MIT