drill-mcp
Officialdrill-mcp lets an MCP client run read-only (and narrowly allow-listed write) SQL against Apache Drill and inspect schemas, storage plugins, and cluster/query state.
Run SQL:
run_queryexecutes exactly one SQL statement (parsed via sqlglot's Drill dialect) and returns rows, capped bymax_rows(a caller can lower but not raise the configured limit; truncated results are markedtruncated: true).Explore schemas:
list_schemaslists visible schemas;list_tableslists tables in a schema;describe_tablereturns a table's columns with types and nullability where the plugin reports it.Inspect storage plugins:
list_storage_pluginsshows plugin configurations with secrets always redacted (not configurable off).Check cluster state:
cluster_statusreports Drillbit membership and overall status;list_profileslists recent/running query profiles newest-first;get_profilefetches a full profile by query id.Manage running queries:
cancel_querycancels a running query by its query id.Guarded writes only:
CREATE TABLE AS,CREATE VIEW,DROP TABLE, andDROP VIEWwork only into plugins listed inwritable_plugins;INSERT,UPDATE,DELETE,MERGE,ALTER,USE, andREFRESHare always rejected, andALTER SYSTEM/storage-plugin management is not implemented at all.Fail-closed safety: hidden schemas are refused and also filter
SHOWresult rows;EXPLAINis stripped and re-checked recursively.Backend limits: management tools (
list_storage_plugins,cluster_status,list_profiles,get_profile,cancel_query) require the default REST backend and raiseToolErroron JDBC; JDBC also never returns aquery_idfromrun_query.
Provides tools for interacting with Apache Drill, enabling SQL query execution, schema/table inspection, storage plugin listing, and cluster status monitoring.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@drill-mcpshow me the tables in the cp schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Drill-MCP Server
The official MCP server for Apache Drill.
It lets an MCP client run read-only (and narrowly, explicitly allow-listed
write) SQL against a Drill cluster, and inspect schemas, storage plugins,
and cluster/query state. It does not implement Drill administration
(ALTER SYSTEM, storage-plugin management) — see "Safety model" below.
Install
pip install drill-mcp # REST backend
pip install drill-mcp[jdbc] # adds the JDBC backend (needs a JVM)
pip install drill-mcp[kerberos] # adds SPNEGO auth for the REST backendThe base install has no JVM dependency: the default REST backend talks to
Drill over plain HTTP via httpx. The jdbc extra pulls in
jaydebeapi/JPype1 and is only needed if you select backend: jdbc
(see "Backends" below).
Related MCP server: telemetry-mcp
Quickstart
drill-mcp --url http://localhost:8047
# or
drill-mcp --config /etc/drill-mcp/drill.yamldrill-mcp --help lists every CLI flag.
Register it with an MCP client:
{
"mcpServers": {
"drill": {
"command": "drill-mcp",
"args": ["--config", "/etc/drill-mcp/drill.yaml"]
}
}
}Configuration
Configuration is merged from three sources, each overriding the last:
config file → DRILL_* environment variables → CLI flags.
Because the environment wins over the file, a stale exported
DRILL_PASSWORD silently overrides a password: set in the config file —
unset it if the file is meant to be authoritative.
There is no --user/--password CLI flag and no tool accepts a credential
as an argument; user/password can only be set via the config file or
DRILL_USER/DRILL_PASSWORD.
Every config key, its default, its environment variable, and its CLI flag
are documented in docs/configuration.md.
drill.example.yaml is a complete example file with
every key present.
Tools
Tool | Description |
| Run one SQL statement |
| List visible schemas |
| List tables in a schema |
| Column names, types, and nullability where the plugin reports it |
| Plugin configs, secrets redacted |
| Drillbit membership and status |
| Recent and running queries |
| Full profile for one query id |
| Cancel a running query |
list_storage_plugins, cluster_status, list_profiles, get_profile,
and cancel_query are management tools: they require the REST backend
and raise a clear ToolError on the JDBC backend rather than failing
silently or returning empty data.
Full parameters, return shapes, errors, and per-tool surprises are in
docs/tools.md.
Safety model
Writes are denied by default.
CREATE TABLE AS,CREATE VIEW,DROP TABLE, andDROP VIEWare permitted only into plugins listed inwritable_plugins.INSERT,UPDATE,DELETE,MERGE,ALTER,USE, andREFRESHare always rejected, no matter whatwritable_pluginscontains.ALTER SYSTEMand storage-plugin create/update/delete are not implemented at all. There is no flag, config key, or code path that turns them on — there is nothing for such a tool to call.Exactly one statement per call, checked with a real SQL parser (sqlglot's Drill dialect), not a regex, so a write hidden in a comment, a string literal, or a stacked statement does not slip through. Anything that fails to parse — including a tokenizer failure — is rejected.
EXPLAINrecurses. The guard strips a leadingEXPLAINorEXPLAIN PLAN FORand re-checks the remaining statement against the same allowlist and hidden-schema rules, with bounded recursion depth.hidden_schemasfilters more than schema listings. Beyond refusing queries against a hidden schema, it filters the result rows of everySHOWcommand (not onlySHOW SCHEMAS), because Drill'sSHOWgrammar gives sqlglot no reliable way to identify which spelling lists schemas. This is a deliberate fail-closed trade: a table or file whose name happens to match a hidden-schema prefix is incidentally hidden too. Seedocs/tools.mdfor the full explanation. HidingINFORMATION_SCHEMAdoes not break the metadata tools, which query it internally regardless and simply omit hidden entries from their output.Secrets are always redacted from
list_storage_pluginsoutput. This is not configurable off.Results are capped by
max_rows; a caller may lower the cap for a single call but never raise it above the configured limit. A truncated result is marked"truncated": true.
Deployment
drill-mcp speaks MCP over stdio only. Each MCP client launches its own
server process, and that process serves exactly one client. It is built
for local, single-user use.
Every tool call runs as the Drill identity in the config. The server has no notion of who is calling; whoever can talk to the process gets that user's Drill access.
Policy is per process.
writable_plugins,hidden_schemas, andmax_rowsapply to every call the process handles.cancel_queryaccepts any query id the configured Drill user is permitted to cancel.
To give several people access, run one process per user with that user's
own credentials. Do not put a network proxy in front of the stdio process:
that would share one Drill identity, one policy, and unrestricted
cancel_query with everyone who can reach the proxy.
An HTTP transport is a possible future enhancement. Shipping one safely
needs client authentication, a Drill identity (or impersonation) per
caller, and authorization for cancel_query.
Backends
REST (default,
backend: rest): talks to a Drillbit's HTTP endpoints overhttpx. Works out of the box, no JVM required.JDBC (
backend: jdbc, needs thejdbcextra): usesjaydebeapi/JPype1against Drill's JDBC driver. It exists mainly because Kerberos is materially less painful through the Drill JDBC driver than through Python SPNEGO. It needs a JVM andjdbc_driver_pathpointing atdrill-jdbc-all.jar. Management tools are unavailable on this backend, since Drill's management API is REST-only, andrun_querynever returns aquery_idon this backend.
Wire-level behavior — identifier quoting, INFORMATION_SCHEMA queries, and
the per-plugin-type column-discovery strategy in describe_table — follows
sqlalchemy-drill, the
most complete and maintained reference for talking to Drill from Python.
PyDrill was evaluated and not adopted: it has no form-based login, no
Kerberos support, and its last release was in 2018.
Development
pip install -e ".[dev]"
pytestThe test suite needs no live Drill cluster and no JVM: Drill's wire
protocol is mocked at the transport boundary, so pytest runs anywhere
Python does.
Credits and license
Wire-level behavior follows sqlalchemy-drill.
Licensed under the Apache License, Version 2.0. See NOTICE.
Available Tools
9 toolscancel_queryB
Cancel a running query by its query id.
Inputs: query_id (required). Returns: result
cluster_statusA
Report Drillbit membership and overall cluster status.
Inputs: no named parameters. Returns: object
describe_tableA
List a table's columns with their types and nullability.
Inputs: table (required), schema (required). Returns: result
get_profileA
Fetch the full profile for one query id.
Inputs: query_id (required). Returns: object
list_profilesA
List recent and running query profiles, newest first.
Inputs: limit. Returns: result
list_schemasA
List every schema visible on the cluster.
Inputs: no named parameters. Returns: result
list_storage_pluginsA
List storage plugin configurations, with all secrets redacted.
Inputs: no named parameters. Returns: result
list_tablesB
List the tables in one schema.
Inputs: schema (required). Returns: result
run_queryC
Run a single SQL statement against Drill and return its rows.
Inputs: sql (required), max_rows. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 9 tools
Each tool targets a distinct resource and action: query execution, schema/table listing, table description, storage plugin configs, cluster status, and query profile management. There is no overlap in purpose, so an agent can reliably select the correct tool.
Most tools follow a consistent verb_noun pattern using snake_case (run_query, list_schemas, list_tables, describe_table, list_storage_plugins, list_profiles, get_profile, cancel_query). The only deviation is 'cluster_status', which lacks an explicit verb but remains clear and readable.
With 9 tools, the set is well-scoped for a Drill MCP server. It covers metadata exploration, query execution, cluster health, and query management without unnecessary bloat, fitting comfortably within the ideal 3-15 range.
The server covers the core lifecycle of query interaction: running a query, inspecting profiles, and canceling. It also provides comprehensive metadata browsing via schemas, tables, and columns. Minor gaps exist such as lack of write operations or cross-schema table listing, but these are not critical for typical read-oriented Drill usage.
Maintenance
Related MCP Connectors
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceRead-only MCP server for SQL databases (SQL Server, Postgres, SQLite) with multi-server support and three-layer safety using AST validation and linting.MIT
- AlicenseNot gradedqualityCmaintenanceA read-only MCP server for querying telemetry data from configurable backends. Provides tools to list sources, describe schemas, run bounded queries, and compute aggregates.MIT
- AlicenseAqualityDmaintenanceA lightweight MCP server for exploring Dremio data catalogs. It provides read-only tools for browsing catalogs, querying tables, and previewing data.618 npmMIT
- AlicenseAqualityCmaintenanceProduction-oriented MCP server for Microsoft SQL Server, enabling query execution, database discovery, schema introspection, and metadata inspection via MCP clients.64MIT