MCP HubMCP Hub
aliyun

alibabacloud-hologres-mcp-server

by: aliyun

alibabacloud hologres mcp server

16created 20/03/2025
Visit
alibabacloud
hologres

📌Overview

Purpose: The Hologres MCP Server provides a universal interface that enables seamless interaction between AI Agents and Hologres databases for metadata retrieval and SQL operations.

Overview: The Hologres MCP Server functions as a bridge, facilitating effective communication between AI Agents and Hologres, allowing for the execution of various SQL commands and obtaining valuable database metadata.

Key Features:

  • Execute SQL: Allows users to run SQL queries in Hologres, enabling efficient data manipulation and retrieval.

  • Analyze Table: Gathers statistics about tables, assisting in performance tuning and optimization.

  • Get Query Plan: Retrieves the execution plan for a given query, aiding in understanding and optimizing database performance.

  • Get Execution Plan: Offers insights into how a specific query will be executed, optimizing query design.

  • Built-in Resources: Provides access to schema information and table-related data, enhancing the user's ability to navigate the database structure.

  • System Path Access: Includes paths for retrieving real-time data about currently running queries, query logs, and statistics on missing data, which is valuable for monitoring and debugging database performance.


Hologres MCP Server

Hologres MCP Server provides a universal interface between AI Agents and Hologres databases. It facilitates communication, enabling AI Agents to retrieve database metadata and execute SQL operations on Hologres.

Configuration

Mode 1: Using Local File

Download

Clone the repository:

git clone https://github.com/aliyun/alibabacloud-hologres-mcp-server.git

MCP Integration

Add the following configuration to the MCP client configuration file:

"mcpServers": {
  "hologres-mcp-server": {
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/alibabacloud-hologres-mcp-server",
      "run",
      "hologres-mcp-server"
    ],
    "env": {
      "HOLOGRES_HOST": "host",
      "HOLOGRES_PORT": "port",
      "HOLOGRES_USER": "access_id",
      "HOLOGRES_PASSWORD": "access_key",
      "HOLOGRES_DATABASE": "database"
    }
  }
}

Mode 2: Using PIP Mode

Installation

Install the MCP Server package:

pip install hologres-mcp-server

MCP Integration

Add the following configuration to the MCP client configuration file:

"mcpServers": {
  "hologres-mcp-server": {
    "command": "uv",
    "args": [
      "run",
      "--with",
      "hologres-mcp-server",
      "hologres-mcp-server"
    ],
    "env": {
      "HOLOGRES_HOST": "host",
      "HOLOGRES_PORT": "port",
      "HOLOGRES_USER": "access_id",
      "HOLOGRES_PASSWORD": "access_key",
      "HOLOGRES_DATABASE": "database"
    }
  }
}

Components

Tools

  • execute_select_sql: Execute a SELECT SQL query on Hologres
  • execute_dml_sql: Execute DML (INSERT, UPDATE, DELETE) SQL queries
  • execute_ddl_sql: Execute DDL (CREATE, ALTER, DROP) SQL queries
  • gather_table_statistics: Collect table statistics
  • get_query_plan: Retrieve query plan
  • get_execution_plan: Retrieve execution plan

Resources

Built-in Resources

  • hologres:///schemas: Retrieve all schemas in the database

Resource Templates

  • hologres:///{schema}/tables: List all tables in a schema
  • hologres:///{schema}/{table}/partitions: List all partitions of a partitioned table
  • hologres:///{schema}/{table}/ddl: Get table DDL
  • hologres:///{schema}/{table}/statistic: Show collected table statistics
  • system:///{+system_path} with system paths such as:
    • missing_stats_tables: Tables missing statistics
    • stat_activity: Current running queries information
    • query_log/latest/<row_limits>: Recent query logs with row limit
    • query_log/user/<user_name>/<row_limits>: Query logs for a specific user
    • query_log/application/<application_name>/<row_limits>: Query logs for a specific application
    • query_log/failed/<interval>/<row_limits>: Failed query logs with interval and row limit

Prompts

None available at this time.