Get the FREE Ultimate OpenClaw Setup Guide →

alibabacloud-adbpg

MCP server from aliyun/alibabacloud-adbpg-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio aliyun-alibabacloud-adbpg-mcp-server uv run adbpg-mcp-server --transport stdio \
  --env ADBPG_HOST="host" \
  --env ADBPG_PORT="port" \
  --env ADBPG_USER="username" \
  --env ADBPG_DATABASE="database" \
  --env ADBPG_PASSWORD="password" \
  --env GRAPHRAG_API_KEY="graphrag llm api key" \
  --env LLMEMORY_API_KEY="llm memory api_key" \
  --env GRAPHRAG_BASE_URL="graphrag llm base url" \
  --env LLMEMORY_BASE_URL="llm memory base_url" \
  --env GRAPHRAG_LLM_MODEL="graphrag llm model name" \
  --env LLMEMORY_LLM_MODEL="llm memory model name" \
  --env LLMEMORY_ENABLE_GRAPH="enable graph engine for llm memory (Default: false)" \
  --env GRAPHRAG_EMBEDDING_MODEL="graphrag embedding model name" \
  --env LLMEMORY_EMBEDDING_MODEL="llm memory embedding model name" \
  --env GRAPHRAG_EMBEDDING_API_KEY="graphrag embedding api key" \
  --env GRAPHRAG_EMBEDDING_BASE_URL="graphrag embedding url"

How to use

This MCP server provides a universal interface for AnalyticDB PostgreSQL (ADB PostgreSQL) databases, enabling AI agents to discover metadata and execute SQL operations via a consistent protocol. It exposes a set of tools for common database tasks, including executing SELECT, DML, and DDL statements, collecting table statistics, and retrieving query execution plans. Additionally, it offers Graphrag-based capabilities for knowledge graph generation and advanced memory-enabled interactions through the llm memory subsystem. You can run the server in stdio mode for MCP client integrations or enable an HTTP interface for direct REST-style access and debugging. To integrate with a parent MCP client, configure the mcpServers entry with the appropriate transport and environment variables. The available tools include execute_select_sql, execute_dml_sql, execute_ddl_sql, analyze_table, explain_query, and Graphrag-related commands such as adbpg_graphrag_upload, adbpg_graphrag_query, and memory management actions like adbpg_llm_memory_add and adbpg_llm_memory_get_all.

How to install

Prerequisites:

  • Python 3.8+ installed
  • Optional: virtual environment tools (uv) if you plan to use uv for running in a development setup

Option 1: From Source (Development)

# 1. Clone the repository
git clone https://github.com/aliyun/alibabacloud-adbpg-mcp-server.git
cd alibabacloud-adbpg-mcp-server

# 2. Create and activate a virtual environment using uv
uv venv .venv
source .venv/bin/activate  # Linux/macOS
# Windows: .\venv\Scripts\activate

# 3. Install the project in editable mode
uv pip install -e .

Option 2: From PyPI (Production/Usage)

pip install adbpg-mcp-server

Notes:

  • Ensure that the required environment variables (ADBPG_, GRAPHRAG_, LLMEMORY_*) are set before running the server.
  • If using HTTP transport, ensure the host/port are accessible and not blocked by firewalls.

Additional notes

Tips and common issues:

  • When using stdio transport, ensure MCP clients pass the correct JSON-RPC like messages. The default transport is stdio; you can override with --transport http for REST-style access.
  • Set ADBPG_HOST, ADBPG_PORT, ADBPG_USER, ADBPG_PASSWORD, and ADBPG_DATABASE to connect to your AnalyticDB PostgreSQL instance.
  • Graphrag-related env vars enable knowledge-graph generation and querying; configure API keys, base URLs, and model names as needed.
  • LLM memory settings control persistent memory across sessions; at least one of user_id, run_id, or agent_id should be provided when storing memory.
  • If you encounter port conflicts on HTTP mode, specify a different host/port with --host and --port when starting the server.
  • For development, using the source installation allows you to modify the server behavior; for production, prefer the PyPI package with proper environment configuration.

Related MCP Servers

Sponsor this space

Reach thousands of developers