- Home
- MCP servers
- Polardbx
Polardbx
- javascript
4
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"aliyun-alibabacloud-polardbx-mcp-server": {
"command": "npx",
"args": [
"polardbx-mcp"
],
"env": {
"POLARDB_X_HOST": "db.polardbx.example.com",
"POLARDB_X_PORT": "3306",
"POLARDB_X_USER": "mcp_user",
"POLARDB_X_DATABASE": "my_database",
"POLARDB_X_PASSWORD": "YOUR_PASSWORD"
}
}
}
}You can run the polardbx-mcp server to let an AI agent interact with PolarDB-X databases. It provides tools to execute queries, inspect database status, and retrieve table schemas, enabling dynamic, data-driven actions against PolarDB-X.
How to use
To use the server with an MCP client, start the MCP server in your chosen installation mode, then configure an MCP client to connect via the provided runtime command. You will typically run the server locally and point the client at the appropriate command that launches the MCP process.
How to install
Prerequisites: Node.js and npm must be installed on your system.
Option 1 Install from npm globally or in your project
# Install globally
npm install -g polardbx-mcp
# Or install in current project only
npm install polardbx-mcp
Option 2 Build from source
-
Clone the repository
-
Install dependencies and build
npm install
npm run build
- Configure the PolarDB-X connection in an environment file with these variables
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 configuration and examples
Configure your MCP client to launch the MCP server as shown below. You can choose either the npm-based approach or the direct build-from-source approach.
{
"mcpServers": {
"polardbx_mcp": {
"command": "npx",
"args": [
"polardbx-mcp"
],
"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"
}
}
}
}
Security and environment considerations
Keep your database credentials secure. Use environment variables to pass sensitive information to the MCP runtime and avoid hard-coding credentials in config files.
Available tools
query
Execute a SQL query against PolarDB-X and return results.
inspect database status
Retrieve current status information for PolarDB-X, including health, connections, and resource usage.
show all commands
List all available SQL commands and endpoints supported by PolarDB-X for MCP interactions.