About
MCP, the Model Context Protocol, is an open protocol that enables seamless integration between LLM applications and external data sources and tools.
The CrateDB MCP Server provides natural-language Text-to-SQL and documentation retrieval specialized for CrateDB database clusters.
Features
-
Connect AI assistants directly to your CrateDB clusters and the CrateDB knowledge base, enabling seamless interaction through natural language.
-
Serve as a bridge between AI tools and your analytics database, allowing you to analyze data, the cluster state, troubleshoot issues, and perform operations using conversational prompts.
-
Integrate with popular AI assistants and frameworks like Claude, Cline, Cursor, Goose, LibreChat, Roo Code, VS Code, or Windsurf.
Documentation
- Introduction to the Model Context Protocol (MCP).
- CrateDB MCP Server and embedded usage example.
- MCP Community Servers and corresponding example snippets.
Synopsis
Add the following configuration to your AI assistant’s settings to enable the
CrateDB MCP Server.
- Claude:
claude_desktop_config.json
- Cline:
cline_mcp_settings.json
- Cursor:
~/.cursor/mcp.json
or.cursor/mcp.json
- Roo Code:
mcp_settings.json
or.roo/mcp.json
- Windsurf:
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"cratedb-mcp": {
"command": "uvx",
"args": ["cratedb-mcp", "serve"],
"env": {
"CRATEDB_CLUSTER_URL": "http://localhost:4200/",
"CRATEDB_MCP_TRANSPORT": "stdio"
},
"alwaysAllow": [
"get_health",
"get_table_metadata",
"query_sql",
"get_cratedb_documentation_index",
"fetch_cratedb_docs"
],
"disabled": false
}
}
}
Please also refer to the quickstart guide for integration settings with other applications.
Installation
pipx install cratedb-mcp
The setup might deviate when integrating with AI assistants, see above.
Configuration
Configure the CRATEDB_CLUSTER_URL
environment variable to match your CrateDB instance.
For example, when connecting to CrateDB Cloud, use a value like
https://admin:dZ...6LqB@testdrive.eks1.eu-west-1.aws.cratedb.net:4200/
.
When connecting to CrateDB on localhost, use http://localhost:4200/
.
export CRATEDB_CLUSTER_URL="https://example.aks1.westeurope.azure.cratedb.net:4200"
export CRATEDB_CLUSTER_URL="http://localhost:4200/"
Please also refer to the configuration settings to learn about all available options.
Usage
Start MCP server with streamable-http
transport.
cratedb-mcp serve --transport=streamable-http
Please also refer to the invocation instructions to learn about other available transport options.