S
About
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
SELECTqueries (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
Connection Configuration
You can configure StarRocks connection using either individual environment variables or a single connection URL:
Option 1: Individual Environment Variables
STARROCKS_HOST: Hostname or IP address of the StarRocks FE service (default: localhost)STARROCKS_PORT: MySQL protocol port of the StarRocks FE service (default: 9030)STARROCKS_USER: StarRocks username (default: root)STARROCKS_PASSWORD: StarRocks password (default: empty)STARROCKS_DB: Default database to use if not specified
Option 2: Connection URL
STARROCKS_URL: Format:[<schema>://]user:password@host:port/database- Examples:
root:mypass@localhost:9030/test_db,mysql://admin:secret@db.example.com:9030/production
- Examples:
macOS Keychain Support
Store password securely:
security add-generic-password -U -a root -s mcp-server-starrocks -w 'secret'
Configure:
export STARROCKS_URL=root@localhost:9030/test_db
export STARROCKS_PASSWORD_KEYCHAIN_SERVICE=mcp-server-starrocks
export STARROCKS_PASSWORD_KEYCHAIN_ACCOUNT=root
Tools
- read_query: Execute SELECT queries with optional file output for large results
- write_query: Execute DDL/DML commands (CREATE, INSERT, UPDATE, DELETE)
- analyze_query: Analyze query performance using profile or explain analyze
- query_and_plotly_chart: Execute query and generate Plotly visualization
- table_overview: Get table schema, row count, and sample data (cached)
- db_overview: Get overview of all tables in a database (cached)
Resources
starrocks:///databases: List all databasesstarrocks:///{db}/tables: List tables in a databasestarrocks:///{db}/{table}/schema: Get table schemaproc:///{+path}: Access StarRocks internal system information
Additional Configuration
STARROCKS_OVERVIEW_LIMIT: Character limit for overview tools (default: 20000)STARROCKS_MCP_OUTPUT_DIR: Directory for query output files (default: ~/.mcp-server-starrocks/output/)STARROCKS_MYSQL_AUTH_PLUGIN: Authentication plugin (e.g., mysql_clear_password)MCP_TRANSPORT_MODE: Communication mode (stdio, streamable-http)
This server runs through your single 1Server connection. No extra config required.
0Installs
--Stars
Categories
DatabaseAnalyticsData
Links
Tags
Official