StarRocks MCP Server

Interact with StarRocks

Local serverstdioPython

What is the StarRocks MCP server?

Starrocks mcp server connects StarRocks to AI assistants that speak the Model Context Protocol. Interact with StarRocks.

What StarRocks does

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.

Key capabilities

  • Direct SQL Execution: — Run SELECT queries (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

Tools it exposes

Once connected, the assistant can call these 10 tools directly:

  • read_queryDescription: Execute a SELECT query or other commands that return a ResultSet (e.g., SHOW, DESCRIBE). Optionally write the full result to a local file
  • Input — **
  • Output — ** Without output_file, text content containing the query results in CSV-like format with a header row and row count summary. With output_file, a short summary
  • write_queryDescription: Execute a DDL (CREATE, ALTER, DROP), DML (INSERT, UPDATE, DELETE), or other StarRocks command that does not return a ResultSet
  • analyze_queryDescription: Analyze a query and get analyze result using query profile or explain analyze
  • top_hot_tablesDescription: Get top hot tables by audit-log visit count. It joins information_schema.tables with starrocks_audit_db__.starrocks_audit_tbl__, excludes root
  • top_bad_tablesDescription: Get top bad tables by table health score, following Star Management Studio's top-bad-tables logic. It reuses the table-health calculation
  • query_and_plotly_chartDescription: Executes a SQL query, loads the results into a Pandas DataFrame, and generates a Plotly chart using a provided Python expression. Designed for
  • table_overviewDescription: Get an overview of a specific table: columns (from DESCRIBE), total row count, and sample rows (LIMIT 3). Uses an in-memory cache unless
  • Tools — The Tools tool exposed by this server

Installing the starrocks mcp server

Setup follows the standard MCP pattern: clone or install the server, then register it in your client's configuration file and restart the client. The configuration snippets on this page cover Claude Desktop, Claude Code and Cursor.

Configuration

Before the server will start you need to supply 8 environment variables: STARROCKS_HOST, STARROCKS_PORT, STARROCKS_USER, STARROCKS_PASSWORD, STARROCKS_DB, STARROCKS_URL, STARROCKS_SSL_CA, STARROCKS_SSL_VERIFY_CERT. Keep credentials in your client's env block or a secrets manager rather than committing them.

Requirements

  • Python 3.11 or newer. - A reachable StarRocks cluster (FE service). By default the server connects to localhost:9030 over the MySQL protocol. - uv — a fast Python package and project manager (a modern replacement for pip + virtualenv) from Astral. This project uses uv to resolve dependencies, create the virtual environment, and launch the

Where it fits

Database servers turn schema archaeology and ad-hoc reporting into conversation, which is why they tend to be the second or third server people install. StarRocks sits in that group, and the shape of its toolset — read_query, Input, Output among others — tells you what it is really for. Worth comparing against the other databases servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • It will not start until its required credentials are present, so set those before wondering why the tools never appear.
  • With 10 tools exposed, expect a noticeable bump in prompt size — disable it in projects that never use StarRocks.
  • Written in Python.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the starrocks mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
read_query**Description:** Execute a SELECT query or other commands that return a ResultSet (e.g., SHOW, DESCRIBE). Optionally write the full result to a local file instead of returning it inline — useful for results too large to
Input**
Output** Without output_file, text content containing the query results in CSV-like format with a header row and row count summary. With output_file, a short summary including the resolved absolute path, byte count, and row co
write_query**Description:** Execute a DDL (CREATE, ALTER, DROP), DML (INSERT, UPDATE, DELETE), or other StarRocks command that does not return a ResultSet.
analyze_query**Description:** Analyze a query and get analyze result using query profile or explain analyze.
top_hot_tables**Description:** Get top hot tables by audit-log visit count. It joins information_schema.tables with starrocks_audit_db__.starrocks_audit_tbl__, excludes root and SHOW statements, matches audit SQL text against table na
top_bad_tables**Description:** Get top bad tables by table health score, following Star Management Studio's top-bad-tables logic. It reuses the table-health calculation based on information_schema.be_tablets and information_schema.par
query_and_plotly_chart**Description:** Executes a SQL query, loads the results into a Pandas DataFrame, and generates a Plotly chart using a provided Python expression. Designed for visualization in supporting UIs.
table_overview**Description:** Get an overview of a specific table: columns (from DESCRIBE), total row count, and sample rows (LIMIT 3). Uses an in-memory cache unless refresh is true.
ToolsThe Tools tool exposed by this server.

How to install the StarRocks MCP server

{
  "mcpServers": {
    "mcp-server-starrocks": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Python 3.11 or newer. - A reachable StarRocks cluster (FE service). By default the server connects to localhost:9030 over the MySQL protocol. - uv — a fast Python package and project manager (a modern replacement for pip + virtualenv) from Astral. This project uses uv to resolve dependencies, create the virtual environment, and launch the
VariableDescriptionRequired
STARROCKS_HOSTEndpoint or connection string the server talks to.Optional
STARROCKS_PORTConfiguration value read at startup.Optional
STARROCKS_USERConfiguration value read at startup.Optional
STARROCKS_PASSWORDConfiguration value read at startup.Optional
STARROCKS_DBConfiguration value read at startup.Optional
STARROCKS_URLEndpoint or connection string the server talks to.Yes
STARROCKS_SSL_CAConfiguration value read at startup.Optional
STARROCKS_SSL_VERIFY_CERTConfiguration value read at startup.Optional

Example prompts to try

  • Use StarRocks to read query.
  • Use StarRocks to Input.
  • Use StarRocks to Output.

Frequently asked questions

It connects StarRocks to MCP-compatible AI assistants such as Claude and Cursor, exposing 10 tools (read_query, Input, Output, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with StarRocks directly.