# Introducing the CrateDB MCP Server

**URL:** <https://community.cratedb.com/t/introducing-the-cratedb-mcp-server/2043>\
**Category:** Integrations\
**Created:** [June 19, 2025, 3:35pm UTC](https://community.cratedb.com/t/introducing-the-cratedb-mcp-server/2043 "2025-06-19T15:35:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![amotl](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/amotl/32/617_2.png) [@amotl](https://community.cratedb.com/u/amotl)\
**Post date:** [June 19, 2025, 3:35pm UTC](https://community.cratedb.com/t/introducing-the-cratedb-mcp-server/2043/1 "2025-06-19T15:35:29Z")

</div>

## About

[MCP](https://modelcontextprotocol.io/), 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.

[https://github.com/crate/cratedb-mcp](https://github.com/crate/cratedb-mcp)

[![image](https://img.shields.io/badge/CrateDB-4.x%20--%206.x-blue.svg)](https://github.com/crate/crate) [![image](https://static.pepy.tech/badge/cratedb-mcp/month)](https://pypi.org/project/cratedb-mcp/) [![Coverage](https://codecov.io/gh/crate/cratedb-mcp/branch/main/graph/badge.svg)](https://app.codecov.io/gh/crate/cratedb-mcp) [![image](https://img.shields.io/pypi/l/cratedb-mcp.svg)](https://github.com/crate/cratedb-mcp/blob/main/LICENSE)

## 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)](https://cratedb.com/docs/guide/integrate/mcp/).
- [CrateDB MCP Server](https://cratedb.com/docs/guide/integrate/mcp/cratedb-mcp.html) and [embedded usage example](https://github.com/crate/cratedb-examples/blob/main/framework/mcp/example_cratedb_mcp.py).
- [MCP Community Servers](https://cratedb.com/docs/guide/integrate/mcp/community.html) and [corresponding example snippets](https://github.com/crate/cratedb-examples/tree/main/framework/mcp).

## Synopsis

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

- Claude: [`claude_desktop_config.json`](https://modelcontextprotocol.io/quickstart/user)
- Cline: [`cline_mcp_settings.json`](https://docs.cline.bot/mcp/configuring-mcp-servers)
- Cursor: [`~/.cursor/mcp.json` or `.cursor/mcp.json`](https://docs.cursor.com/context/model-context-protocol)
- Roo Code: [`mcp_settings.json` or `.roo/mcp.json`](https://docs.roocode.com/features/mcp/using-mcp-in-roo/)
- Windsurf: [`~/.codeium/windsurf/mcp_config.json`](https://docs.windsurf.com/windsurf/cascade/mcp)

```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](https://github.com/crate/cratedb-mcp?tab=readme-ov-file#quickstart-guide) for integration settings with other applications.

## Installation

```shell
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/`.

```shell
export CRATEDB_CLUSTER_URL="https://example.aks1.westeurope.azure.cratedb.net:4200"

```

```shell
export CRATEDB_CLUSTER_URL="http://localhost:4200/"

```

Please also refer to the [configuration settings](https://github.com/crate/cratedb-mcp?tab=readme-ov-file#configure) to learn about all available options.

## Usage

Start MCP server with `streamable-http` transport.

```shell
cratedb-mcp serve --transport=streamable-http

```

Please also refer to the [invocation instructions](https://github.com/crate/cratedb-mcp?tab=readme-ov-file#operate) to learn about other available transport options.

---

_[View the full topic](https://community.cratedb.com/t/introducing-the-cratedb-mcp-server/2043)._
