An MCP server for Databend.
Project description
MCP Server for Databend
An MCP server for Databend database interactions.
What You Can Do
Database Operations
- execute_sql - Execute SQL queries with timeout protection and safe mode security
- show_databases - List all databases
- show_tables - List tables in a database (with optional filter)
- describe_table - Get table schema information
Stage Management
- show_stages - List all available Databend stages
- list_stage_files - List files in a specific stage (supports @stage_name format)
- create_stage - Create a new stage with connection support
Connection Management
- show_connections - List all available Databend connections
Security Features
MCP Safe Mode (Enabled by Default)
This server includes built-in security protection that blocks potentially dangerous SQL operations:
- Blocked Operations:
DROP,DELETE,TRUNCATE,ALTER,UPDATE,REVOKE
Safe Mode Configuration:
{
"env": {
"DATABEND_DSN": "your-connection-string-here",
"SAFE_MODE": "true"
}
}
To disable safe mode (not recommended for production):
{
"env": {
"DATABEND_DSN": "your-connection-string-here",
"SAFE_MODE": "false"
}
}
How to Use
Step 1: Get Databend Connection
Recommended: Sign up for Databend Cloud (free tier available)
Get your connection string from Databend documentation.
| Deployment | Connection String Example |
|---|---|
| Databend Cloud | databend://user:pwd@host:443/database?warehouse=wh |
| Self-hosted | databend://user:pwd@localhost:8000/database?sslmode=disable |
Or use local Databend by setting LOCAL_MODE=true, the metadata is stored in .databend directory:
Step 2: Install
uv tool install mcp-databend
Step 3: Configure Your MCP Client
Option A: Claude Code (CLI)
- For Databend server:
claude mcp add mcp-databend --env DATABEND_DSN='your-connection-string-here' -- uv tool run mcp-databend
- For local Databend:
claude mcp add mcp-databend --env LOCAL_MODE=true -- uv tool run mcp-databend
Option B: MCP Configuration (JSON)
Add to your MCP client configuration (e.g., Claude Desktop, Windsurf):
{
"mcpServers": {
"mcp-databend": {
"command": "uv",
"args": ["tool", "run", "mcp-databend"],
"env": {
"DATABEND_DSN": "your-connection-string-here",
"SAFE_MODE": "true"
}
}
}
}
Supported Clients
- Claude Code (CLI)
- Windsurf / Claude Desktop / Continue.dev / Cursor IDE
Options variables
DATABEND_DSN: Databend connection stringLOCAL_MODE: Set totrueto use local DatabendSAFE_MODE: Set tofalseto disable safe modeDATABEND_QUERY_TIMEOUT: Query execution timeout in seconds (default:300)DATABEND_MCP_SERVER_TRANSPORT: Default tostdio, set tohttporsseto enable HTTP/SSE transportDATABEND_MCP_BIND_HOST: Default to127.0.0.1, set to bind host for HTTP/SSE transportDATABEND_MCP_BIND_PORT: Default to8001, set to bind port for HTTP/SSE transport
Step 4: Start Using
Once configured, you can ask your AI assistant to:
Database Operations:
- "Show me all databases"
- "List tables in the sales database"
- "Describe the users table structure"
- "Run this SQL query: SELECT * FROM products LIMIT 10"
Stage Management:
- "Show me all stages"
- "List files in @my_stage"
- "Create a stage named my_s3_stage with URL s3://my-bucket using connection my_connection"
Connection Management:
- "Show all connections"
Development
# Clone and setup
git clone https://github.com/databendlabs/mcp-databend
cd mcp-databend
uv sync
# Run locally
uv run python -m mcp_databend.main
# Use modelcontextprotocol/inspector to debug
npx @modelcontextprotocol/inspector -e LOCAL_MODE=1 uv run python -m mcp_databend.main
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_databend-0.2.2.tar.gz.
File metadata
- Download URL: mcp_databend-0.2.2.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8558eacab362af664bc817372b4950f0468e4b983fa36208ca1a1ca6784ec8c3
|
|
| MD5 |
d36ed1d6d6b08450955514fbde46a1b6
|
|
| BLAKE2b-256 |
fe11d4b7f4dcb9f55700b2610b7455eda0bd9ecd6444e68671d15667ed8ca87b
|
Provenance
The following attestation bundles were made for mcp_databend-0.2.2.tar.gz:
Publisher:
python-publish.yml on databendlabs/mcp-databend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_databend-0.2.2.tar.gz -
Subject digest:
8558eacab362af664bc817372b4950f0468e4b983fa36208ca1a1ca6784ec8c3 - Sigstore transparency entry: 607482772
- Sigstore integration time:
-
Permalink:
databendlabs/mcp-databend@5ac2dc100828b68c0752492967a4653a29dc645c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/databendlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5ac2dc100828b68c0752492967a4653a29dc645c -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_databend-0.2.2-py3-none-any.whl.
File metadata
- Download URL: mcp_databend-0.2.2-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
463274ebf57644588e6df025982b798df1e3f0895be9bd92b16da95ebbab100a
|
|
| MD5 |
9edb6d6cd733e7d753e53027246b9a5f
|
|
| BLAKE2b-256 |
3e66c9a18cd9a12b42b5b82400af34bad489fd440d3b700e44a18ffaed37e48b
|
Provenance
The following attestation bundles were made for mcp_databend-0.2.2-py3-none-any.whl:
Publisher:
python-publish.yml on databendlabs/mcp-databend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_databend-0.2.2-py3-none-any.whl -
Subject digest:
463274ebf57644588e6df025982b798df1e3f0895be9bd92b16da95ebbab100a - Sigstore transparency entry: 607482773
- Sigstore integration time:
-
Permalink:
databendlabs/mcp-databend@5ac2dc100828b68c0752492967a4653a29dc645c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/databendlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5ac2dc100828b68c0752492967a4653a29dc645c -
Trigger Event:
release
-
Statement type: