Home / MCP / StarRocks MCP Server

StarRocks MCP Server

Bridges AI assistants with StarRocks by enabling direct SQL, schema exploration, and on-demand visualizations via MCP.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

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

The StarRocks MCP Server connects your AI assistants to StarRocks databases, enabling direct SQL execution, database exploration, and on-demand data visualization. It streamlines querying, schema overviews, and in-depth system views without heavy client setup, so you can build powerful, data-driven assistants quickly.

How to use

You interact with the StarRocks MCP Server through an MCP client to execute SQL, fetch schemas, view database overviews, and render charts from query results. Use the HTTP/Streamable HTTP endpoint for REST-like calls, or run a local MCP server process and connect via a standard MCP client. Common tasks include running read queries, applying DDL/DML, inspecting table and database structures, and generating visualizations directly from query results.

How to install

Prerequisites: ensure you have a runtime available to host the MCP server. You need a method to start the MCP server process and a client to communicate over HTTP or stdio.

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

If you prefer a local process approach, you can run the MCP server using the Streamable HTTP mode and then configure the MCP client to connect to the provided URL.

Additional sections

Configuration options let you tailor how you connect to StarRocks and how the MCP server behaves. You can set connection details via an HTTP URL or via individual environment variables, and you can choose transport modes like streamable HTTP for RESTful interactions or stdio for local hosting. The server caches table and database overviews to speed up repeated requests, and you can bypass the cache when you need fresh data.

Available tools

read_query

Execute a SELECT or other query that returns a ResultSet. Inputs include the SQL query and an optional database. Output is a text representation of results.

write_query

Execute a DDL/DML command that does not return a ResultSet. Inputs include the SQL command and an optional database. Output confirms success or reports an error.

analyze_query

Analyze a query and return results using a query profile or explain analyze depending on provided inputs (uuid or sql and optional database).

query_and_plotly_chart

Run a SQL query, load results into a DataFrame, and generate a Plotly chart from a Python expression. Outputs a text representation of the data and a base64-encoded chart image.

table_overview

Get a structured overview of a specific table including column details, row count, and sample data. Uses an in-memory cache by default.

db_overview

Get an overview for all tables in a database, aggregating table overviews with caching behavior.