阿里云 RDS OpenAPI MCP 服务器
通过 OPENAPI 为 RDS 服务提供 MCP 服务器
先决条件
- 从Astral或GitHub README安装
uv
- 使用
uv python install 3.12
安装 Python - 可以访问阿里云 RDS 服务的阿里云凭证
快速入门
按照Cherry-Studio 的文档安装 MCP 环境,然后配置并使用 RDS MCP。在 MCP 客户端配置文件中添加以下配置:
"mcpServers": {
"rds-openapi-mcp-server": {
"command": "uvx",
"args": [
"alibabacloud-rds-openapi-mcp-server@latest"
],
"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
}
}
}
使用 Cline
设置您的环境并运行 mcp 服务器。
# 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
# run mcp server
uvx alibabacloud-rds-openapi-mcp-server@latest
运行 mcp server 后,你会看到以下输出:
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)
然后配置Cline。
remote_server = "http://127.0.0.1:8000/sse";
使用 Claude
从 Github 下载
git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
在MCP客户端配置文件中添加如下配置:
"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
}
}
}
成分
工具
create_db_instance
:创建一个 RDS 实例。describe_db_instances
:查询实例。describe_db_instance_attribute
:查询实例的详细信息。describe_db_instance_performance
:查询实例的性能数据。describe_error_logs
:查询实例的错误日志。describe_db_instance_net_info
:批量检索多个 RDS 实例的网络配置详细信息。describe_db_instance_ip_allowlist
:批量检索多个 RDS 实例的 IP 允许列表配置。describe_db_instance_databases
:批量检索多个 RDS 实例的数据库信息。describe_db_instance_accounts
:批量检索多个 RDS 实例的帐户信息。describe_available_classes
:查询可用的实例类和存储范围。describe_available_zones
:查询 RDS 实例的可用区域。describe_bills
:查询用户在特定计费周期内所有产品实例或计费项的消费汇总。describe_vpcs
:查询VPC列表。describe_vswitches
:查询VSwitch列表。describe_slow_log_records
:查询 RDS 实例的慢日志记录。describe_db_instance_parameters
:批量检索多个 RDS 实例的参数信息。modify_parameter
:修改RDS实例参数。modify_db_instance_spec
:修改RDS实例规格。get_current_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.
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
- 分叉存储库
- 创建你的功能分支(
git checkout -b feature/amazing-feature
) - 提交您的更改(
git commit -m 'Add some amazing feature'
) - 推送到分支(
git push origin feature/amazing-feature
) - 打开拉取请求
执照
该项目采用 Apache 2.0 许可证授权。