Csvql logo

Csvql

Read-only SQL queries over local CSV files through MCP, with bounded results and optional path sandboxing.

Install Csvql

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for csvql, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

The csvql MCP server lets agents query local CSV files with read-only SQL without importing data into a database. It runs as a local stdio process, exposes query, schema, and directory-listing tools, and returns bounded results for MCP calls. Use it when data must stay on the host, especially with --root, read-only mounts, or SSH access to an on-prem server. It supports CSV input, SQL aggregation and inner joins, but not full SQL features such as UNION or window functions.

Use cases

  • Query local sales CSVs with SQL
  • Inspect unknown CSV schemas
  • Aggregate large files without importing them
  • Restrict agent access to a data directory
  • Run remote CSV analysis over SSH

Key features

  • Read-only SQL over CSV files
  • MCP tools for queries, schemas, and file listing
  • Bounded results of about 100 rows or 12 KB
  • Optional filesystem sandbox with --root
  • Local execution with no network calls
  • JSONL query auditing

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars30Stargazers on the source repository.
Last commit1d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Csvql works

What the csvql MCP server does

The csvql MCP server gives an MCP client access to CSV files where they already reside. An agent can submit SQL that names files with single-quoted paths, inspect a file's columns and sample rows, or list CSV files in a directory. Queries are read-only: the engine does not provide INSERT, UPDATE, DELETE, or DROP operations, and it does not modify input files.

The server is suited to local or on-premise data analysis when uploading a file or maintaining a database connection is undesirable. It can run beside the files on a workstation or server, and an MCP client can invoke it through SSH so that only the SQL request and small result travel across the connection.

How it works

Run the executable with --mcp and register it as a stdio MCP server. The available tools are:

  • csv_query(sql), which returns query results as JSON.
  • csv_schema(file), which reports column names and several sample rows.
  • csv_list(directory?), which lists CSV files in a directory.

MCP query responses are limited to about 100 rows or 12 KB per call. This keeps large scans from directly flooding the agent context, although the SQL still runs against the source file. The process makes no network calls according to the project documentation, and the executable is distributed as a static Zig binary.

Use --root /data to restrict file access to a directory. Paths outside that root, including traversal attempts, fail. For remote or shared use, the project recommends combining the root restriction with an unprivileged operating-system user and a read-only mount.

Setup and configuration

Install with Homebrew, download a platform binary from GitHub Releases, build from source with Zig 0.15.2, or install the related Python and Node.js libraries. For MCP use, the built-in csvql install command registers the server with Claude Code and Claude Desktop when the relevant configuration is available. A manual configuration supplies the executable path and arguments such as --mcp and --root.

VS Code Copilot uses the same command and argument values under its servers configuration with a stdio type. Claude Desktop also has a downloadable MCP bundle option. The --audit <file> flag appends one JSONL record for each query. Other relevant options include delimiter selection, output formatting, strict parsing, thread count, schema inspection, and input-header handling.

Tools and capabilities

SQL supports selecting columns, filtering, ordering, limiting, grouping, aggregates, date functions, and inner hash joins between CSV files. A restricted IN (SELECT ...) subquery form is supported. CSV files can be read from disk or standard input using - as the input path. Tab-separated input is possible by changing the delimiter. Command-line output can be CSV, JSON, JSONL, or Markdown; MCP tool results are JSON.

The csvql MCP server processes data in place rather than ingesting it. The documentation reports flat memory use for aggregate queries in its benchmark, including approximately 74 MB on files ranging from 0.7 GB to 8 GB. These figures are project benchmarks, not a guarantee for every query or workload.

Limitations and notes

Input is limited to CSV; JSON and JSONL are output formats, not input formats. SQL does not include UNION, window functions, or left, right, full, or cross joins. Only inner joins are available. Scalar functions in WHERE are limited to DATEDIFF, DATEADD, and EXTRACT; other documented functions may be available in the select list but fail in filters.

Quoted CSV is slower than unquoted input, and MEDIAN buffers every value in a group. Very high-cardinality grouping can also be slower. The result cap prevents a single MCP response from returning an entire large file, so workflows requiring unrestricted exports should use the command-line interface or another data tool.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Csvql

csvql is an MCP server that connects AI agents to local CSV files and provides SQL querying, schema inspection, and CSV directory-listing tools. It runs locally without importing data or making network calls, returns bounded JSON results, and can restrict file access with --root for sandboxed or remote deployments.

Install it with the csvql install command, Homebrew, a GitHub Release binary, or a source build using Zig 0.15.2. The install command registers csvql with Claude Code and Claude Desktop when their configuration is available. You can also add a manual stdio entry using the executable and --mcp.

csvql supports SELECT queries with filtering, ordering, limits, grouping, aggregates, date functions, inner hash joins, and a restricted IN subquery form. It does not support UNION, window functions, or outer and cross joins. Scalar functions in WHERE are limited to DATEDIFF, DATEADD, and EXTRACT.

Pass --root followed by the allowed directory, such as --root /data. File paths outside that directory and traversal attempts fail. For shared or remote deployments, the project also recommends an unprivileged operating-system account and a read-only mount.

Yes. VS Code Copilot can run csvql as a stdio MCP server using the same command and arguments configured under servers in .vscode/mcp.json. Set the command to the csvql executable and include arguments such as --mcp and --root.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCsvql AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/csvql?style=directory)](https://allmcps.com/mcp/csvql)
HTML Embed
<a href="https://allmcps.com/mcp/csvql"><img src="https://allmcps.com/api/badge/csvql?style=directory" alt="Csvql on AllMCPs" /></a>