Integrations
Provides access to system information through a proc-like interface, allowing exploration of node status, database details, and system metrics similar to the Linux /proc filesystem.
Enables execution of SQL queries against StarRocks databases using Python, supporting both read operations (SELECT queries) and write operations (DDL/DML commands).
StarRocks Official MCP Server
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.
Features
- 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.
Configuration
The MCP server is typically run via an MCP host. Configuration is passed to the host, specifying how to launch the StarRocks MCP server process.
Using uv
with installed package:
Using uv
with local directory (for development):
Environment Variables:
STARROCKS_HOST
: (Optional) Hostname or IP address of the StarRocks FE service. Defaults tolocalhost
.STARROCKS_PORT
: (Optional) MySQL protocol port of the StarRocks FE service. Defaults to9030
.STARROCKS_USER
: (Optional) StarRocks username. Defaults toroot
.STARROCKS_PASSWORD
: (Optional) StarRocks password. Defaults to empty string.STARROCKS_DB
: (Optional) Default database to use if not specified in tool arguments or resource URIs. If set, the connection will attempt toUSE
this database. Tools liketable_overview
anddb_overview
will use this if the database part is omitted in their arguments. Defaults to empty (no default database).STARROCKS_OVERVIEW_LIMIT
: (Optional) An approximate character limit for the total text generated by overview tools (table_overview
,db_overview
) when fetching data to populate the cache. This helps prevent excessive memory usage for very large schemas or numerous tables. Defaults to20000
.
Components
Tools
read_query
- Description: Execute a SELECT query or other commands that return a ResultSet (e.g.,
SHOW
,DESCRIBE
). - Input:
{ "query": "SQL query string" }
- Output: Text content containing the query results in a CSV-like format, including a header row and a row count summary. Returns an error message on failure.
- Description: Execute a SELECT query or other commands that return a ResultSet (e.g.,
write_query
- Description: Execute a DDL (
CREATE
,ALTER
,DROP
), DML (INSERT
,UPDATE
,DELETE
), or other StarRocks command that does not return a ResultSet. - Input:
{ "query": "SQL command string" }
- Output: Text content confirming success (e.g., "Query OK, X rows affected") or reporting an error. Changes are committed automatically on success.
- Description: Execute a DDL (
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.
- Input:Copy
- Output: A list containing:
TextContent
: A text representation of the DataFrame and a note that the chart is for UI display.ImageContent
: The generated Plotly chart encoded as a base64 PNG image (image/png
). Returns text error message on failure or if the query yields no data.
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 unlessrefresh
is true. - Input:Copy
- Output: Text content containing the formatted overview (columns, row count, sample data) or an error message. Cached results include previous errors if applicable.
- Description: Get an overview of a specific table: columns (from
db_overview
- Description: Get an overview (columns, row count, sample rows) for all tables within a specified database. Uses the table-level cache for each table unless
refresh
is true. - Input:Copy
- Output: Text content containing concatenated overviews for all tables found in the database, separated by headers. Returns an error message if the database cannot be accessed or contains no tables.
- Description: Get an overview (columns, row count, sample rows) for all tables within a specified database. Uses the table-level cache for each table unless
Resources
Direct Resources
starrocks:///databases
- Description: Lists all databases accessible to the configured user.
- Equivalent Query:
SHOW DATABASES
- MIME Type:
text/plain
Resource Templates
starrocks:///{db}/{table}/schema
- Description: Gets the schema definition of a specific table.
- Equivalent Query:
SHOW CREATE TABLE {db}.{table}
- MIME Type:
text/plain
starrocks:///{db}/tables
- Description: Lists all tables within a specific database.
- Equivalent Query:
SHOW TABLES FROM {db}
- MIME Type:
text/plain
proc:///{+path}
- Description: Accesses StarRocks internal system information, similar to Linux
/proc
. Thepath
parameter specifies the desired information node. - Equivalent Query:
SHOW PROC '/{path}'
- MIME Type:
text/plain
- Common Paths:
/frontends
- Information about FE nodes./backends
- Information about BE nodes (for non-cloud native deployments)./compute_nodes
- Information about CN nodes (for cloud native deployments)./dbs
- Information about databases./dbs/<DB_ID>
- Information about a specific database by ID./dbs/<DB_ID>/<TABLE_ID>
- Information about a specific table by ID./dbs/<DB_ID>/<TABLE_ID>/partitions
- Partition information for a table./transactions
- Transaction information grouped by database./transactions/<DB_ID>
- Transaction information for a specific database ID./transactions/<DB_ID>/running
- Running transactions for a database ID./transactions/<DB_ID>/finished
- Finished transactions for a database ID./jobs
- Information about asynchronous jobs (Schema Change, Rollup, etc.)./statistic
- Statistics for each database./tasks
- Information about agent tasks./cluster_balance
- Load balance status information./routine_loads
- Information about Routine Load jobs./colocation_group
- Information about Colocation Join groups./catalog
- Information about configured catalogs (e.g., Hive, Iceberg).
- Description: Accesses StarRocks internal system information, similar to Linux
Prompts
None defined by this server.
Caching Behavior
- The
table_overview
anddb_overview
tools utilize an in-memory cache to store the generated overview text. - The cache key is a tuple of
(database_name, table_name)
. - When
table_overview
is called, it checks the cache first. If a result exists and therefresh
parameter isfalse
(default), the cached result is returned immediately. Otherwise, it fetches the data from StarRocks, stores it in the cache, and then returns it. - When
db_overview
is called, it lists all tables in the database and then attempts to retrieve the overview for each table using the same caching logic astable_overview
(checking cache first, fetching if needed andrefresh
isfalse
or cache miss). Ifrefresh
istrue
fordb_overview
, it forces a refresh for all tables in that database. - The
STARROCKS_OVERVIEW_LIMIT
environment variable provides a soft target for the maximum length of the overview string generated per table when populating the cache, helping to manage memory usage. - Cached results, including any error messages encountered during the original fetch, are stored and returned on subsequent cache hits.
Demo
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Acts as a bridge between AI assistants and StarRocks databases, allowing for direct SQL execution and database exploration without requiring complex setup or configuration.
Related MCP Servers
- AsecurityAlicenseAqualityAllows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.Last updated -1360PythonMIT License
- AsecurityAlicenseAqualityThis server enables AI models to interact with MySQL databases through a standardized interface.Last updated -564661JavaScriptMIT License
- -securityFlicense-qualityEnables AI assistants to interact with Metabase databases and dashboards, allowing users to list and execute queries, access data visualizations, and interact with database resources through natural language.Last updated -9JavaScript
- -securityAlicense-qualityAn easy-to-use bridge that lets AI assistants like Claude and Cursor IDE directly query and explore Microsoft SQL Server databases. No coding experience required!Last updated -25JavaScriptGPL 3.0