MCP HubMCP Hub
StarRocks

mcp-server-starrocks

by: StarRocks

StarRocks MCP (Model Context Protocol) Server

14created 05/03/2025
Visit
StarRocks
Protocol

📌Overview

Purpose: The StarRocks MCP Server serves as an interface to enable AI assistants to execute SQL queries and explore StarRocks databases without extensive setup or configuration.

Overview: The StarRocks MCP Server facilitates direct interactions with StarRocks databases, simplifying the process of executing queries and managing database resources. It acts as a crucial link between database operations and AI tools, enhancing usability and accessibility.

Key Features:

  • Query Execution:

    • read_query: Allows users to execute SELECT queries or any commands that generate a ResultSet, streamlining data retrieval.
    • write_query: Enables execution of DDL/DML commands and other StarRocks commands without generating a ResultSet, supporting database management tasks.
  • Resource Management:

    • Provides direct resources to list databases and tables, as well as templates for detailed schema information and internal system statistics, enhancing database oversight and control.

StarRocks Official MCP Server

The StarRocks MCP Server acts as a bridge between AI assistants and StarRocks databases, allowing for direct SQL execution and database exploration without requiring complex setup or configuration.

Configuration

MCP server config

{
  "mcpServers": {
    "mcp-server-starrocks": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp-server-starrocks",
        "mcp-server-starrocks"
      ],
      "env": {
        "STARROCKS_HOST": "default localhost",
        "STARROCKS_PORT": "default 9030",
        "STARROCKS_USER": "default root",
        "STARROCKS_PASSWORD": "default empty"
      }
    }
  }
}

If mcp-server-starrocks is not installed as a Python package (in dev environment), it can be run using a local directory:

{
  "mcpServers": {
    "mcp-server-starrocks": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mcp-server-starrocks",
        "run",
        "mcp-server-starrocks"
      ],
      "env": {
        "STARROCKS_HOST": "default localhost",
        "STARROCKS_PORT": "default 9030",
        "STARROCKS_USER": "default root",
        "STARROCKS_PASSWORD": "default empty"
      }
    }
  }
}

Components

Tools

  • read_query
    Execute a SELECT query or commands that return a ResultSet.

  • write_query
    Execute a DDL/DML or other StarRocks commands that do not return a ResultSet.

Resources

Direct Resources

  • starrocks:///databases
    Lists all databases in StarRocks.

Resource Templates

  • starrocks:///{db}/{table}/schema
    Gets the schema of a table using SHOW CREATE TABLE.

  • starrocks:///{db}/tables
    Lists all tables in a specific database.

  • proc:///{+path}
    System internal information exposed by StarRocks similar to Linux /proc.
    Common paths include:

    • /frontends - Information of FE nodes.
    • /backends - Information of BE nodes if this SR is non-cloud native deployment.
    • /compute_nodes - Information of CN nodes if this SR is cloud native deployment.
    • /dbs - Information of databases.
    • /dbs/<DB_ID> - Information of a database by database ID.
    • /dbs/<DB_ID>/<TABLE_ID> - Information of tables by database ID.
    • /dbs/<DB_ID>/<TABLE_ID>/partitions - Information of partitions by database ID and table ID.
    • /transactions - Information of transactions by database.
    • /transactions/<DB_ID> - Information of transactions by database ID.
    • /transactions/<DB_ID>/running - Information of running transactions by database ID.
    • /transactions/<DB_ID>/finished - Information of finished transactions by database ID.
    • /jobs - Information of jobs.
    • /statistic - Statistics of each database.
    • /tasks - Total number of generic tasks and failed tasks.
    • /cluster_balance - Load balance information.
    • /routine_loads - Information of Routine Load.
    • /colocation_group - Information of Colocate Join groups.
    • /catalog - Information of catalogs.

Prompts

None