Back to MCP Catalog

Alibaba Cloud Hologres MCP Server

DatabasesPython
Connect AI agents to Hologres databases for SQL operations and metadata retrieval
Available Tools

execute_hg_select_sql

Execute a SELECT SQL query in Hologres database

execute_hg_select_sql_with_serverless

Execute a SELECT SQL query in Hologres database with serverless computing

execute_hg_dml_sql

Execute a DML (INSERT, UPDATE, DELETE) SQL query in Hologres database

execute_hg_ddl_sql

Execute a DDL (CREATE, ALTER, DROP, COMMENT ON) SQL query in Hologres database

gather_hg_table_statistics

Collect table statistics in Hologres database

get_hg_query_plan

Get query plan in Hologres database

get_hg_execution_plan

Get execution plan in Hologres database

call_hg_procedure

Invoke a procedure in Hologres database

create_hg_maxcompute_foreign_table

Create MaxCompute foreign tables in Hologres database

list_hg_schemas

Lists all schemas in the current Hologres database, excluding system schemas

list_hg_tables_in_a_schema

Lists all tables in a specific schema, including their types (table, view, external table, partitioned table)

show_hg_table_ddl

Show the DDL script of a table, view, or external table in the Hologres database

Hologres MCP Server provides a universal interface between AI agents and Alibaba Cloud's Hologres database service. It enables seamless communication that allows AI agents to retrieve database metadata, execute SQL queries, and manage database operations without requiring complex integration code. With this MCP, AI agents can perform a wide range of database operations including executing SELECT, DML, and DDL statements, gathering table statistics, analyzing query plans, and creating foreign tables. The server handles all the connection management and query execution details, making it easy for AI systems to work with Hologres data.

Overview

Hologres MCP Server enables AI agents to interact with Alibaba Cloud's Hologres database service. This MCP provides tools for executing SQL queries, retrieving database metadata, and performing database management operations.

Installation

You can install and configure the Hologres MCP Server in two ways:

Method 1: Using Local Files

  1. Clone the repository:
git clone https://github.com/aliyun/alibabacloud-hologres-mcp-server.git
  1. Add the following configuration to your 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": "your_hologres_host",
                "HOLOGRES_PORT": "your_hologres_port",
                "HOLOGRES_USER": "your_access_id",
                "HOLOGRES_PASSWORD": "your_access_key",
                "HOLOGRES_DATABASE": "your_database_name"
            }
        }
    }
}

Method 2: Using PIP Installation

  1. Install the package using pip:
pip install hologres-mcp-server
  1. Add one of the following configurations to your MCP client configuration file:

Using uv mode:

{
    "mcpServers": {
        "hologres-mcp-server": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "hologres-mcp-server",
                "hologres-mcp-server"
            ],
            "env": {
                "HOLOGRES_HOST": "your_hologres_host",
                "HOLOGRES_PORT": "your_hologres_port",
                "HOLOGRES_USER": "your_access_id",
                "HOLOGRES_PASSWORD": "your_access_key",
                "HOLOGRES_DATABASE": "your_database_name"
            }
        }
    }
}

Using uvx mode:

{
    "mcpServers": {
        "hologres-mcp-server": {
            "command": "uvx",
            "args": [
                "hologres-mcp-server"
            ],
            "env": {
                "HOLOGRES_HOST": "your_hologres_host",
                "HOLOGRES_PORT": "your_hologres_port",
                "HOLOGRES_USER": "your_access_id",
                "HOLOGRES_PASSWORD": "your_access_key",
                "HOLOGRES_DATABASE": "your_database_name"
            }
        }
    }
}

Configuration

The MCP server requires the following environment variables to connect to your Hologres database:

  • HOLOGRES_HOST: The hostname of your Hologres instance
  • HOLOGRES_PORT: The port number of your Hologres instance
  • HOLOGRES_USER: Your Alibaba Cloud Access ID
  • HOLOGRES_PASSWORD: Your Alibaba Cloud Access Key
  • HOLOGRES_DATABASE: The name of the database to connect to

Resources

The MCP provides several resource endpoints to access database metadata:

  • hologres:///schemas: Get all schemas in the Hologres database
  • hologres:///{schema}/tables: List all tables in a specific 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 information can be accessed via:

  • system:///hg_instance_version: Shows the Hologres instance version
  • system:///guc_value/<guc_name>: Shows configuration values
  • system:///missing_stats_tables: Shows tables missing statistics
  • system:///stat_activity: Shows information about current running queries
  • system:///query_log/latest/<row_limits>: Get recent query log history
  • system:///query_log/user/<user_name>/<row_limits>: Get query logs for a specific user
  • system:///query_log/application/<application_name>/<row_limits>: Get query logs for a specific application
  • system:///query_log/failed/<interval>/<row_limits>: Get failed query logs

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.