The StarRocks MCP Server acts as a bridge between AI assistants and StarRocks databases. It allows for direct SQL execution, database exploration, data visualization via charts, and retrieving detailed schema/data overviews without requiring complex client-side setup.
- Direct SQL Execution: Run
SELECTqueries (read_query) and DDL/DML commands (write_query). - Database Exploration: List databases and tables, retrieve table schemas (
starrocks://resources). - System Information: Access internal StarRocks metrics and states via the
proc://resource path. - Detailed Overviews: Get comprehensive summaries of tables (
table_overview) or entire databases (db_overview), including column definitions, row counts, and sample data. - Data Visualization: Execute a query and generate a Plotly chart directly from the results (
query_and_plotly_chart). - Intelligent Caching: Table and database overviews are cached in memory to speed up repeated requests. Cache can be bypassed when needed.
- Flexible Configuration: Set connection details and behavior via environment variables.
- Python 3.11 or newer.
- A reachable StarRocks cluster (FE service). By default the server connects to
localhost:9030over the MySQL protocol. uv— a fast Python package and project manager (a modern replacement forpip+virtualenv) from Astral. This project usesuvto resolve dependencies, create the virtual environment, and launch the server. Theuv runcommands throughout this README automatically create an isolated environment and install the required dependencies on first use, so no manualpip installstep is needed.
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or via Homebrew / pipx / pip
brew install uv
# pipx install uv
# pip install uv