Alibaba PolarDB

v1.0.0Databasesstable

MCP Servers to access PolarDB.

alibabacloud-polardbmcpai-integration
Share:
15
Stars
0
Downloads
0
Weekly
0/5

What is Alibaba PolarDB?

Alibaba PolarDB is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp servers to access polardb.

MCP Servers to access PolarDB.

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP Servers to access PolarDB.

Use Cases

Access and manage Alibaba Cloud PolarDB databases.
aliyun

Maintainer

LicenseApache-2.0
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx alibabacloud-polardb

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Alibaba PolarDB

The Alibaba Cloud PolarDB MCP Server provides three MCP server implementations — for PolarDB MySQL, PolarDB PostgreSQL, and the PolarDB OpenAPI — giving AI agents direct access to Alibaba Cloud's cloud-native relational database service. The MySQL and PostgreSQL servers support natural language to SQL conversion, text-to-chart generation, custom model creation, and document search, while the OpenAPI server enables management-plane operations. Teams running workloads on PolarDB can use these servers to let AI assistants query, analyze, and manage their databases through conversation.

Prerequisites

  • Python 3.10 or higher (3.12 recommended) with the uv package manager installed
  • A running Alibaba Cloud PolarDB instance (MySQL or PostgreSQL) with network access from your machine
  • Database credentials: host, port, username, password, and database name
  • An MCP-compatible client such as Claude Desktop
1

Clone the repository

Clone the alibabacloud-polardb-mcp-server monorepo and navigate to the server variant you need.

git clone https://github.com/aliyun/alibabacloud-polardb-mcp-server.git
cd alibabacloud-polardb-mcp-server/polardb-mysql-mcp-server
2

Create a virtual environment and install dependencies

Use uv to create and activate a virtual environment, then install the required Python packages.

uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
3

Configure environment variables

Copy the example env file and fill in your PolarDB connection details. Set operation toggles to true only if you need write access.

cp .env_example .env
# Edit .env:
# POLARDB_MYSQL_HOST=rm-xxxx.mysql.rds.aliyuncs.com
# POLARDB_MYSQL_PORT=3306
# POLARDB_MYSQL_USER=your_user
# POLARDB_MYSQL_PASSWORD=your_password
# POLARDB_MYSQL_DATABASE=your_database
# POLARDB_MYSQL_ENABLE_UPDATE=false
# POLARDB_MYSQL_ENABLE_DELETE=false
# POLARDB_MYSQL_ENABLE_INSERT=false
# POLARDB_MYSQL_ENABLE_DDL=false
# RUN_MODE=stdio
4

Test the server locally

Run the server directly to confirm it connects to your PolarDB instance without errors.

uv run src/polardb_mysql_mcp_server/server.py
5

Configure Claude Desktop to use the server

Add the server to your Claude Desktop MCP config, passing connection details as environment variables.

{
  "mcpServers": {
    "polardb-mysql": {
      "command": "uv",
      "args": ["run", "/path/to/polardb-mysql-mcp-server/src/polardb_mysql_mcp_server/server.py"],
      "env": {
        "POLARDB_MYSQL_HOST": "rm-xxxx.mysql.rds.aliyuncs.com",
        "POLARDB_MYSQL_PORT": "3306",
        "POLARDB_MYSQL_USER": "your_user",
        "POLARDB_MYSQL_PASSWORD": "your_password",
        "POLARDB_MYSQL_DATABASE": "your_database",
        "RUN_MODE": "stdio"
      }
    }
  }
}

Alibaba PolarDB Examples

Client configuration

Claude Desktop MCP config for the PolarDB MySQL server with read-only access.

{
  "mcpServers": {
    "polardb-mysql": {
      "command": "uv",
      "args": ["run", "/home/user/alibabacloud-polardb-mcp-server/polardb-mysql-mcp-server/src/polardb_mysql_mcp_server/server.py"],
      "env": {
        "POLARDB_MYSQL_HOST": "rm-xxxx.mysql.rds.aliyuncs.com",
        "POLARDB_MYSQL_PORT": "3306",
        "POLARDB_MYSQL_USER": "readonly_user",
        "POLARDB_MYSQL_PASSWORD": "your_password",
        "POLARDB_MYSQL_DATABASE": "production_db",
        "POLARDB_MYSQL_ENABLE_UPDATE": "false",
        "POLARDB_MYSQL_ENABLE_DELETE": "false",
        "POLARDB_MYSQL_ENABLE_INSERT": "false",
        "POLARDB_MYSQL_ENABLE_DDL": "false",
        "RUN_MODE": "stdio"
      }
    }
  }
}

Prompts to try

Example prompts for interacting with PolarDB through an AI client.

- "List all tables in the production_db database and describe their schemas."
- "How many orders were placed in the last 7 days? Group by status."
- "Generate a chart showing daily revenue for the past 30 days from the orders table."
- "Find the top 10 customers by total spend in the customers and orders tables."
- "What indexes exist on the users table and are there any missing indexes I should add?"

Troubleshooting Alibaba PolarDB

Connection refused or timeout when starting the server

Verify that your PolarDB instance's whitelist includes your machine's public IP address. In the Alibaba Cloud console, go to your PolarDB cluster, then Security > Whitelist, and add your IP.

POLARDB_MYSQL_ENABLE_UPDATE is false but the AI still attempts write operations

The enable flags restrict the server from exposing write tools. Confirm the env vars are correctly set in your MCP config's env block (not just in your shell). Restart your MCP client after changing them.

uv command not found when Claude Desktop tries to start the server

Install uv globally with: curl -LsSf https://astral.sh/uv/install.sh | sh and ensure ~/.cargo/bin or ~/.local/bin (where uv installs) is in the system PATH that Claude Desktop inherits.

Frequently Asked Questions about Alibaba PolarDB

What is Alibaba PolarDB?

Alibaba PolarDB is a Model Context Protocol (MCP) server that mcp servers to access polardb. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Alibaba PolarDB?

Follow the installation instructions on the Alibaba PolarDB GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Alibaba PolarDB?

Alibaba PolarDB works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Alibaba PolarDB free to use?

Yes, Alibaba PolarDB is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "alibabacloud-polardb": { "command": "npx", "args": ["-y", "alibabacloud-polardb"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Alibaba PolarDB?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides