Start in one line
uvx datapilot-mcp serve --database /path/to/your.sqlite3
Or add it to Claude Code:
claude mcp add datapilot -- uvx datapilot-mcp serve --database /absolute/path/to/your.db
It connects, discovers your schema, and generates tools shaped around your actual tables. Nothing else to configure.
Why this one
Most database MCP servers hand the model your connection and hope the prompt holds. DataPilot assumes the opposite: that a model will eventually be talked into trying something, by a confused user or by text sitting in your own data.
It cannot write to your database. Not as a promise - as three independent layers:
-
The connection is read-only.
SQLite is opened with
mode=ro, so the file handle itself refuses writes. PostgreSQL getsdefault_transaction_read_only. This is the layer that holds if the others have a bug. -
The SQL is parsed, not pattern-matched.
sqlglot builds a syntax tree
and the tree is inspected.
SELECT/**/1; DROP TABLE tandSELECT 'drop table t'are told apart correctly, which a regular expression cannot do. A query that fails to parse is refused rather than guessed at. - Limits are enforced by the database. Row caps, and real timeouts: a runaway query is interrupted mid-execution, not waited on.
What the agent gets
Twelve core tools, plus three generated per table from your live schema.
| Tool | What it is for |
|---|---|
get_database_overview | Scale and shape. Start here. |
describe_relationships | Which tables join to which, from real foreign keys |
list_tables / describe_table | Find and understand a table |
get_table_sample | See what the data actually looks like |
execute_readonly_query | Run SQL, with bound parameters |
profile_table | Statistics and data-quality findings |
explain_sql_policy | Why a query was refused, and how to rewrite it |
refresh_schema | Re-discover after a migration |
Generated per table: query_<table>, sample_<table>,
profile_<table>. Their descriptions carry the real column
list and row count, so the agent knows a table's shape before calling anything:
Query the employees table. Columns: employee_id, full_name,
department_id, manager_id, salary, hired_on, country,
termination_note. About 120 rows. Supports column selection, a
WHERE expression, sorting and a row limit. Read-only.
Generation is capped (40 tables by default) so a warehouse with 2,000 tables
does not bury the client's tool list. Everything else stays reachable through
execute_readonly_query.
Profiling that says something useful
Every statistic is computed by an aggregate query in the database, so profiling a table of fifty million rows does not pull fifty million rows into memory.
{
"table": "employees",
"columns": [
{ "column": "salary", "kind": "numeric", "null_fraction": 0.0333,
"minimum": 45038.5, "maximum": 165869.9,
"mean": 106192.6, "stddev": 21847.3 }
],
"quality_findings": [
{ "severity": "high", "column": "termination_note",
"issue": "mostly null",
"evidence": "116 of the rows are null (96.7%)" }
]
}
Every finding carries the evidence behind it, so the agent can re-derive it instead of taking the verdict on trust.
Verified, not asserted
114 tests
Green on Linux, Windows and macOS for Python 3.12, 3.13 and 3.14.
51 attack cases
An adversarial SQL corpus with no leaks and no false positives.
Verified namespace
Listed as io.github.mqfarooqi1/datapilot-mcp, authenticated by the repository's own OIDC identity.
The suite is organised around the claims this page makes:
- Stacked statements, every DDL/DML form,
SELECT INTO,CREATE TABLE AS, andEXPLAIN ANALYZE DELETE(which executes on PostgreSQL) are all refused - while recursive CTEs, window functions and columns literally nameddeleteandintoare not. - Writes refused,
ATTACHdenied, pragma tampering denied, and the file on disk unchanged afterwards. - Passwords absent from objects, logs, DSNs and error messages.
Two tests exist because testing found real bugs
ATTACH was a genuine escape. A mode=ro
SQLite connection accepted ATTACH DATABASE and then
wrote a new database file to disk. Closed with a SQLite authorizer;
a test now asserts the file is never created.
SELECT * INTO newt FROM t passed validation at first,
because it is a SELECT statement - and on PostgreSQL it creates a
table.
Honest limitations
The multi-agent module is not built yet. Workspaces, task handoffs and shared memory are designed and scheduled, not written.
PostgreSQL is implemented but not integration-tested in CI.
The code path, read-only transaction mode and statement_timeout
are all there, and its tests skip without a live server. SQLite is tested
thoroughly.
Charts and exports are not built yet, and SQLite row counts cost a scan because SQLite keeps no statistics.
See the roadmap for what is shipped, what is next, and what is deliberately not promised.
Documentation
README
Install, configure, and connect it to Claude Code or Cursor.
Security model
The threat model, the three layers, and what is deliberately not promised.
Roadmap
Shipped, next, and never.
Releasing
Tag-driven releases with no stored credentials.