Skip to main content
Glama
hagsmand

mcp-server-starrocks

by hagsmand

StarRocks MCP 服务器

用于与 StarRocks 数据库交互的模型控制协议 (MCP) 服务器。该服务器为 AI 模型提供了一个标准化接口,以便通过一组定义的工具查询和操作 StarRocks 数据库。

概述

StarRocks MCP 服务器允许 AI 模型:

  • 在 StarRocks 数据库上执行 SELECT 查询

  • 列出可用的表

  • 描述表模式

  • 创建新表(非只读模式时)

  • 执行写入操作,如 INSERT、UPDATE、DELETE(非只读模式时)

Related MCP server: StarRocks MCP Server

安装

先决条件

  • Python 3.8+

  • StarRocks 数据库实例

  • SQLAlchemy

  • MCP Python 库

从源安装

git clone https://github.com/yourusername/mcp-server-starrocks.git
cd mcp-server-starrocks
pip install -e .

从 Smithery 安装

npm 安装@smithery/sdk @modelcontextprotocol/sdk

使用 MCP 检查器

npx @modelcontextprotocol/inspector uv --directory ~/mcp-server-starrocks 运行 mcp-server-starrocks

用法

启动服务器

python -m mcp_server_starrocks.server --host <starrocks-host> --port <starrocks-port> --user <username> --database <database-name> [--password <password>] [--readonly]

命令行参数:

  • --host :StarRocks 服务器主机(必需)

  • --port :StarRocks 服务器端口(默认值:9030)

  • --user :StarRocks 用户名(必填)

  • --database :StarRocks 数据库名称(必需)

  • --password :StarRocks 密码(如果需要)

  • --readonly :以只读模式运行服务器(可选)

可用工具

该服务器提供以下工具:

只读工具:

  • read-query :在 StarRocks 数据库上执行 SELECT 查询

  • list-tables :列出 StarRocks 数据库中的所有表

  • describe-table :描述特定表的模式

写入工具(非只读模式时可用):

  • write-query :执行 INSERT、UPDATE 或 DELETE 查询

  • create-table :在 StarRocks 数据库中创建新表

示例

列出表

{
    "name": "list-tables",
    "arguments": {}
}

执行 SELECT 查询

{
    "name": "read-query",
    "arguments": {
        "query": "SELECT FROM my_table LIMIT 10"
    }
}

描述表

{
    "name": "describe-table",
    "arguments": {
        "table_name": "my_table"
    }
}

创建表(非只读模式时)

{
    "name": "create-table",
    "arguments": {
        "query": "CREATE TABLE new_table (id INT, name VARCHAR(100))"
    }
}

执照

MIT 许可证

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Backend service implementing the Model Control Panel protocol that connects to Apache Doris databases, allowing users to execute SQL queries, manage metadata, and potentially leverage LLMs for tasks like natural language to SQL conversion.
    8
    78 PyPI
    351
    Apache 2.0
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A TypeScript implementation of a Model Context Protocol server that enables interaction with StarRocks databases, supporting SQL operations like queries, table creation, and data manipulation through standardized MCP tools.
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    A read-only MCP server that enables users to query and explore StarRocks databases through AI assistants like Claude. It supports SQL execution, schema discovery, and secure LDAP authentication for data analysis and metadata exploration.
    4
    1
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables natural language querying of Apache Doris databases via LLM-powered SQL generation, execution, and metadata management through the MCP protocol.
    9
    Apache 2.0