alibaba-cloud-ops-mcp-server 0.8.7__py3-none-any.whl → 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- alibaba_cloud_ops_mcp_server/alibabacloud/api_meta_client.py +12 -3
- alibaba_cloud_ops_mcp_server/alibabacloud/static/PROMPT_UNDERSTANDING.md +134 -0
- alibaba_cloud_ops_mcp_server/alibabacloud/static/__init__.py +8 -0
- alibaba_cloud_ops_mcp_server/server.py +37 -3
- alibaba_cloud_ops_mcp_server/tools/api_tools.py +55 -5
- alibaba_cloud_ops_mcp_server/tools/common_api_tools.py +74 -0
- {alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/METADATA +8 -3
- {alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/RECORD +11 -8
- {alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/WHEEL +0 -0
- {alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/entry_points.txt +0 -0
- {alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -30,12 +30,13 @@ class ApiMetaClient:
|
|
|
30
30
|
|
|
31
31
|
@classmethod
|
|
32
32
|
def get_response_from_pop_api(cls, pop_api_name, service=None, api=None, version=None):
|
|
33
|
+
url = None # 提前定义,防止 except 中引用未定义变量
|
|
33
34
|
try:
|
|
34
35
|
api_config = cls.config.get(pop_api_name)
|
|
35
36
|
try:
|
|
36
37
|
formatted_path = api_config[cls.PATH].format(service=service, api=api, version=version)
|
|
37
38
|
except KeyError as e:
|
|
38
|
-
raise Exception(f'Failed to format path, path: {api_config
|
|
39
|
+
raise Exception(f'Failed to format path, path: {api_config.get(cls.PATH)}, error: {e}')
|
|
39
40
|
|
|
40
41
|
url = f'{cls.BASE_URL}/{formatted_path}'
|
|
41
42
|
response = requests.get(url)
|
|
@@ -46,9 +47,16 @@ class ApiMetaClient:
|
|
|
46
47
|
@classmethod
|
|
47
48
|
def get_service_version(cls, service):
|
|
48
49
|
data = cls.get_response_from_pop_api(cls.GET_PRODUCT_LIST)
|
|
49
|
-
version = next((item.get(DEFAULT_VERSION) for item in data if item.get(CODE).lower() == service), None)
|
|
50
|
+
version = next((item.get(DEFAULT_VERSION) for item in data if item.get(CODE).lower() == service.lower()), None)
|
|
50
51
|
return version
|
|
51
52
|
|
|
53
|
+
@classmethod
|
|
54
|
+
def get_all_service_info(cls):
|
|
55
|
+
data = cls.get_response_from_pop_api(cls.GET_PRODUCT_LIST)
|
|
56
|
+
filtered_data = [{"code": item["code"], "name": item["name"]} for item in data]
|
|
57
|
+
|
|
58
|
+
return filtered_data
|
|
59
|
+
|
|
52
60
|
@classmethod
|
|
53
61
|
def get_service_style(cls, service):
|
|
54
62
|
data = cls.get_response_from_pop_api(cls.GET_PRODUCT_LIST)
|
|
@@ -146,7 +154,8 @@ class ApiMetaClient:
|
|
|
146
154
|
return combined_params
|
|
147
155
|
|
|
148
156
|
@classmethod
|
|
149
|
-
def get_apis_in_service(cls, service
|
|
157
|
+
def get_apis_in_service(cls, service):
|
|
158
|
+
version = cls.get_service_version(service)
|
|
150
159
|
data = cls.get_response_from_pop_api(cls.GET_API_OVERVIEW, service=service, version=version)
|
|
151
160
|
apis = list(data[APIS].keys())
|
|
152
161
|
return apis
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
## Optimized Prompt
|
|
2
|
+
|
|
3
|
+
When a user submits a request, analyze their needs and check if matching tools exist. If yes, use them directly. If not, proceed to the retrieval phase.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Request Flow
|
|
8
|
+
|
|
9
|
+
1. **Analysis & Selection**
|
|
10
|
+
- Analyze user intent
|
|
11
|
+
- Choose between specific tools or common API flow
|
|
12
|
+
- Verify service support
|
|
13
|
+
|
|
14
|
+
2. **API Flow** (if no specific tool)
|
|
15
|
+
- Identify service
|
|
16
|
+
- Select API via `ListAPIs`
|
|
17
|
+
- Get params via `GetAPIInfo`
|
|
18
|
+
- Execute via `CommonAPICaller`
|
|
19
|
+
|
|
20
|
+
3. **Error Handling**
|
|
21
|
+
- Service not supported: "Unfortunately, we currently do not support this service"
|
|
22
|
+
- API failures: Check error code, params, permissions
|
|
23
|
+
- Param validation: Verify types and formats
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### Retrieval Phase
|
|
28
|
+
|
|
29
|
+
1. **Service Selection**
|
|
30
|
+
|
|
31
|
+
Supported Services:
|
|
32
|
+
- ecs: Elastic Compute Service (ECS)
|
|
33
|
+
- oos: Operations Orchestration Service (OOS)
|
|
34
|
+
- rds: Relational Database Service (RDS)
|
|
35
|
+
- vpc: Virtual Private Cloud (VPC)
|
|
36
|
+
- slb: Server Load Balancer (SLB)
|
|
37
|
+
- ess: Elastic Scaling (ESS)
|
|
38
|
+
- ros: Resource Orchestration Service (ROS)
|
|
39
|
+
- cbn: Cloud Enterprise Network (CBN)
|
|
40
|
+
- dds: MongoDB Database Service (DDS)
|
|
41
|
+
- r-kvstore: Cloud database Tair (compatible with Redis) (R-KVStore)
|
|
42
|
+
|
|
43
|
+
2. **API Process**
|
|
44
|
+
- Use `ListAPIs` for available APIs
|
|
45
|
+
- Use `GetAPIInfo` for API details
|
|
46
|
+
- Use `CommonAPICaller` to execute
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### Notes
|
|
51
|
+
- Filter for most appropriate result
|
|
52
|
+
- Choose based on user context and common usage
|
|
53
|
+
- Validate parameters before calls
|
|
54
|
+
- Handle errors gracefully
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### Common Scenarios
|
|
59
|
+
|
|
60
|
+
1. **Instance Management**
|
|
61
|
+
```
|
|
62
|
+
User: "Start ECS instance i-1234567890abcdef0"
|
|
63
|
+
Action: Use OOS_StartInstances
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Monitoring**
|
|
67
|
+
```
|
|
68
|
+
User: "Check ECS CPU usage"
|
|
69
|
+
Action: Use CMS_GetCpuUsageData
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
3. **Custom API**
|
|
73
|
+
```
|
|
74
|
+
User: "Create VPC in cn-hangzhou"
|
|
75
|
+
Action: ListAPIs → GetAPIInfo → CommonAPICaller
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Available Tools
|
|
81
|
+
|
|
82
|
+
### ECS (OOS/API)
|
|
83
|
+
- RunCommand: Execute commands on instances
|
|
84
|
+
- StartInstances: Start ECS instances
|
|
85
|
+
- StopInstances: Stop ECS instances
|
|
86
|
+
- RebootInstances: Reboot ECS instances
|
|
87
|
+
- DescribeInstances: List instance details
|
|
88
|
+
- DescribeRegions: List available regions
|
|
89
|
+
- DescribeZones: List available zones
|
|
90
|
+
- DescribeAvailableResource: Check resource inventory
|
|
91
|
+
- DescribeImages: List available images
|
|
92
|
+
- DescribeSecurityGroups: List security groups
|
|
93
|
+
- RunInstances: Create new instances
|
|
94
|
+
- DeleteInstances: Delete instances
|
|
95
|
+
- ResetPassword: Change instance password
|
|
96
|
+
- ReplaceSystemDisk: Change instance OS
|
|
97
|
+
|
|
98
|
+
### VPC (API)
|
|
99
|
+
- DescribeVpcs: List VPCs
|
|
100
|
+
- DescribeVSwitches: List VSwitches
|
|
101
|
+
|
|
102
|
+
### RDS (OOS/API)
|
|
103
|
+
- DescribeDBInstances: List database instances
|
|
104
|
+
- StartDBInstances: Start RDS instances
|
|
105
|
+
- StopDBInstances: Stop RDS instances
|
|
106
|
+
- RestartDBInstances: Restart RDS instances
|
|
107
|
+
|
|
108
|
+
### OSS (API)
|
|
109
|
+
- ListBuckets: List OSS buckets
|
|
110
|
+
- PutBucket: Create bucket
|
|
111
|
+
- DeleteBucket: Delete bucket
|
|
112
|
+
- ListObjects: List bucket contents
|
|
113
|
+
|
|
114
|
+
### CloudMonitor (API)
|
|
115
|
+
- GetCpuUsageData: Get instance CPU usage
|
|
116
|
+
- GetCpuLoadavgData: Get 1m CPU load
|
|
117
|
+
- GetCpuloadavg5mData: Get 5m CPU load
|
|
118
|
+
- GetCpuloadavg15mData: Get 15m CPU load
|
|
119
|
+
- GetMemUsedData: Get memory usage
|
|
120
|
+
- GetMemUsageData: Get memory utilization
|
|
121
|
+
- GetDiskUsageData: Get disk utilization
|
|
122
|
+
- GetDiskTotalData: Get total disk space
|
|
123
|
+
- GetDiskUsedData: Get used disk space
|
|
124
|
+
|
|
125
|
+
Note: (OOS) = Operations Orchestration Service, (API) = Direct API call
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### Best Practices
|
|
130
|
+
- Use pre-defined tools when possible
|
|
131
|
+
- Follow API rate limits
|
|
132
|
+
- Implement proper error handling
|
|
133
|
+
- Validate all parameters
|
|
134
|
+
- Use appropriate endpoints
|
|
@@ -2,11 +2,25 @@ from mcp.server.fastmcp import FastMCP
|
|
|
2
2
|
import click
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
|
+
from alibaba_cloud_ops_mcp_server.tools.common_api_tools import set_custom_service_list
|
|
5
6
|
from alibaba_cloud_ops_mcp_server.config import config
|
|
6
|
-
from alibaba_cloud_ops_mcp_server.tools import cms_tools, oos_tools, oss_tools, api_tools
|
|
7
|
+
from alibaba_cloud_ops_mcp_server.tools import cms_tools, oos_tools, oss_tools, api_tools, common_api_tools
|
|
7
8
|
|
|
8
9
|
logger = logging.getLogger(__name__)
|
|
9
10
|
|
|
11
|
+
SUPPORTED_SERVICES_MAP = {
|
|
12
|
+
"ecs": "Elastic Compute Service (ECS)",
|
|
13
|
+
"oos": "Operations Orchestration Service (OOS)",
|
|
14
|
+
"rds": "Relational Database Service (RDS)",
|
|
15
|
+
"vpc": "Virtual Private Cloud (VPC)",
|
|
16
|
+
"slb": "Server Load Balancer (SLB)",
|
|
17
|
+
"ess": "Elastic Scaling (ESS)",
|
|
18
|
+
"ros": "Resource Orchestration Service (ROS)",
|
|
19
|
+
"cbn": "Cloud Enterprise Network (CBN)",
|
|
20
|
+
"dds": "MongoDB Database Service (DDS)",
|
|
21
|
+
"r-kvstore": "Cloud database Tair (compatible with Redis) (R-KVStore)"
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
|
|
11
25
|
@click.command()
|
|
12
26
|
@click.option(
|
|
@@ -21,12 +35,32 @@ logger = logging.getLogger(__name__)
|
|
|
21
35
|
default=8000,
|
|
22
36
|
help="Port number",
|
|
23
37
|
)
|
|
24
|
-
|
|
38
|
+
@click.option(
|
|
39
|
+
"--host",
|
|
40
|
+
type=str,
|
|
41
|
+
default="127.0.0.1",
|
|
42
|
+
help="Host",
|
|
43
|
+
)
|
|
44
|
+
@click.option(
|
|
45
|
+
"--services",
|
|
46
|
+
type=str,
|
|
47
|
+
default=None,
|
|
48
|
+
help="Comma-separated list of supported services, e.g., 'ecs,vpc,rds'",
|
|
49
|
+
)
|
|
50
|
+
def main(transport: str, port: int, host: str, services: str):
|
|
25
51
|
# Create an MCP server
|
|
26
52
|
mcp = FastMCP(
|
|
27
53
|
name="alibaba-cloud-ops-mcp-server",
|
|
28
|
-
port=port
|
|
54
|
+
port=port,
|
|
55
|
+
host=host
|
|
29
56
|
)
|
|
57
|
+
|
|
58
|
+
if services:
|
|
59
|
+
service_keys = [s.strip().lower() for s in services.split(",")]
|
|
60
|
+
service_list = [(key, SUPPORTED_SERVICES_MAP.get(key, key)) for key in service_keys]
|
|
61
|
+
set_custom_service_list(service_list)
|
|
62
|
+
for tool in common_api_tools.tools:
|
|
63
|
+
mcp.add_tool(tool)
|
|
30
64
|
for tool in oos_tools.tools:
|
|
31
65
|
mcp.add_tool(tool)
|
|
32
66
|
for tool in cms_tools.tools:
|
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
from mcp.server.fastmcp import FastMCP, Context
|
|
3
3
|
from pydantic import Field
|
|
4
4
|
import logging
|
|
5
|
+
import json
|
|
5
6
|
|
|
6
7
|
import inspect
|
|
7
8
|
import types
|
|
@@ -23,15 +24,50 @@ type_map = {
|
|
|
23
24
|
'number': float
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
REGION_ENDPOINT_SERVICE = ['ecs', 'oos', 'vpc', 'slb']
|
|
28
|
+
|
|
29
|
+
DOUBLE_ENDPOINT_SERVICE = {
|
|
30
|
+
'rds': ['cn-qingdao', 'cn-beijing', 'cn-hangzhou', 'cn-shanghai', 'cn-shenzhen', 'cn-heyuan', 'cn-guangzhou', 'cn-hongkong'],
|
|
31
|
+
'ess': ['cn-qingdao', 'cn-beijing', 'cn-hangzhou', 'cn-shanghai', 'cn-nanjing', 'cn-shenzhen'],
|
|
32
|
+
'ros': ['cn-qingdao'],
|
|
33
|
+
'dds': ['cn-qingdao', 'cn-beijing', 'cn-wulanchabu', 'cn-hangzhou', 'cn-shanghai', 'cn-shenzhen', 'cn-heyuan', 'cn-guangzhou'],
|
|
34
|
+
'r-kvstore': ['cn-qingdao', 'cn-beijing', 'cn-wulanchabu', 'cn-hangzhou', 'cn-shanghai', 'cn-shenzhen', 'cn-heyuan']
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
CENTRAL_ENDPOINTS_SERVICE = ['cbn']
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _get_service_endpoint(service: str, region_id: str):
|
|
41
|
+
region_id = region_id.lower()
|
|
42
|
+
use_region_endpoint = service in REGION_ENDPOINT_SERVICE or (
|
|
43
|
+
service in DOUBLE_ENDPOINT_SERVICE and region_id in DOUBLE_ENDPOINT_SERVICE[service]
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
if use_region_endpoint:
|
|
47
|
+
return f'{service}.{region_id}.aliyuncs.com'
|
|
48
|
+
elif service in CENTRAL_ENDPOINTS_SERVICE or service in DOUBLE_ENDPOINT_SERVICE:
|
|
49
|
+
return f'{service}.aliyuncs.com'
|
|
50
|
+
else:
|
|
51
|
+
return f'{service}.{region_id}.aliyuncs.com'
|
|
52
|
+
|
|
26
53
|
|
|
27
54
|
def create_client(service: str, region_id: str) -> OpenApiClient:
|
|
28
55
|
config = create_config()
|
|
29
56
|
if isinstance(service, str):
|
|
30
57
|
service = service.lower()
|
|
31
|
-
config.endpoint =
|
|
58
|
+
config.endpoint = _get_service_endpoint(service, region_id.lower())
|
|
32
59
|
return OpenApiClient(config)
|
|
33
60
|
|
|
34
61
|
|
|
62
|
+
# 类型为String的JSON数组参数
|
|
63
|
+
ECS_LIST_PARAMETERS = {
|
|
64
|
+
'HpcClusterIds', 'DedicatedHostClusterIds', 'DedicatedHostIds',
|
|
65
|
+
'InstanceIds', 'DeploymentSetIds', 'KeyPairNames', 'SecurityGroupIds',
|
|
66
|
+
'diskIds', 'repeatWeekdays', 'timePoints', 'DiskIds', 'SnapshotLinkIds',
|
|
67
|
+
'EipAddresses', 'PublicIpAddresses', 'PrivateIpAddresses'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
35
71
|
def _tools_api_call(service: str, api: str, parameters: dict, ctx: Context):
|
|
36
72
|
service = service.lower()
|
|
37
73
|
api_meta, _ = ApiMetaClient.get_api_meta(service, api)
|
|
@@ -39,8 +75,16 @@ def _tools_api_call(service: str, api: str, parameters: dict, ctx: Context):
|
|
|
39
75
|
method = 'POST' if api_meta.get('methods', [])[0] == 'post' else 'GET'
|
|
40
76
|
path = api_meta.get('path', '/')
|
|
41
77
|
style = ApiMetaClient.get_service_style(service)
|
|
78
|
+
|
|
79
|
+
# 处理特殊参数格式
|
|
80
|
+
processed_parameters = parameters.copy()
|
|
81
|
+
if service == 'ecs':
|
|
82
|
+
for param_name, param_value in parameters.items():
|
|
83
|
+
if param_name in ECS_LIST_PARAMETERS and isinstance(param_value, list):
|
|
84
|
+
processed_parameters[param_name] = json.dumps(param_value)
|
|
85
|
+
|
|
42
86
|
req = open_api_models.OpenApiRequest(
|
|
43
|
-
query=OpenApiUtilClient.query(
|
|
87
|
+
query=OpenApiUtilClient.query(processed_parameters)
|
|
44
88
|
)
|
|
45
89
|
params = open_api_models.Params(
|
|
46
90
|
action=api,
|
|
@@ -53,7 +97,7 @@ def _tools_api_call(service: str, api: str, parameters: dict, ctx: Context):
|
|
|
53
97
|
req_body_type='formData',
|
|
54
98
|
body_type='json'
|
|
55
99
|
)
|
|
56
|
-
client = create_client(service,
|
|
100
|
+
client = create_client(service, processed_parameters.get('RegionId', 'cn-hangzhou'))
|
|
57
101
|
runtime = util_models.RuntimeOptions()
|
|
58
102
|
return client.call_api(params, req, runtime)
|
|
59
103
|
|
|
@@ -75,9 +119,15 @@ def _create_function_schemas(service, api, api_meta):
|
|
|
75
119
|
description = schema.get('description', '')
|
|
76
120
|
example = schema.get('example', '')
|
|
77
121
|
type_ = schema.get('type', '')
|
|
78
|
-
description = f'{description}
|
|
122
|
+
description = f'{description} 参数类型: {type_},参数示例:{example}'
|
|
79
123
|
required = schema.get('required', False)
|
|
80
|
-
|
|
124
|
+
|
|
125
|
+
# 只有在service为ecs时,才对特定参数进行特殊处理
|
|
126
|
+
if service.lower() == 'ecs' and name in ECS_LIST_PARAMETERS and type_ == 'string':
|
|
127
|
+
python_type = list
|
|
128
|
+
else:
|
|
129
|
+
python_type = type_map.get(type_, str)
|
|
130
|
+
|
|
81
131
|
field_info = (
|
|
82
132
|
python_type,
|
|
83
133
|
field(
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
from alibabacloud_tea_openapi import models as open_api_models
|
|
5
|
+
from alibabacloud_tea_util import models as util_models
|
|
6
|
+
from alibabacloud_tea_openapi.client import Client as OpenApiClient
|
|
7
|
+
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient
|
|
8
|
+
from alibaba_cloud_ops_mcp_server.alibabacloud.api_meta_client import ApiMetaClient
|
|
9
|
+
from alibaba_cloud_ops_mcp_server.alibabacloud.static import PROMPT_UNDERSTANDING
|
|
10
|
+
from alibaba_cloud_ops_mcp_server.tools.api_tools import create_client, _tools_api_call
|
|
11
|
+
|
|
12
|
+
END_STATUSES = ['Success', 'Failed', 'Cancelled']
|
|
13
|
+
|
|
14
|
+
tools = []
|
|
15
|
+
|
|
16
|
+
_CUSTOM_SERVICE_LIST = None
|
|
17
|
+
|
|
18
|
+
logger = logging.getLogger(__name__)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def set_custom_service_list(service_list):
|
|
22
|
+
global _CUSTOM_SERVICE_LIST
|
|
23
|
+
_CUSTOM_SERVICE_LIST = service_list
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@tools.append
|
|
27
|
+
def PromptUnderstanding() -> str:
|
|
28
|
+
"""
|
|
29
|
+
Always use this tool first to understand the user's query and convert it into suggestions from Alibaba Cloud experts.
|
|
30
|
+
"""
|
|
31
|
+
global _CUSTOM_SERVICE_LIST
|
|
32
|
+
|
|
33
|
+
content = PROMPT_UNDERSTANDING
|
|
34
|
+
if _CUSTOM_SERVICE_LIST:
|
|
35
|
+
import re
|
|
36
|
+
pattern = r'Supported Services\s*:\s*\n(?:\s{3}- .+?\n)+'
|
|
37
|
+
replacement = f"Supported Services:\n - " + "\n - ".join([f"{k}: {v}" for k, v in _CUSTOM_SERVICE_LIST])
|
|
38
|
+
content = re.sub(pattern, replacement, content, flags=re.DOTALL)
|
|
39
|
+
|
|
40
|
+
return content
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@tools.append
|
|
44
|
+
def ListAPIs(
|
|
45
|
+
service: str = Field(description='AlibabaCloud service code')
|
|
46
|
+
):
|
|
47
|
+
"""
|
|
48
|
+
Use PromptUnderstanding tool first to understand the user's query, Get the corresponding API list information through the service name to prepare for the subsequent selection of the appropriate API to call
|
|
49
|
+
"""
|
|
50
|
+
return ApiMetaClient.get_apis_in_service(service)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@tools.append
|
|
54
|
+
def GetAPIInfo(
|
|
55
|
+
service: str = Field(description='AlibabaCloud service code'),
|
|
56
|
+
api: str = Field(description='AlibabaCloud api name'),
|
|
57
|
+
):
|
|
58
|
+
"""
|
|
59
|
+
Use PromptUnderstanding tool first to understand the user's query, After specifying the service name and API name, get the detailed API META of the corresponding API
|
|
60
|
+
"""
|
|
61
|
+
data, version = ApiMetaClient.get_api_meta(service, api)
|
|
62
|
+
return data.get('parameters')
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@tools.append
|
|
66
|
+
def CommonAPICaller(
|
|
67
|
+
service: str = Field(description='AlibabaCloud service code'),
|
|
68
|
+
api: str = Field(description='AlibabaCloud api name'),
|
|
69
|
+
parameters: dict = Field(description='AlibabaCloud ECS instance ID List', default={}),
|
|
70
|
+
):
|
|
71
|
+
"""
|
|
72
|
+
Use PromptUnderstanding tool first to understand the user's query, Perform the actual call by specifying the Service, API, and Parameters
|
|
73
|
+
"""
|
|
74
|
+
return _tools_api_call(service, api, parameters, None)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: alibaba-cloud-ops-mcp-server
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: A MCP server for Alibaba Cloud
|
|
5
5
|
Author-email: Zheng Dayu <dayu.zdy@alibaba-inc.com>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -55,19 +55,24 @@ To use `alibaba-cloud-ops-mcp-server` MCP Server with any other MCP Client, you
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
[For detailed parameter description, see MCP startup parameter document](./README_mcp_args.md)
|
|
59
|
+
|
|
58
60
|
## MCP Maketplace Integration
|
|
59
61
|
|
|
60
62
|
* [Cline](https://cline.bot/mcp-marketplace)
|
|
63
|
+
* [Cursor](https://docs.cursor.com/tools) [](https://cursor.com/install-mcp?name=alibaba-cloud-ops-mcp-server&config=eyJ0aW1lb3V0Ijo2MDAsImNvbW1hbmQiOiJ1dnggYWxpYmFiYS1jbG91ZC1vcHMtbWNwLXNlcnZlckBsYXRlc3QiLCJlbnYiOnsiQUxJQkFCQV9DTE9VRF9BQ0NFU1NfS0VZX0lEIjoiWW91ciBBY2Nlc3MgS2V5IElEIiwiQUxJQkFCQV9DTE9VRF9BQ0NFU1NfS0VZX1NFQ1JFVCI6IllvdXIgQWNjZXNzIEtleSBTRUNSRVQifX0%3D)
|
|
61
64
|
* [ModelScope](https://www.modelscope.cn/mcp/servers/@aliyun/alibaba-cloud-ops-mcp-server?lang=en_US)
|
|
62
65
|
* [Lingma](https://lingma.aliyun.com/)
|
|
63
66
|
* [Smithery AI](https://smithery.ai/server/@aliyun/alibaba-cloud-ops-mcp-server)
|
|
64
67
|
* [FC-Function AI](https://cap.console.aliyun.com/template-detail?template=237)
|
|
68
|
+
* [Alibaba Cloud Model Studio](https://bailian.console.aliyun.com/?tab=mcp#/mcp-market/detail/alibaba-cloud-ops)
|
|
65
69
|
|
|
66
70
|
## Know More
|
|
67
71
|
|
|
68
|
-
* [Alibaba Cloud MCP Server is ready to use out of the box!!](https://developer.aliyun.com/article/1661348)
|
|
69
|
-
* [Setup Alibaba Cloud MCP Server on Bailian](https://developer.aliyun.com/article/1662120)
|
|
72
|
+
* [Alibaba Cloud Ops MCP Server is ready to use out of the box!!](https://developer.aliyun.com/article/1661348)
|
|
73
|
+
* [Setup Alibaba Cloud Ops MCP Server on Bailian](https://developer.aliyun.com/article/1662120)
|
|
70
74
|
* [Build your own Alibaba Cloud OpenAPI MCP Server with 10 lines of code](https://developer.aliyun.com/article/1662202)
|
|
75
|
+
* [Alibaba Cloud Ops MCP Server is officially available on the Alibaba Cloud Model Studio Platform MCP Marketplace](https://developer.aliyun.com/article/1665019)
|
|
71
76
|
|
|
72
77
|
## Tools
|
|
73
78
|
|
{alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/RECORD
RENAMED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
alibaba_cloud_ops_mcp_server/__init__.py,sha256=BaluUNyRz8Qw-X7Y0ywDezwbkqiSvWlSYn2452XeGcA,213
|
|
2
2
|
alibaba_cloud_ops_mcp_server/config.py,sha256=Nq6AT8bqSVa6zu9xjInaSjFcxA-GC7MLlCsV1q53yO0,514
|
|
3
|
-
alibaba_cloud_ops_mcp_server/server.py,sha256=
|
|
3
|
+
alibaba_cloud_ops_mcp_server/server.py,sha256=tvRVQi1d7oPc-OsBHf6Za1Qht_bhNm2nf4B2aQ84Fyw,2246
|
|
4
4
|
alibaba_cloud_ops_mcp_server/alibabacloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
alibaba_cloud_ops_mcp_server/alibabacloud/api_meta_client.py,sha256=
|
|
5
|
+
alibaba_cloud_ops_mcp_server/alibabacloud/api_meta_client.py,sha256=t2TSc0Gzcy_uEcaCgiHHuLoMiEGu3-NCtYmwYjyPWsY,7973
|
|
6
6
|
alibaba_cloud_ops_mcp_server/alibabacloud/exception.py,sha256=7PdhgqgXEGrTPL1cj98h9EH-RrM6-2TT89PDtcmlpmU,1230
|
|
7
7
|
alibaba_cloud_ops_mcp_server/alibabacloud/utils.py,sha256=jWQtP59P4ejh7N6xiYSDq1WgCd3Les0aSZr2pLGzkls,299
|
|
8
|
+
alibaba_cloud_ops_mcp_server/alibabacloud/static/PROMPT_UNDERSTANDING.md,sha256=494HcCQQCc_iqDrRKhk7eWXB4I0dMtqCseT78KphDHg,3553
|
|
9
|
+
alibaba_cloud_ops_mcp_server/alibabacloud/static/__init__.py,sha256=wJrYamaIb7e_kA4ILZpdP1f1TUUTXMGqEhA4IbSZ2Ts,230
|
|
8
10
|
alibaba_cloud_ops_mcp_server/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
alibaba_cloud_ops_mcp_server/tools/api_tools.py,sha256=
|
|
11
|
+
alibaba_cloud_ops_mcp_server/tools/api_tools.py,sha256=G3IsVOuvOGFupteJmESJowlbGGj2po2uJpcx53gzvRA,7702
|
|
10
12
|
alibaba_cloud_ops_mcp_server/tools/cms_tools.py,sha256=GFSBDTddvQ7M9fDGm69jvH6Yt4nui5uOVjwD61CZKT4,4191
|
|
13
|
+
alibaba_cloud_ops_mcp_server/tools/common_api_tools.py,sha256=ccQAWqS1I9F-fdOdjLcXN-dIhNqSbZV8T5ODuGXlfXM,2711
|
|
11
14
|
alibaba_cloud_ops_mcp_server/tools/oos_tools.py,sha256=l228yl_SGg_rNdrBSDeqWYI8ZE1XUAHhsPLArvfE4A8,10116
|
|
12
15
|
alibaba_cloud_ops_mcp_server/tools/oss_tools.py,sha256=c7D1fAjFBqHl0oMy0O6i7onoXeAN9cpdBdLtXKrxVQE,4615
|
|
13
|
-
alibaba_cloud_ops_mcp_server-0.
|
|
14
|
-
alibaba_cloud_ops_mcp_server-0.
|
|
15
|
-
alibaba_cloud_ops_mcp_server-0.
|
|
16
|
-
alibaba_cloud_ops_mcp_server-0.
|
|
17
|
-
alibaba_cloud_ops_mcp_server-0.
|
|
16
|
+
alibaba_cloud_ops_mcp_server-0.9.0.dist-info/METADATA,sha256=uDR__noYnkGhBgvSiLicUYGUAdUOwshyTKlCz5WNenM,5966
|
|
17
|
+
alibaba_cloud_ops_mcp_server-0.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
+
alibaba_cloud_ops_mcp_server-0.9.0.dist-info/entry_points.txt,sha256=ESGAWXKEp184forhs7VzTD4P1AUdZz6vCW6hRUKITGw,83
|
|
19
|
+
alibaba_cloud_ops_mcp_server-0.9.0.dist-info/licenses/LICENSE,sha256=gQgVkp2ttRCjodiPpXZZR-d7JnrYIYNiHk1YDUYgpa4,11331
|
|
20
|
+
alibaba_cloud_ops_mcp_server-0.9.0.dist-info/RECORD,,
|
{alibaba_cloud_ops_mcp_server-0.8.7.dist-info → alibaba_cloud_ops_mcp_server-0.9.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|