Skip to content

Menu

StarRocks MCP Server logo

StarRocks MCP Server

Published

At a glance

Category
Databases
Watch out for
write_query runs DDL and DML and commits automatically, so the StarRocks user you configure decides how much damage an agent can do; a read-only account is the safer choice.

StarRocks maintains this server in its own GitHub organization and calls it the official MCP server for the database. It is a Python package that talks to a StarRocks frontend over the MySQL protocol, localhost:9030 by default, and gives an agent SQL access, schema browsing and quick charts without any client-side setup beyond a config entry.

It needs Python 3.11 or newer and is launched with uv, which fetches the published mcp-server-starrocks package on demand. Stdio is the default transport. The README recommends Streamable HTTP for new setups, and you can run that mode from uv or from a Docker image you build from the repo. The older SSE mode is still in the code but marked deprecated and unmaintained.

There are a few practical extras. Table and database overviews are cached in memory, query results can be written to CSV, TSV or JSON files when they are too big for the model's context, and the connection can switch to Arrow Flight SQL when you set its port.

How it connects

Your AI app

An assistant or agent that supports MCP

StarRocks MCP Server

Runs as

  • Python (uv / pip)
  • Remote (HTTP)

Gives the agent

  • Running queries
  • Changing data and schema
  • Query analysis
  • Table and database summaries
  • Charts
  • Schema and system resources

StarRocks

Signs in with

  • Username and password
Your AI app talks to StarRocks MCP Server over the Model Context Protocol, and the server carries out the work. Built from the setup and capability sections on this page.

What it can do

Running queries
read_query runs SELECT, SHOW or DESCRIBE and can write the full result to a local file with output_file and output_format, returning only a summary and preview.
Changing data and schema
write_query runs DDL such as CREATE, ALTER and DROP or DML such as INSERT, UPDATE and DELETE, and commits automatically on success.
Query analysis
analyze_query takes a query ID and returns analysis from the query profile or EXPLAIN ANALYZE.
Table and database summaries
table_overview and db_overview return column definitions, row counts and sample data, cached in memory and bounded by STARROCKS_OVERVIEW_LIMIT.
Charts
query_and_plotly_chart runs a query and builds a Plotly chart, returned as an image or written as an HTML file to STARROCKS_CHART_OUTPUT_DIR.
Schema and system resources
starrocks:// resources list databases, tables and schemas, and the proc:// path exposes internal StarRocks metrics and state.

Setting it up

Install uv first (for example brew install uv), then check the connection with STARROCKS_URL=root:@localhost:9030 uv run mcp-server-starrocks --test. For a stdio setup, add an mcpServers entry named mcp-server-starrocks with "command": "uv" and "args": ["run", "--with", "mcp-server-starrocks", "mcp-server-starrocks"], and pass connection details in env either as STARROCKS_HOST, STARROCKS_PORT, STARROCKS_USER, STARROCKS_PASSWORD and STARROCKS_DB, or as a single STARROCKS_URL like root:password@localhost:9030/my_database, which takes precedence. For the recommended Streamable HTTP mode, start uv run mcp-server-starrocks --mode streamable-http --port 8000 and point the client at {"url": "http://localhost:8000/mcp"}. Passwords can also come from STARROCKS_PASSWORD_FILE or, on macOS, the Keychain via STARROCKS_PASSWORD_KEYCHAIN_SERVICE, and the STARROCKS_SSL_* variables turn on certificate verification.

Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)

Where it helps

  • Have an agent read a table_overview of an unfamiliar database before drafting analytical SQL.
  • Export a large query result to a CSV file with read_query instead of pasting thousands of rows into the chat.
  • Turn a weekly aggregate query into a Plotly chart for a quick look at a trend.
  • Look up a slow query by its ID with analyze_query and read the profile while tuning.
  • Create or alter a staging table during development with write_query.

Limitations and things to watch

  • write_query runs DDL and DML and commits automatically, so the StarRocks user you configure decides how much damage an agent can do; a read-only account is the safer choice.
  • Without TLS settings the connection is encrypted only if the server offers it and the certificate is not verified; set STARROCKS_SSL_CA and STARROCKS_SSL_VERIFY_CERT for real checks.
  • SSE transport is deprecated and no longer maintained, so new integrations should use Streamable HTTP.
  • Queries wait indefinitely by default unless STARROCKS_QUERY_TIMEOUT is set.
  • Output files and HTML charts are written on the machine running the server, not the client.

Sources

Written from the project's own documentation, checked November 2026.

How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…