alibabacloud-polardbx
A Model Context Protocol (MCP) server which provides tools and resources, allowing AI agent to interact with Alibaba cloud PolarDB-X databases.
claude mcp add --transport stdio aliyun-alibabacloud-polardbx-mcp-server npx polardbx-mcp \ --env POLARDB_X_HOST="your_database_host" \ --env POLARDB_X_PORT="your_database_port" \ --env POLARDB_X_USER="your_database_user" \ --env POLARDB_X_DATABASE="your_database_name" \ --env POLARDB_X_PASSWORD="your_database_password"
How to use
This MCP server provides tools to interact with Alibaba Cloud PolarDB-X databases. It exposes capabilities to run SQL queries against PolarDB-X, inspect the database status, and list all available commands for PolarDB-X. The server also serves schema information for each table, presenting JSON-formatted table schemas that include column names and data types. To use it, configure the MCP client to point at this server entry (polardbx-mcp) and supply the required database connection details via environment variables. Once running, you can invoke the supported tools to query data, check health and status, and explore table schemas.
How to install
Prerequisites:
- Node.js and npm installed
- Access to a PolarDB-X instance and credentials
Option 1: Install from npm
-
Install globally: npm install -g polardbx-mcp
-
Or install in current project only: npm install polardbx-mcp
Option 2: Build from source
-
Clone this repository: git clone https://github.com/your-repo/aliyun-alibabacloud-polardbx-mcp-server.git cd aliyun-alibabacloud-polardbx-mcp-server
-
Install dependencies and build: npm install npm run build
-
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
-
Start the server: npm start
Additional notes
Environment variables: The server relies on POLARDB_X_HOST, POLARDB_X_PORT, POLARDB_X_USER, POLARDB_X_PASSWORD, and POLARDB_X_DATABASE to connect to PolarDB-X. You can place these in a .env file or export them in your shell before starting. If you run the npm-based approach, you can also provide these via the env block in the MCP configuration as shown in the mcp_config example. Common issues include networking access to the PolarDB-X host, incorrect port, or mismatched credentials. Ensure your PolarDB-X instance accepts connections from the MCP server host and that SSL/TLS settings (if any) are correctly configured. The server exposes tools to run SQL (query), inspect database status, and show all commands available to PolarDB-X, along with schema information for tables at polardbx://<database_name>/<table_name>.
Related MCP Servers
any-chat-completions
MCP Server for using any LLM as a Tool
bitbucket
Bitbucket MCP - A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities
unity-editor
An MCP server and client for LLMs to interact with Unity Projects
website-publisher
AI Website builder and publisher MCP. Quickly publish and deploy your AI generated code as real website URL. Support html, css, js, python etc.
xgmem
Global Memory MCP server, that manage all projects data.