Alibaba Cloud AnalyticDB for PostgreSQL

Alibaba Cloud AnalyticDB for PostgreSQL

An MCP server to connect to AnalyticDB for PostgreSQL instances, query and analyze data.

10
Stars
3
Forks
0
Releases

Overview

AnalyticDB PostgreSQL MCP Server provides a universal interface between AI agents and AnalyticDB PostgreSQL databases, enabling seamless communication to retrieve database metadata and execute SQL operations. It can be installed from source for development or from PyPI for production use. The server supports two transport modes: stdio (default) for MCP client integration and streamable HTTP for REST-based access, testing, or debugging. To connect to AnalyticDB PostgreSQL, you must configure environment variables such as ADBPG_HOST, ADBPG_PORT, ADBPG_USER, ADBPG_PASSWORD, and ADBPG_DATABASE, and to initialize graphRAG and LLM memory services, API_KEY, BASE_URL, LLM_MODEL, and EMBEDDING_MODEL. The MCP server exposes a set of built-in tools for executing queries and managing knowledge graphs and memories, including SELECT, DML, and DDL SQL execution, table statistics collection, and query explanation. Graphrag integration supports uploading text content to build knowledge graphs and querying them, while LLM memory endpoints enable storing and retrieving long-term memories. The README also provides MCP client integration examples for stdio and HTTP transports and related environment variables.

Details

Owner
aliyun
Language
Python
License
Apache License 2.0
Updated
2025-12-07

Features

execute_select_sql

Execute SELECT SQL queries on the AnalyticDB PostgreSQL server

execute_dml_sql

Execute DML (INSERT, UPDATE, DELETE) SQL queries on the AnalyticDB PostgreSQL server

execute_ddl_sql

Execute DDL (CREATE, ALTER, DROP) SQL queries on the AnalyticDB PostgreSQL server

analyze_table

Collect table statistics

explain_query

Get query execution plan

adbpg_graphrag_upload

Upload a text file (with its name) and file content to graphrag to generate a knowledge graph.

adbpg_graphrag_query

Query the graphrag using the specified query string and mode.

adbpg_llm_memory_add

Add LLM long memory.

Audience

AI agentsConnect to AnalyticDB PostgreSQL; query metadata and run SQL via the MCP server.
DevelopersIntegrate the MCP server into applications, configure transports and environment variables for deployment.

Tags

AnalyticDBPostgreSQLMCPAI agentsSQLdatabase metadatagraphragllm memory