Execute a SELECT SQL query in Hologres database
Execute a SELECT SQL query in Hologres database with serverless computing
Execute a DML (INSERT, UPDATE, DELETE) SQL query in Hologres database
Execute a DDL (CREATE, ALTER, DROP, COMMENT ON) SQL query in Hologres database
Collect table statistics in Hologres database
Get query plan in Hologres database
Get execution plan in Hologres database
Invoke a procedure in Hologres database
Create MaxCompute foreign tables in Hologres database
Lists all schemas in the current Hologres database, excluding system schemas
Lists all tables in a specific schema, including their types (table, view, external table, partitioned table)
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.
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.
You can install and configure the Hologres MCP Server in two ways:
git clone https://github.com/aliyun/alibabacloud-hologres-mcp-server.git
{
"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"
}
}
}
}
pip install hologres-mcp-server
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"
}
}
}
}
The MCP server requires the following environment variables to connect to your Hologres database:
HOLOGRES_HOST
: The hostname of your Hologres instanceHOLOGRES_PORT
: The port number of your Hologres instanceHOLOGRES_USER
: Your Alibaba Cloud Access IDHOLOGRES_PASSWORD
: Your Alibaba Cloud Access KeyHOLOGRES_DATABASE
: The name of the database to connect toThe MCP provides several resource endpoints to access database metadata:
hologres:///schemas
: Get all schemas in the Hologres databasehologres:///{schema}/tables
: List all tables in a specific schemahologres:///{schema}/{table}/partitions
: List all partitions of a partitioned tablehologres:///{schema}/{table}/ddl
: Get table DDLhologres:///{schema}/{table}/statistic
: Show collected table statisticsSystem information can be accessed via:
system:///hg_instance_version
: Shows the Hologres instance versionsystem:///guc_value/<guc_name>
: Shows configuration valuessystem:///missing_stats_tables
: Shows tables missing statisticssystem:///stat_activity
: Shows information about current running queriessystem:///query_log/latest/<row_limits>
: Get recent query log historysystem:///query_log/user/<user_name>/<row_limits>
: Get query logs for a specific usersystem:///query_log/application/<application_name>/<row_limits>
: Get query logs for a specific applicationsystem:///query_log/failed/<interval>/<row_limits>
: Get failed query logs