DuckLake-MCP
Enables SQL querying and profiling of local SQLite database files as data sources.
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.
DuckLake-MCP: 100% Offline Embedded Analytics & Parquet Lakehouse MCP Server
Architect & Author: Chethan Raj D S (
chethanraj.d.s@gmail.com)
Credentials: IIT Delhi Executive CTO Alumnus · B.E. Electrical & Electronics Engineering (85.60%)
Engineering Focus: High-Performance Vectorized Systems · In-Process Analytics · Embedded Storage Engines · Zero-Trust Architectures
1. Executive Architectural Overview
DuckLake-MCP is an open-source, 100% offline Model Context Protocol (MCP) server powered by in-process DuckDB. It arms AI coding agents (Claude Code, Cursor, Windsurf, GitHub Copilot, Antigravity) with zero-copy vectorized SQL analytics directly over local Parquet, CSV, JSON/NDJSON, and SQLite files.
The Problem It Solves
When developers ask AI coding agents to analyze local log files, data exports, or benchmark results, agents typically:
Blow Up Context Windows: Attempting to read multi-megabyte CSVs or logs directly into prompt context, burning tokens and crashing sessions.
Write Fragile Custom Scripts: Generating unvetted Pandas or Python scripts that fail on dirty schemas or run out of memory.
Depend on Cloud Infrastructure: Requiring developers to upload proprietary data to Snowflake, BigQuery, or run heavy external Postgres containers.
DuckLake-MCP executes vectorized SQL in milliseconds directly on local files with zero server daemons, zero external API keys, and zero cloud egress.
┌─────────────────────────────────────────┐
│ AI Coding Agent (Claude Code/Cursor) │
└────────────────────┬────────────────────┘
│
JSON-RPC 2.0 over Stdio
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ DuckLake MCP Server Engine │
├───────────────────────────────┬─────────────────────────────────────────────┤
│ Vectorized SQL Executor │ Sub-50ms Statistical Profiler │
│ • Direct File-System SQL │ • Null Count & Percentage │
│ • Multi-threaded Engine │ • Distinct Cardinality Audit │
│ • Token-Budgeting Guards │ • Numerical Quartiles (p25, p50, p99) │
│ • In-Memory Lakehouse Views │ • Schema Type Introspection │
└───────────────┬───────────────┴──────────────────────┬──────────────────────┘
│ │
▼ ▼
[ Local Parquet Files ] [ Local CSV / JSON ]
(Columnar Zero-Copy) (Auto-Detected Schemas)Related MCP server: tabulite-mcp
2. Flagship Offline MCP Tools
1. ducklake_query_sql (Vectorized Direct-File SQL)
What it does: Executes high-speed SQL queries directly against local files (
SELECT * FROM 'logs/*.parquet' WHERE status = 500 LIMIT 20;).Token-Budget Protection: Bounds result sets by default (
max_rows=50) and truncates large text cells to protect the agent's context window.
2. ducklake_profile_dataset (Sub-50ms Statistical Intelligence)
What it does: Returns instant dataset intelligence without loading rows into context. Computes row counts, null percentages, distinct values, min/max, and numerical quartiles (p25, median p50, p75, p99) in under 50ms.
3. ducklake_discover_files (Workspace Dataset Scanner)
What it does: Recursively scans directories to discover all analyzable
.parquet,.csv,.json,.ndjson, and.sqlitefiles, returning sizes, formats, and modification timestamps.
4. ducklake_convert_to_parquet (Columnar Optimization Engine)
What it does: Converts large, uncompressed CSV or JSON files into compressed, columnar Parquet files with Snappy/ZSTD compression, achieving 5x-10x storage reduction and 20x query acceleration.
5. ducklake_create_datamart_view (Virtual Lakehouse Views)
What it does: Registers reusable named SQL views over multi-file glob patterns (e.g.,
CREATE VIEW sales AS SELECT * FROM 'data/sales_*.parquet').
3. Installation & IDE Integration
Option A: Cursor IDE (.cursor/mcp.json)
{
"mcpServers": {
"ducklake": {
"command": "python",
"args": ["-m", "ducklake.mcp.server"],
"cwd": "/path/to/target/project"
}
}
}Option B: Claude Code CLI
claude mcp add ducklake -- python -m ducklake.mcp.serverOption C: Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"ducklake": {
"command": "python",
"args": ["-m", "ducklake.mcp.server"],
"cwd": "/absolute/path/to/ducklake-mcp"
}
}
}4. Standalone CLI Usage
DuckLake can also be invoked as a fast command-line data utility:
# Query local files directly
python -m ducklake.cli query "SELECT * FROM 'data/tx.parquet' LIMIT 5;"
# Profile dataset distributions in sub-50ms
python -m ducklake.cli profile data/tx.parquet
# Convert CSV to Parquet
python -m ducklake.cli convert data/export.csv --target data/export.parquet
# Discover queryable files in directory
python -m ducklake.cli discover data/5. Verification & Test Suite
The test suite runs 100% offline with zero external network access:
# Clone the repository
git clone https://github.com/Chethan-Raj-D-S/ducklake-mcp.git
cd ducklake-mcp
# Run full test suite
pytest tests/ -vVerification Results:
tests/test_engine.py::test_query_direct_csv PASSED [ 7%]
tests/test_engine.py::test_query_direct_parquet PASSED [ 15%]
tests/test_engine.py::test_query_token_bounding_truncation PASSED [ 23%]
tests/test_engine.py::test_discover_datasets PASSED [ 30%]
tests/test_engine.py::test_convert_to_parquet PASSED [ 38%]
tests/test_engine.py::test_create_datamart_view PASSED [ 46%]
tests/test_mcp_server.py::test_mcp_initialize PASSED [ 53%]
tests/test_mcp_server.py::test_mcp_tools_list PASSED [ 61%]
tests/test_mcp_server.py::test_mcp_call_query_sql PASSED [ 69%]
tests/test_mcp_server.py::test_mcp_call_profile_dataset PASSED [ 76%]
tests/test_mcp_server.py::test_mcp_call_unknown_tool PASSED [ 84%]
tests/test_profiler.py::test_profile_csv_dataset PASSED [ 92%]
tests/test_profiler.py::test_profile_parquet_dataset PASSED [100%]
============================= 13 passed in 2.70s ==============================6. Directory Structure
ducklake-mcp/
├── pyproject.toml # Modern package spec & dependencies
├── README.md # Architectural documentation
├── SKILL.md # AI Agent instruction specification
├── LICENSE # Apache 2.0 open-source license
├── ducklake/
│ ├── __init__.py # Package exports
│ ├── cli.py # Standalone CLI entrypoint
│ ├── core/
│ │ ├── __init__.py
│ │ ├── engine.py # DuckDB vectorized SQL execution engine
│ │ ├── profiler.py # Sub-50ms dataset statistical profiler
│ │ └── models.py # Pydantic schemas for query results & profiles
│ └── mcp/
│ ├── __init__.py
│ ├── protocol.py # MCP protocol schemas
│ └── server.py # JSON-RPC 2.0 stdio MCP server
└── tests/
├── conftest.py # Mock CSV, Parquet, and JSON fixtures
├── test_engine.py # Vectorized query & conversion tests
├── test_profiler.py # Statistical profiling tests
└── test_mcp_server.py # JSON-RPC stdio protocol tests7. License
Licensed under the Apache License, Version 2.0.
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
The all-in-one data stack for agents. Upload files, run SQL, evolve tables, and render charts.
Messy CSV, JSON, Excel, SPSS/Stata/SAS and PDF tables to typed Parquet; inspect, query, join.
PDF and image tools for AI agents: compress, merge, split, OCR, sign. Runs locally, never uploads.
Every live trading feed is a table: today it serves your CSV, Parquet and JSON files to AI agents as SQL tables (Apache DataFusion), with joins across files, schema and column statistics. Open source: github.com/yarenty/tableski
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceQuery local CSV, Parquet, JSON and TSV files with real SQL via DuckDB. Gives your AI coding tool ground-truth data access instead of hallucinated answers.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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
- 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
- AlicenseNot gradedqualityBmaintenanceEvery live trading feed is a table: today it serves your CSV, Parquet and JSON files to AI agents as SQL tables (Apache DataFusion), with joins across files, schema and column statistics.1Apache 2.0