Skip to content

Commit d6f95be

Browse files
committed
release 0.1.9
1 parent a714a7d commit d6f95be

18 files changed

+1372
-552
lines changed

README.md

Lines changed: 90 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
English | [中文](README_ZH.md)
2+
13
# Hologres MCP Server
24

35
Hologres MCP Server serves as a universal interface between AI Agents and Hologres databases. It enables seamless communication between AI Agents and Hologres, helping AI Agents retrieve Hologres database metadata and execute SQL operations.
@@ -10,7 +12,7 @@ Hologres MCP Server serves as a universal interface between AI Agents and Hologr
1012

1113
Download from Github
1214

13-
```shell
15+
```bash
1416
git clone https://github.com/aliyun/alibabacloud-hologres-mcp-server.git
1517
```
1618

@@ -19,23 +21,25 @@ git clone https://github.com/aliyun/alibabacloud-hologres-mcp-server.git
1921
Add the following configuration to the MCP client configuration file:
2022

2123
```json
22-
"mcpServers": {
23-
"hologres-mcp-server": {
24-
"command": "uv",
25-
"args": [
26-
"--directory",
27-
"/path/to/alibabacloud-hologres-mcp-server",
28-
"run",
29-
"hologres-mcp-server"
30-
],
31-
"env": {
32-
"HOLOGRES_HOST": "host",
33-
"HOLOGRES_PORT": "port",
34-
"HOLOGRES_USER": "access_id",
35-
"HOLOGRES_PASSWORD": "access_key",
36-
"HOLOGRES_DATABASE": "database"
24+
{
25+
"mcpServers": {
26+
"hologres-mcp-server": {
27+
"command": "uv",
28+
"args": [
29+
"--directory",
30+
"/path/to/alibabacloud-hologres-mcp-server",
31+
"run",
32+
"hologres-mcp-server"
33+
],
34+
"env": {
35+
"HOLOGRES_HOST": "host",
36+
"HOLOGRES_PORT": "port",
37+
"HOLOGRES_USER": "access_id",
38+
"HOLOGRES_PASSWORD": "access_key",
39+
"HOLOGRES_DATABASE": "database"
40+
}
41+
}
3742
}
38-
}
3943
}
4044
```
4145

@@ -53,59 +57,94 @@ pip install hologres-mcp-server
5357

5458
Add the following configuration to the MCP client configuration file:
5559

60+
Use uv mode
61+
5662
```json
57-
"mcpServers": {
58-
"hologres-mcp-server": {
59-
"command": "uv",
60-
"args": [
61-
"run",
62-
"--with",
63-
"hologres-mcp-server",
64-
"hologres-mcp-server"
65-
],
66-
"env": {
67-
"HOLOGRES_HOST": "host",
68-
"HOLOGRES_PORT": "port",
69-
"HOLOGRES_USER": "access_id",
70-
"HOLOGRES_PASSWORD": "access_key",
71-
"HOLOGRES_DATABASE": "database"
72-
}
63+
{
64+
"mcpServers": {
65+
"hologres-mcp-server": {
66+
"command": "uv",
67+
"args": [
68+
"run",
69+
"--with",
70+
"hologres-mcp-server",
71+
"hologres-mcp-server"
72+
],
73+
"env": {
74+
"HOLOGRES_HOST": "host",
75+
"HOLOGRES_PORT": "port",
76+
"HOLOGRES_USER": "access_id",
77+
"HOLOGRES_PASSWORD": "access_key",
78+
"HOLOGRES_DATABASE": "database"
79+
}
80+
}
7381
}
74-
}
82+
}
83+
```
84+
Use uvx mode
85+
86+
```json
87+
{
88+
"mcpServers": {
89+
"hologres-mcp-server": {
90+
"command": "uvx",
91+
"args": [
92+
"hologres-mcp-server"
93+
],
94+
"env": {
95+
"HOLOGRES_HOST": "host",
96+
"HOLOGRES_PORT": "port",
97+
"HOLOGRES_USER": "access_id",
98+
"HOLOGRES_PASSWORD": "access_key",
99+
"HOLOGRES_DATABASE": "database"
100+
}
101+
}
102+
}
103+
}
75104
```
76105

77106
## Components
78107

79108
### Tools
80109

81-
* `execute_select_sql`: Execute a SELECT SQL query on the Hologres server
82-
* `execute_dml_sql`: Execute a DML (INSERT, UPDATE, DELETE) SQL query on the Hologres server
83-
* `execute_ddl_sql`: Execute a DDL (CREATE, ALTER, DROP) SQL query on the Hologres server
84-
* `gather_table_statistics`: Collect table statistics
85-
* `get_query_plan`: Get query plan
86-
* `get_execution_plan`: Get execution plan
110+
* `execute_hg_select_sql`: Execute a SELECT SQL query in Hologres database
111+
* `execute_hg_select_sql_with_serverless`: Execute a SELECT SQL query in Hologres database with serverless computing
112+
* `execute_hg_dml_sql`: Execute a DML (INSERT, UPDATE, DELETE) SQL query in Hologres database
113+
* `execute_hg_ddl_sql`: Execute a DDL (CREATE, ALTER, DROP, COMMENT ON) SQL query in Hologres database
114+
* `gather_hg_table_statistics`: Collect table statistics in Hologres database
115+
* `get_hg_query_plan`: Get query plan in Hologres database
116+
* `get_hg_execution_plan`: Get execution plan in Hologres database
117+
* `call_hg_procedure`: Invoke a procedure in Hologres database
118+
* `create_hg_maxcompute_foreign_table`: Create MaxCompute foreign tables in Hologres database.
119+
120+
Since some Agents do not support resources and resource templates, the following tools are provided to obtain the metadata of schemas, tables, views, and external tables.
121+
* `list_hg_schemas`: Lists all schemas in the current Hologres database, excluding system schemas.
122+
* `list_hg_tables_in_a_schema`: Lists all tables in a specific schema, including their types (table, view, external table, partitioned table).
123+
* `show_hg_table_ddl`: Show the DDL script of a table, view, or external table in the Hologres database.
87124

88125
### Resources
89126

90127
#### Built-in Resources
91128

92-
* `hologres:///schemas`: Get all schemas in the database
129+
* `hologres:///schemas`: Get all schemas in Hologres database
93130

94131
#### Resource Templates
95132

96-
* `hologres:///{schema}/tables`: List all tables in a schema
97-
* `hologres:///{schema}/{table}/partitions`: List all partitions of a partitioned table
98-
* `hologres:///{schema}/{table}/ddl`: Get table DDL
99-
* `hologres:///{schema}/{table}/statistic`: Show collected table statistics
133+
* `hologres:///{schema}/tables`: List all tables in a schema in Hologres database
134+
* `hologres:///{schema}/{table}/partitions`: List all partitions of a partitioned table in Hologres database
135+
* `hologres:///{schema}/{table}/ddl`: Get table DDL in Hologres database
136+
* `hologres:///{schema}/{table}/statistic`: Show collected table statistics in Hologres database
100137
* `system:///{+system_path}`:
101138
System paths include:
102139

103-
* missing_stats_tables - Shows the tables that are missing statistics.
104-
* stat_activity - Shows the information of current running queries.
105-
* query_log/latest/ - Get recent query log history with specified number of rows.
106-
* query_log/user// - Get query log history for a specific user with row limits.
107-
* query_log/application// - Get query log history for a specific application with row limits.
108-
* query_log/failed/\<interval>\/ - Get failed query log history with interval and specified number of rows.
140+
* `hg_instance_version` - Shows the hologres instance version.
141+
* `guc_value/` - Shows the guc (Grand Unified Configuration) value.
142+
* `missing_stats_tables` - Shows the tables that are missing statistics.
143+
* `stat_activity` - Shows the information of current running queries.
144+
* `query_log/latest/` - Get recent query log history with specified number of rows.
145+
* `query_log/user//` - Get query log history for a specific user with row limits.
146+
* `query_log/application//` - Get query log history for a specific application with row limits.
147+
* `query_log/failed//` - Get failed query log history with interval and specified number of rows.
109148

110149
### Prompts
111150

0 commit comments

Comments
 (0)