Skip to main content

MCP Client Integration

Overview

Databend MCP connects AI assistants to Databend via Model Context Protocol. Works with Claude Code, Codex, Cursor, Claude Desktop, VS Code, and other MCP-compatible clients.

What you can do:

  • Generate complex SQL queries based on your requirements
  • Create and manage scheduled data pipeline tasks
  • Explore database schemas and validate query syntax
  • Build ETL workflows with COPY, MERGE, and Stage operations

For example: "Create a scheduled task that copies parquet files from @my_stage to the orders table every minute, and verify it's running correctly."

Installation

1. Get Databend Connection

We recommend using Databend Cloud for the best experience.

  1. Log in to Databend Cloud.
  2. Click Connect in the navigation bar.
  3. Select regular connection information (Host, User, Password, etc.).
  4. Copy your DSN, which looks like: databend://user:pwd@host:443/database?warehouse=warehouse_name

2. Configure Your MCP Client

codex mcp add databend -- -e DATABEND_DSN="databend://user:password@host:port/database?warehouse=your_warehouse" -e SAFE_MODE=false -- uv tool run mcp-databend

Or add to ~/.codex/config.toml:

[mcp_servers.databend]
command = "uv"
args = ["tool", "run", "mcp-databend"]

[mcp_servers.databend.env]
DATABEND_DSN = "databend://user:password@host:port/database?warehouse=your_warehouse"
SAFE_MODE = "false"

Available Tools

Database Operations

ToolDescription
execute_sqlExecute SQL queries with timeout protection
show_databasesList all databases
show_tablesList tables in a database (with optional filter)
describe_tableGet table schema information

Stage Management

ToolDescription
show_stagesList all available stages
list_stage_filesList files in a specific stage
create_stageCreate a new stage with connection support

Connection Management

ToolDescription
show_connectionsList all available connections

Configuration

VariableDescriptionDefault
DATABEND_DSNConnection stringRequired
SAFE_MODEBlock dangerous SQL operations (DROP, DELETE, etc.)true
DATABEND_QUERY_TIMEOUTQuery timeout in seconds300

For more details on building conversational BI tools, see MCP Server Guide.

Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today