Introducing the CrateDB MCP Server

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.

image image Coverage image

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

Synopsis

Add the following configuration to your AI assistant’s settings to enable the
CrateDB MCP Server.

{
  "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.

2 Likes

Kudos for starting this project the other day go to @surister, many thanks!

@hammerhead in turn started using the cratedb-mcp package right away within a Jupyter Notebook, accompanied by language models served by Amazon Bedrock, thanks!

:construction: Timeseries QA with agentic LLMs & manuals (patch) :construction: