mcp-tabular
Enables SQL querying over CSV and Excel files using DuckDB, providing tools to load files, inspect schemas, and run read-only queries via MCP.
README
mcp-tabular
An MCP server that gives any LLM agent SQL over CSV and Excel files. DuckDB-powered, read-only, zero configuration.
Why
Embedding spreadsheets into a vector store gives agents mushy answers; tables chunk badly. The pattern that works in production is SQL-over-file: load the table into an analytical engine and let the agent query it. mcp-tabular packages that pattern as a standard MCP server, so it works with Claude Desktop, Claude Code, or any MCP client.
Agent ──MCP──▶ mcp-tabular ──▶ DuckDB (in-memory, read-only)
tools: load_file · list_tables · describe_table · query · sample_rows
Install & run
pip install -e .
mcp-tabular # stdio transport
Claude Desktop config:
{
"mcpServers": {
"tabular": { "command": "mcp-tabular" }
}
}
Tools
| Tool | Description |
|---|---|
load_file(path, table_name?) |
Load a CSV/XLSX file into an in-memory table. Returns schema + row count. |
list_tables() |
Tables currently loaded. |
describe_table(table) |
Columns, types, null counts, min/max — enough for the agent to write correct SQL. |
query(sql) |
Read-only SELECT. Results capped and returned as markdown. |
sample_rows(table, n) |
Quick peek at representative rows. |
Safety
- Read-only: statements other than
SELECT/WITHare rejected before execution. - Path allow-listing: set
MCP_TABULAR_ROOTto restrict which directory files may be loaded from. - Bounded output: result sets are truncated (default 200 rows) so a bad query can't blow up the agent's context window.
Example session
> load_file("sales_q3.csv")
loaded table 'sales_q3' (8,412 rows). Columns: region VARCHAR, sku VARCHAR, units BIGINT, revenue DOUBLE
> query("SELECT region, SUM(revenue) r FROM sales_q3 GROUP BY 1 ORDER BY r DESC LIMIT 3")
| region | r |
|--------|----------|
| South | 412,050 |
| West | 371,200 |
| East | 298,700 |
Design notes
Built after shipping enterprise agents where tabular Q&A over uploaded files was the highest-volume use case. Schema + sample injection (via describe_table/sample_rows) is what makes agents write correct SQL on the first try.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.