Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 45 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ MCP server for RDS Services via OPENAPI

```json5
{
"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"
}
}
}
"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"
}
}
}
}
```

Expand Down Expand Up @@ -79,19 +79,22 @@ git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
```
Add the following configuration to the MCP client configuration file:
```json5
"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
{
"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
}
}
}
}
Expand Down Expand Up @@ -141,10 +144,20 @@ Toolsets group available MCP tools so you can enable only what you need. Configu
- **Command line**: `--toolsets` parameter
- **Environment variable**: `MCP_TOOLSETS`

#### Available Toolsets

Here 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.

#### Format
Use comma-separated toolset names (no spaces around commas):
```
rds,rds_mssql_custom
rds,rds_custom_all
```

#### Examples
Expand All @@ -156,7 +169,7 @@ rds,rds_mssql_custom
--toolsets rds,rds_mssql_custom

# Environment variable
export MCP_TOOLSETS=rds,rds_mssql_custom
export MCP_TOOLSETS=rds,rds_custom_all
```

#### Default Behavior
Expand Down
8 changes: 8 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ git clone https://github.com/aliyun/alibabacloud-rds-openapi-mcp-server.git
rds,rds_mssql_custom
```

#### 可用工具集
以下是工具集及其功能的列表:

- **rds**:启用标准托管 RDS 服务的所有工具
- **rds_custom_read**:为 RDS Custom 启用只读工具
- **rds_custom_all**:为 RDS Custom 启用所有工具


#### 示例
```bash
# 单个工具集
Expand Down
13 changes: 11 additions & 2 deletions src/alibabacloud_rds_openapi_mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1522,10 +1522,19 @@ def main(toolsets: Optional[str] = None) -> None:


def _parse_groups_from_source(source: str | None) -> List[str]:
GROUP_EXPANSIONS = {
"rds_custom_all": ["rds_custom_read", "rds_custom_action"],
}
if not source:
return [DEFAULT_TOOL_GROUP]
groups = [g.strip() for g in source.split(",") if g.strip()]
return groups or [DEFAULT_TOOL_GROUP]
initial_groups = [g.strip() for g in source.split(",") if g.strip()]
expanded_groups = []
for group in initial_groups:
groups_to_add = GROUP_EXPANSIONS.get(group, [group])
for g_to_add in groups_to_add:
if g_to_add not in expanded_groups:
expanded_groups.append(g_to_add)
return expanded_groups or [DEFAULT_TOOL_GROUP]

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down
Loading