Polardbx MCP Server

A Model Context Protocol (MCP) server which provides tools and resources, allowing AI agent to interact with Alibaba cloud PolarDB-X databases.

Local serverstdio

What is the Polardbx MCP server?

Most database access work still happens through a UI a human drives. Polardbx MCP server moves it into the conversation instead. A Model Context Protocol (MCP) server which provides tools and resources, allowing AI agent to interact with Alibaba cloud PolarDB-X databases.

The short version

  1. Install dependencies and build: bash npm install npm run build 3. Configure the PolarDB-X connection in environment variable file .env: POLARDB_X_HOST=your_database_host POLARDB_X_PORT=your_database_port POLARDB_X_USER=your_database_user POLARDB_X_PASSWORD=your_database_password POLARDB_X_DATABASE=your_database_name

Getting it running

Installation goes through your MCP client rather than a global install: point it at polardbx-mcp on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

The tools it exposes

The server publishes 3 tools. What each one is for:

  • query — Run a SQL query on PolarDB-X
  • Tools — The Tools tool exposed by this server
  • Resources — The server provides schema information for each table in the database: - Table Schemas (polardbx://<database_name>/<table_name>) - JSON schema

What it needs from you

Configuration is passed through the environment: POLARDB_X_HOST, POLARDB_X_PORT, POLARDB_X_USER, POLARDB_X_PASSWORD, POLARDB_X_DATABASE. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Polardbx's toolset — query, Tools, Resources — is a fair guide to whether it matches your workflow. It is maintained by aliyun; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Polardbx's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
queryRun a SQL query on PolarDB-X
ToolsThe Tools tool exposed by this server.
ResourcesThe server provides schema information for each table in the database: - Table Schemas (polardbx://<database_name>/<table_name>) - JSON schema information for each table - Includes column names and data types

How to install the Polardbx MCP server

{
  "mcpServers": {
    "alibabacloud-polardbx": {
      "command": "npx",
      "args": ["-y", "polardbx-mcp"],
      "env": {
        "POLARDB_X_HOST": "your-value",
        "POLARDB_X_PORT": "your-value",
        "POLARDB_X_USER": "your-value",
        "POLARDB_X_PASSWORD": "your-value",
        "POLARDB_X_DATABASE": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
POLARDB_X_HOSTEndpoint or connection string the server talks to.Optional
POLARDB_X_PORTConfiguration value read at startup.Optional
POLARDB_X_USERConfiguration value read at startup.Optional
POLARDB_X_PASSWORDConfiguration value read at startup.Optional
POLARDB_X_DATABASEConfiguration value read at startup.Optional

Example prompts to try

  • Use Polardbx to query.
  • Use Polardbx to Tools.
  • Use Polardbx to Resources.

Frequently asked questions

It provides three tools: `query` to run SQL, `inspect database status` to check database state, and `show all commands` to list all PolarDB-X SQL commands.