- Explore MCP Servers
- alibabacloud-adbpg-mcp-server
Alibabacloud Adbpg Mcp Server
What is Alibabacloud Adbpg Mcp Server
The AnalyticDB PostgreSQL MCP Server is a middleware that facilitates communication between AI agents and AnalyticDB PostgreSQL databases. It allows AI agents to retrieve metadata and execute SQL operations seamlessly.
Use cases
The server can be used in various scenarios including data analysis, reporting, real-time data retrieval, and executing complex SQL queries from AI-driven applications. It supports operations like SELECT, DML, and DDL on databases.
How to use
Users can set up the server in two modes: by downloading from GitHub or using pip for installation. Configuration involves adding details to the MCP client configuration file, including database connection parameters and specifying the command to run the server.
Key features
Key features include support for executing SELECT, DML, and DDL SQL queries, gathering table statistics, obtaining query execution plans, and accessing database schemas and tables through built-in resources and resource templates.
Where to use
The MCP Server is best utilized in environments where AI applications need to interact with PostgreSQL databases, such as in analytics platforms, business intelligence tools, and AI-based data processing systems.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Alibabacloud Adbpg Mcp Server
The AnalyticDB PostgreSQL MCP Server is a middleware that facilitates communication between AI agents and AnalyticDB PostgreSQL databases. It allows AI agents to retrieve metadata and execute SQL operations seamlessly.
Use cases
The server can be used in various scenarios including data analysis, reporting, real-time data retrieval, and executing complex SQL queries from AI-driven applications. It supports operations like SELECT, DML, and DDL on databases.
How to use
Users can set up the server in two modes: by downloading from GitHub or using pip for installation. Configuration involves adding details to the MCP client configuration file, including database connection parameters and specifying the command to run the server.
Key features
Key features include support for executing SELECT, DML, and DDL SQL queries, gathering table statistics, obtaining query execution plans, and accessing database schemas and tables through built-in resources and resource templates.
Where to use
The MCP Server is best utilized in environments where AI applications need to interact with PostgreSQL databases, such as in analytics platforms, business intelligence tools, and AI-based data processing systems.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
AnalyticDB PostgreSQL MCP Server
AnalyticDB PostgreSQL MCP Server serves as a universal interface between AI Agents and AnalyticDB PostgreSQL databases. It enables seamless communication between AI Agents and AnalyticDB PostgreSQL, helping AI Agents retrieve database metadata and execute SQL operations.
Configuration
Mode 1: Download
Download from Github
git clone https://github.com/aliyun/alibabacloud-adbpg-mcp-server.git
MCP Integration
Add the following configuration to the MCP client configuration file:
Mode 2: Using pip
pip install adbpg_mcp_server
MCP Integration
Components
Tools
execute_select_sql: Execute SELECT SQL queries on the AnalyticDB PostgreSQL serverexecute_dml_sql: Execute DML (INSERT, UPDATE, DELETE) SQL queries on the AnalyticDB PostgreSQL serverexecute_ddl_sql: Execute DDL (CREATE, ALTER, DROP) SQL queries on the AnalyticDB PostgreSQL serveranalyze_table: Collect table statisticsexplain_query: Get query execution plan
Resources
Built-in Resources
adbpg:///schemas: Get all schemas in the database
Resource Templates
adbpg:///{schema}/tables: List all tables in a specific schemaadbpg:///{schema}/{table}/ddl: Get table DDLadbpg:///{schema}/{table}/statistics: Show table statistics
Environment Variables
MCP Server requires the following environment variables to connect to AnalyticDB PostgreSQL instance:
ADBPG_HOST: Database host addressADBPG_PORT: Database portADBPG_USER: Database usernameADBPG_PASSWORD: Database passwordADBPG_DATABASE: Database name
Dependencies
- Python 3.10 or higher
- Required packages:
- mcp >= 1.4.0
- psycopg >= 3.1.0
- python-dotenv >= 1.0.0
- pydantic >= 2.0.0
Running
# Create and activate virtual environment
uv venv .venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
# Install dependencies
uv pip install -e .
# Run server
uv run adbpg-mcp-server
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










