MCP Hub
Back to servers

starrocks-mcp

A read-only MCP server that enables users to query and explore StarRocks databases through AI assistants like Claude. It supports SQL execution, schema discovery, and secure LDAP authentication for data analysis and metadata exploration.

glama
Updated
Jan 29, 2026

starrocks-mcp

Python 3.10+ License: MIT

A read-only MCP (Model Context Protocol) server for StarRocks databases. Query and explore your StarRocks data through Claude and other AI assistants.

Features

Supported ✅

  • SQL Query Execution
    • Execute SQL queries directly from Claude Desktop
    • Automatic result truncation for large datasets
  • Table Operations
    • List all databases
    • List tables in a database
    • Get table schema details
  • LDAP Authentication
    • Secure LDAP authentication support
    • Each user uses their own credentials

Not Supported ❌

  • Data Ingestion
  • Table/Schema Creation or Modification
  • User/Permission Management

Tools

ToolDescription
execute_queryExecute a SQL query and return results
list_databasesList all databases in StarRocks
list_tablesList tables in a database
describe_tableGet detailed schema information for a table

Installation

Using uvx (Recommended)

uvx --from git+https://github.com/jason-ung/starrocks-mcp starrocks-mcp

Using pip

pip install git+https://github.com/jason-ung/starrocks-mcp
starrocks-mcp

Configuration

Environment VariableRequiredDefaultDescription
STARROCKS_HOSTYes-StarRocks host
STARROCKS_PORTNo9030StarRocks port
STARROCKS_USERYes-Your LDAP username
STARROCKS_PASSWORDYes-Your LDAP password
STARROCKS_DATABASENoadsDefault database
LOG_LEVELNoINFOLogging level
DEFAULT_QUERY_TIMEOUT_MSNo30000Default query timeout (ms)
MAX_QUERY_LENGTHNo10000Maximum SQL query length

Claude Desktop Setup

Add to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "starrocks": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/jason-ung/starrocks-mcp",
        "starrocks-mcp"
      ],
      "env": {
        "STARROCKS_HOST": "starrocks.datapl.datahou.se",
        "STARROCKS_PORT": "9030",
        "STARROCKS_USER": "your.ldap.username",
        "STARROCKS_PASSWORD": "your_ldap_password",
        "STARROCKS_DATABASE": "ads"
      }
    }
  }
}

⚠️ Important: Replace your.ldap.username and your_ldap_password with your actual LDAP credentials.

Usage Examples

User: Show me all databases in StarRocks

Claude: [Uses list_databases]
- ads
- search
- user_behavior
User: What tables are in the ads database?

Claude: [Uses list_tables with database="ads"]
- advtr_product_da_preprocessed_log
- advtr_product_sa_preprocessed_log
- campaign_budget
User: Describe the advtr_product_da_preprocessed_log table

Claude: [Uses describe_table with table="advtr_product_da_preprocessed_log"]
Field | Type | Description
----- | ---- | -----------
eventTs | BIGINT | Event timestamp
eventType | VARCHAR | Event type (IMPRESSION, CLICK, etc.)
...
User: Query the top 10 campaigns by impression count

Claude: [Uses execute_query]
SELECT campaignId, COUNT(*) as impression_count
FROM advtr_product_da_preprocessed_log
WHERE eventType = 'IMPRESSION'
  AND base_dt = '2026-01-29'
GROUP BY campaignId
ORDER BY impression_count DESC
LIMIT 10

Development

Local Setup

git clone https://github.com/jason-ung/starrocks-mcp.git
cd starrocks-mcp

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -e ".[dev]"

# Copy .env.example to .env and configure
cp .env.example .env
# Edit .env with your credentials

# Run the server
starrocks-mcp

Testing Connection

# Test StarRocks connection
mysql -h starrocks.datapl.datahou.se -P 9030 -u your.username -p --ssl-mode=DISABLED --enable-cleartext-plugin

Security

  • Never commit credentials: Always use environment variables for sensitive data
  • Use personal LDAP accounts: Each user should use their own credentials
  • LDAP authentication: Supports cleartext LDAP authentication over secure connections
  • Read-only operations: This MCP server only supports SELECT queries and metadata operations

License

MIT License - see LICENSE for details.

Author

Jason Son (@jason-ung)


Made with ❤️ for Bucketplace Ads Team

Reviews

No reviews yet

Sign in to write a review