query_sqlLABSCO SUMMARY
Query answers and CrateDB's own documentation in the same session.
The documentation tools are why the SQL comes out right: a timestamp format or a primary-key optimisation gets looked up rather than guessed. The write block is doubled — CrateDB's own advice is a user created with GRANT DQL, and the server refuses non-SELECT statements on top of that unless you deliberately turn the guard off.
What it is
CrateDB's own server for its clusters. Six tools split three ways: SQL against the cluster, lookups against the CrateDB documentation, and one cluster-health read.
What you get
- A SQL statement run against the cluster — query_sql
- A table's columns and its metadata — get_table_columns, get_table_metadata
- The CrateDB documentation index, and one topic fetched from it — get_cratedb_documentation_index, fetch_cratedb_docs
- Cluster health derived from CrateDB's system tables — get_cluster_health
- Stdio, sse or http transports, chosen with --transport or CRATEDB_MCP_TRANSPORT
- The system prompt extended with your own conventions, or replaced outright, from a file, a URL or standard input
Requirements
CRATEDB_CLUSTER_URL, the address of your CrateDB: http://localhost:4200/ for one on this machine, or https://<YOUR_USERNAME>:<YOUR_PASSWORD>@<YOUR_CLUSTER_HOST>:4200 for CrateDB Cloud. If your CrateDB needs a login, the username and password go before the host, as in the Cloud form. Install cratedb-mcp with pipx or uv, or run the ghcr.io/crate/cratedb-mcp image. Non-SELECT statements are refused at the application level unless CRATEDB_MCP_PERMIT_ALL_STATEMENTS is set. CRATEDB_MCP_HTTP_TIMEOUT defaults to 30.0 and CRATEDB_MCP_DOCS_CACHE_TTL to 3600.
Setup effort
One command plus your CrateDB's address — uv tool install --upgrade cratedb-mcp, then set CRATEDB_CLUSTER_URL (with a username and password in it if your CrateDB needs a login, as CrateDB Cloud does)
USE CASES
Getting an answer out of a cluster you did not design
Read the table's columns and metadata first, then write the query against what is actually there.
Making a slow query faster
The documentation tools surface CrateDB's own guidance on the pattern you are using, so the rewrite follows the engine rather than general SQL habit.
Checking the cluster before blaming the query
Health comes from CrateDB's system tables, so "is it me or is it the cluster" is one call.
Keeping an agent read-only
Point it at a user created with GRANT DQL and leave the statement guard on; anything that is not a SELECT is refused twice over.
6 tools
Listed in project docs. Your client may show a different list.
get_table_columnsget_table_metadataget_cratedb_documentation_indexfetch_cratedb_docsget_cluster_healthBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
- uvx on PATH
- CRATEDB_CLUSTER_URL in your environment
INSTALLATION
Connect your client
Server setup
uv tool install --upgrade cratedb-mcpMCP Clients
Claude Desktop, Cline, Cursor, Other MCP clients
{
"mcpServers": {
"cratedb-mcp": {
"command": "uvx",
"args": [
"cratedb-mcp",
"serve"
],
"env": {
"CRATEDB_CLUSTER_URL": "http://localhost:4200/",
"CRATEDB_MCP_TRANSPORT": "stdio"
},
"alwaysAllow": [
"get_cluster_health",
"get_table_metadata",
"query_sql",
"get_cratedb_documentation_index",
"fetch_cratedb_docs"
],
"disabled": false
}
}
}http://localhost:4200/ reaches a CrateDB on this machine; for CrateDB Cloud, use your cluster's https:// address. If yours needs a login, as Cloud does, put username:password@ before the host.
VS Code
{
"mcp": {
"servers": {
"cratedb-mcp": {
"command": "uvx",
"args": [
"cratedb-mcp",
"serve"
],
"env": {
"CRATEDB_CLUSTER_URL": "http://localhost:4200/",
"CRATEDB_MCP_TRANSPORT": "stdio"
}
}
}
},
"chat.mcp.enabled": true
}http://localhost:4200/ reaches a CrateDB on this machine; for CrateDB Cloud, use your cluster's https:// address. If yours needs a login, as Cloud does, put username:password@ before the host.
Goose
extensions:
cratedb-mcp:
name: CrateDB MCP
type: stdio
cmd: uvx
args:
- cratedb-mcp
- serve
enabled: true
envs:
CRATEDB_CLUSTER_URL: http://localhost:4200/
CRATEDB_MCP_TRANSPORT: stdio
timeout: 300http://localhost:4200/ reaches a CrateDB on this machine; for CrateDB Cloud, use your cluster's https:// address. If yours needs a login, as Cloud does, put username:password@ before the host.
LibreChat
mcpServers:
cratedb-mcp:
type: stdio
command: uvx
args:
- cratedb-mcp
- serve
env:
CRATEDB_CLUSTER_URL: http://localhost:4200/
CRATEDB_MCP_TRANSPORT: stdiohttp://localhost:4200/ reaches a CrateDB on this machine; for CrateDB Cloud, use your cluster's https:// address. If yours needs a login, as Cloud does, put username:password@ before the host.
Any MCP client — Docker
{
"mcpServers": {
"cratedb-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"CRATEDB_CLUSTER_URL",
"ghcr.io/crate/cratedb-mcp:latest"
],
"env": {
"CRATEDB_CLUSTER_URL": "<YOUR_CRATEDB_URL>:4200/",
"CRATEDB_MCP_TRANSPORT": "stdio"
}
}
}
}<YOUR_CRATEDB_URL> is your cluster's address up to the port, starting with http:// or https://, with user:password@ before the host when the cluster needs a login.
Open WebUI
docker run --rm --name=cratedb-mcpo --network=demo \
-p 8000:8000 \
-e CRATEDB_CLUSTER_URL \
ghcr.io/crate/cratedb-mcpo:latest