by aliyun
Provides RDS service operations via OpenAPI, exposing tools for managing instances, querying metrics, and executing read‑only SQL through an MCP server.
Enables interaction with Alibaba Cloud Relational Database Service (RDS) via an MCP (Model Context Protocol) server. The server wraps dozens of OpenAPI actions and read‑only SQL utilities as callable tools, allowing AI assistants or CLI clients to manage RDS instances, query performance data, modify configurations, and run diagnostic SQL without direct human intervention.
Prerequisites
uv python install 3.12).Quick start with Cherry‑Studio (recommended)
uv is available.{
"mcpServers": {
"rds-openapi": {
"name": "rds-openapi",
"type": "stdio",
"command": "uvx",
"args": ["alibabacloud-rds-openapi-mcp-server@latest"],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "$you_access_id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "$you_access_key"
}
}
}
}
Running from the command line (Cline)
export SERVER_TRANSPORT=sse
export ALIBABA_CLOUD_ACCESS_KEY_ID=$you_access_id
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=$you_access_key
# optional STS token
export ALIBABA_CLOUD_SECURITY_TOKEN=$you_sts_security_token
# optional API key for server authentication
export API_KEY=$you_mcp_server_api_key
uvx alibabacloud-rds-openapi-mcp-server@latest
The server starts on http://0.0.0.0:8000 and can be referenced in Cline as remote_server = "http://127.0.0.1:8000/sse".
Running from source (Claude / manual)
git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
cd alibabacloud-rds-openapi-mcp-server
uvx alibabacloud-rds-openapi-mcp-server@latest
Or configure the MCP client with a custom command pointing to src/alibabacloud_rds_openapi_mcp_server/server.py and the same environment variables.
create_db_instance, describe_db_instances, modify_db_instance_spec, describe_monitor_metrics, describe_error_logs).explain_sql, show_engine_innodb_status, show_create_table, query_sql.rds (default), rds_custom_read, rds_custom_all.EXPLAIN or SHOW ENGINE INNODB STATUS via the server to aid troubleshooting.Q: Which environment variables are required?
ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are mandatory. ALIBABA_CLOUD_SECURITY_TOKEN is optional for temporary STS credentials. API_KEY is optional and, if set, the server will enforce API‑Key authentication.Q: I get 401 Incorrect API key provided when using Qwen.
API_KEY value matches the key configured in the MCP client, or remove the variable if you do not need API‑Key protection.Q: How do I limit the server to read‑only operations?
rds_custom_read toolset (--toolsets rds_custom_read or MCP_TOOLSETS=rds_custom_read). This loads only the SQL query and diagnostic tools without any write‑capable actions.Q: Can I run the server on a custom port?
UVICORN_PORT (or PORT) environment variable before starting the server.Q: Is there a Docker image?
uv and running the same uvx alibabacloud-rds-openapi-mcp-server@latest command inside the container.MCP server for RDS Services via OPENAPI
uv from Astral or the GitHub READMEuv python install 3.12The following error may appear during import, which can be ignored: xxx settings.mcp.addServer.importFrom.connectionFailed
{
"mcpServers": {
"rds-openapi": {
"name": "rds-openapi",
"type": "stdio",
"description": "",
"isActive": true,
"registryUrl": "",
"command": "uvx",
"args": [
"alibabacloud-rds-openapi-mcp-server@latest"
],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "$you_access_id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "$you_access_key"
}
}
}
}
Finally, click to turn on MCP
You can use the prompt template provided below to enhance your experience.
Set you env and run mcp server.
# set env
export SERVER_TRANSPORT=sse;
export ALIBABA_CLOUD_ACCESS_KEY_ID=$you_access_id;
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=$you_access_key;
export ALIBABA_CLOUD_SECURITY_TOKEN=$you_sts_security_token; # optional, required when using STS Token
export API_KEY=$you_mcp_server_api_key; # Optional, after configuration, requests will undergo API Key authentication.
# run mcp server
uvx alibabacloud-rds-openapi-mcp-server@latest
After run mcp server, you will see the following output:
INFO: Started server process [91594]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
And then configure the Cline.
remote_server = "http://127.0.0.1:8000/sse";
If you encounter a
401 Incorrect API key providederror when using Qwen, please refer to the documentation for solutions.
Download from Github
git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
Add the following configuration to the MCP client configuration file:
{
"mcpServers": {
"rds-openapi-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/alibabacloud-rds-openapi-mcp-server/src/alibabacloud_rds_openapi_mcp_server",
"run",
"server.py"
],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "access_id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "access_key",
"ALIBABA_CLOUD_SECURITY_TOKEN": "sts_security_token",
// optional, required when using STS Token
}
}
}
}
add_tags_to_db_instance: Add tags to an RDS instance.allocate_instance_public_connection: Allocate a public connection for an RDS instance.attach_whitelist_template_to_instance: Attach a whitelist template to an RDS instance.create_db_instance: Create an RDS instance.create_db_instance_account: Create an account for RDS instance.describe_all_whitelist_template: Query the whitelist template list.describe_available_classes: Query available instance classes and storage ranges.describe_available_zones: Query available zones for RDS instances.describe_bills: Query the consumption summary of all product instances or billing items for a user within a specific billing period.describe_db_instance_accounts: Batch retrieves account information for multiple RDS instances.describe_db_instance_attribute: Queries the details of an instance.describe_db_instance_databases: Batch retrieves database information for multiple RDS instances.describe_db_instance_ip_allowlist: Batch retrieves IP allowlist configurations for multiple RDS instances.describe_db_instance_net_info: Batch retrieves network configuration details for multiple RDS instances.describe_db_instance_parameters: Batch retrieves parameter information for multiple RDS instances.describe_db_instance_performance: Queries the performance data of an instance.describe_db_instances: Queries instances.describe_error_logs: Queries the error log of an instance.describe_instance_linked_whitelist_template: Query the whitelist template list.describe_monitor_metrics: Queries performance and diagnostic metrics for an instance using the DAS (Database Autonomy Service) API.describe_slow_log_records: Query slow log records for an RDS instance.describe_sql_insight_statistic: Query SQL Log statistics, including SQL cost time, execution times, and account.describe_vpcs: Query VPC list.describe_vswitches: Query VSwitch list.modify_security_ips: Modify RDS instance security IP whitelist.get_current_time: Get the current time.modify_db_instance_description: Modify RDS instance descriptions.modify_db_instance_spec: Modify RDS instance specifications.modify_parameter: Modify RDS instance parameters.restart_db_instance: Restart an RDS instance.The MCP Server will automatically create a read-only account, execute the SQL statement, and then automatically delete the account. This process requires that the MCP Server can connect to the instance.
explain_sql: Execute sql explain and return sql result.show_engine_innodb_status: Execute sql show engine innodb status and return sql result.show_create_table: Execute sql show create table and return sql result.query_sql: Execute read-only sql and return sql result.Toolsets group available MCP tools so you can enable only what you need. Configure toolsets when starting the server using either:
--toolsets parameterMCP_TOOLSETSHere is a list of toolsets and their functions:
rds: Enables all tools for the standard, managed RDS service
rds_custom_read: Enables read-only tools for the RDS Custom.
rds_custom_all: Enables full read and write tools for the RDS Custom.
Use comma-separated toolset names (no spaces around commas):
rds,rds_custom_all
# Single toolset
--toolsets rds
# Multiple tools
--toolsets rds,rds_mssql_custom
# Environment variable
export MCP_TOOLSETS=rds,rds_custom_all
If no toolset is specified, the default rds group is loaded automatically.
None at this time
# Role
You are a professional Alibaba Cloud RDS Copilot, specializing in providing customers with efficient technical support and solutions for RDS (Relational Database Service). Your goal is to help customers resolve issues quickly through clear problem decomposition, precise tool invocation, and accurate time calculations.
## Skills
### Skill 1: Problem Decomposition and Analysis
- Deeply deconstruct user questions to identify core requirements and potential steps/commands involved.
- Provide clear task breakdowns to ensure each step contributes to the final solution.
- Please organize your answers in a table format as much as possible.
### Skill 2: RDS MCP Tool Invocation
- Proficiently invoke the RDS MCP tool to retrieve database information or execute operations.
- Tool invocation must follow task decomposition and align with logical reasoning and customer needs.
- Select appropriate MCP modules (e.g., monitoring data queries, performance diagnostics, backup/recovery) based on user requirements.
### Skill 3: Time Interpretation and Calculation
- Accurately parse relative time concepts like "today," "yesterday," or "the last hour."
- Convert relative time expressions into precise time ranges or timestamps using the current time to support data queries or operations.
## Constraints
- **Task Decomposition First**: Always provide detailed task breakdowns.
- **Tool Dependency Clarity**: All MCP tool invocations must be justified by clear task requirements and logical reasoning.
- **Time Precision**: Calculate exact time ranges for time-sensitive queries.
- **Professional Focus**: Discuss only Alibaba Cloud RDS-related technical topics.
- **Safety Awareness**: Ensure no operations negatively impact customer databases.
Alibaba Cloud Database MyDBA Agent(README.md)
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the Apache 2.0 License.
For any questions or concerns, please contact us through the DingTalk group:106730017609
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by neo4j-contrib
Enables natural‑language interaction with Neo4j databases, allowing large language models to query, modify, and manage graph data through multiple transport modes.
by mongodb-js
Provides a Model Context Protocol server that enables interaction with MongoDB databases and MongoDB Atlas clusters through a unified API.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by neondatabase
Interact with Neon Postgres databases using natural language commands through the Model Context Protocol, enabling conversational database creation, migration, and query execution.
by motherduckdb
Enables SQL analytics on DuckDB and MotherDuck databases via a Model Context Protocol server, allowing AI assistants and IDEs to query data directly.