Skip to main content

ADBPG MCP Server

Project description

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

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:

"mcpServers": {
  "adbpg-mcp-server": {
    "command": "uv",
    "args": [
      "--directory",
      "/path/to/adbpg-mcp-server",
      "run",
      "adbpg-mcp-server"
    ],
    "env": {
      "ADBPG_HOST": "host",
      "ADBPG_PORT": "port",
      "ADBPG_USER": "username",
      "ADBPG_PASSWORD": "password",
      "ADBPG_DATABASE": "database"
    }
  }
}

Components

Tools

  • 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

Resources

Built-in Resources

  • adbpg:///schemas: Get all schemas in the database

Resource Templates

  • adbpg:///{schema}/tables: List all tables in a specific schema
  • adbpg:///{schema}/{table}/ddl: Get table DDL
  • adbpg:///{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 address
  • ADBPG_PORT: Database port
  • ADBPG_USER: Database username
  • ADBPG_PASSWORD: Database password
  • ADBPG_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adbpg_mcp_server-1.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adbpg_mcp_server-1.0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file adbpg_mcp_server-1.0.2.tar.gz.

File metadata

  • Download URL: adbpg_mcp_server-1.0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for adbpg_mcp_server-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7b9ef3494fc5ff5eba21ca9286c4cae2f4191b62c3f1698bea3e8ccb6472ddba
MD5 d981b1b67f1811dd21763b1ff32f794f
BLAKE2b-256 cb851c54477232a20b6d1144f8b8ac27b3e684ce26dacd1d31e50d0c439dd61d

See more details on using hashes here.

File details

Details for the file adbpg_mcp_server-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for adbpg_mcp_server-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e1a303d07baa677cbd820224b79b55cdb8d20c85d35c72c6d4589359be3b2525
MD5 489198b00846712e2186cf9621d7d829
BLAKE2b-256 95a15134281e7d3a783c22e21c006d13387f195746c9c0399314f9afee592e0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page