alibaba-cloud-ops-mcp-server 0.9.3__py3-none-any.whl → 0.9.4__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/static/PROMPT_UNDERSTANDING.md +1 -0
- alibaba_cloud_ops_mcp_server/server.py +2 -1
- alibaba_cloud_ops_mcp_server/tools/api_tools.py +37 -11
- {alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/METADATA +1 -1
- {alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/RECORD +8 -8
- {alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/WHEEL +0 -0
- {alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/entry_points.txt +0 -0
- {alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -39,6 +39,7 @@ When a user submits a request, analyze their needs and check if matching tools e
|
|
|
39
39
|
- cbn: Cloud Enterprise Network (CBN)
|
|
40
40
|
- dds: MongoDB Database Service (DDS)
|
|
41
41
|
- r-kvstore: Cloud database Tair (compatible with Redis) (R-KVStore)
|
|
42
|
+
- bssopenapi: Billing and Cost Management (BssOpenAPI)
|
|
42
43
|
|
|
43
44
|
2. **API Process**
|
|
44
45
|
- Use `ListAPIs` for available APIs
|
|
@@ -19,7 +19,8 @@ SUPPORTED_SERVICES_MAP = {
|
|
|
19
19
|
"ros": "Resource Orchestration Service (ROS)",
|
|
20
20
|
"cbn": "Cloud Enterprise Network (CBN)",
|
|
21
21
|
"dds": "MongoDB Database Service (DDS)",
|
|
22
|
-
"r-kvstore": "Cloud database Tair (compatible with Redis) (R-KVStore)"
|
|
22
|
+
"r-kvstore": "Cloud database Tair (compatible with Redis) (R-KVStore)",
|
|
23
|
+
"bssopenapi": "Billing and Cost Management (BssOpenAPI)"
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
|
|
@@ -34,32 +34,58 @@ DOUBLE_ENDPOINT_SERVICE = {
|
|
|
34
34
|
'r-kvstore': ['cn-qingdao', 'cn-beijing', 'cn-wulanchabu', 'cn-hangzhou', 'cn-shanghai', 'cn-shenzhen', 'cn-heyuan']
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
CENTRAL_SERVICE = ['cbn', 'ros', 'ram']
|
|
38
|
+
|
|
39
|
+
CENTRAL_SERVICE_ENDPOINTS = {
|
|
40
|
+
'bssopenapi': {
|
|
41
|
+
'DomesticEndpoint': 'business.aliyuncs.com',
|
|
42
|
+
'InternationalEndpoint': 'business.ap-southeast-1.aliyuncs.com',
|
|
43
|
+
'DomesticRegion': ['cn-qingdao', 'cn-beijing', 'cn-zhangjiakou', 'cn-huhehaote', 'cn-wulanchabu',
|
|
44
|
+
'cn-hangzhou', 'cn-shanghai', 'cn-shenzhen', 'cn-chengdu', 'cn-hongkong']
|
|
45
|
+
}
|
|
46
|
+
}
|
|
38
47
|
|
|
39
48
|
|
|
40
49
|
def _get_service_endpoint(service: str, region_id: str):
|
|
41
50
|
region_id = region_id.lower()
|
|
42
|
-
use_region_endpoint = service in REGION_ENDPOINT_SERVICE or (
|
|
43
|
-
service in DOUBLE_ENDPOINT_SERVICE and region_id not in DOUBLE_ENDPOINT_SERVICE[service]
|
|
44
|
-
)
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
# Prioritizing central service endpoints
|
|
53
|
+
central = CENTRAL_SERVICE_ENDPOINTS.get(service)
|
|
54
|
+
if central:
|
|
55
|
+
if region_id in central.get('DomesticRegion', []):
|
|
56
|
+
return central['DomesticEndpoint']
|
|
57
|
+
else:
|
|
58
|
+
return central['InternationalEndpoint']
|
|
59
|
+
|
|
60
|
+
# Determine whether to use regional endpoints
|
|
61
|
+
if service in REGION_ENDPOINT_SERVICE:
|
|
47
62
|
return f'{service}.{region_id}.aliyuncs.com'
|
|
48
|
-
|
|
63
|
+
|
|
64
|
+
if service in DOUBLE_ENDPOINT_SERVICE:
|
|
65
|
+
not_in_central = region_id not in DOUBLE_ENDPOINT_SERVICE[service]
|
|
66
|
+
if not_in_central:
|
|
67
|
+
return f'{service}.{region_id}.aliyuncs.com'
|
|
68
|
+
else:
|
|
69
|
+
return f'{service}.aliyuncs.com'
|
|
70
|
+
|
|
71
|
+
if service in CENTRAL_SERVICE:
|
|
49
72
|
return f'{service}.aliyuncs.com'
|
|
50
|
-
|
|
51
|
-
|
|
73
|
+
|
|
74
|
+
# Default
|
|
75
|
+
return f'{service}.{region_id}.aliyuncs.com'
|
|
52
76
|
|
|
53
77
|
|
|
54
78
|
def create_client(service: str, region_id: str) -> OpenApiClient:
|
|
55
79
|
config = create_config()
|
|
56
80
|
if isinstance(service, str):
|
|
57
81
|
service = service.lower()
|
|
58
|
-
|
|
82
|
+
endpoint = _get_service_endpoint(service, region_id.lower())
|
|
83
|
+
config.endpoint = endpoint
|
|
84
|
+
logger.info(f'Service Endpoint: {endpoint}')
|
|
59
85
|
return OpenApiClient(config)
|
|
60
86
|
|
|
61
87
|
|
|
62
|
-
#
|
|
88
|
+
# JSON array parameter of type String
|
|
63
89
|
ECS_LIST_PARAMETERS = {
|
|
64
90
|
'HpcClusterIds', 'DedicatedHostClusterIds', 'DedicatedHostIds',
|
|
65
91
|
'InstanceIds', 'DeploymentSetIds', 'KeyPairNames', 'SecurityGroupIds',
|
|
@@ -76,7 +102,7 @@ def _tools_api_call(service: str, api: str, parameters: dict, ctx: Context):
|
|
|
76
102
|
path = api_meta.get('path', '/')
|
|
77
103
|
style = ApiMetaClient.get_service_style(service)
|
|
78
104
|
|
|
79
|
-
#
|
|
105
|
+
# Handling special parameter formats
|
|
80
106
|
processed_parameters = parameters.copy()
|
|
81
107
|
processed_parameters = {k: v for k, v in processed_parameters.items() if v is not None}
|
|
82
108
|
if service == 'ecs':
|
{alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/RECORD
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
alibaba_cloud_ops_mcp_server/__init__.py,sha256=BaluUNyRz8Qw-X7Y0ywDezwbkqiSvWlSYn2452XeGcA,213
|
|
2
2
|
alibaba_cloud_ops_mcp_server/__main__.py,sha256=Q40p2HtWGvxj1JLvS7dn95NLzDhJNQ6JAgLLyCb4Y50,63
|
|
3
3
|
alibaba_cloud_ops_mcp_server/config.py,sha256=PizctjXsQUWoMWBY1dFjNffVlZr9K6hNvqA4DpayR_o,513
|
|
4
|
-
alibaba_cloud_ops_mcp_server/server.py,sha256=
|
|
4
|
+
alibaba_cloud_ops_mcp_server/server.py,sha256=zmEL-4X35CklntDuWFk6Mc8QrHq-jvsaF1XLEyhKFSc,2639
|
|
5
5
|
alibaba_cloud_ops_mcp_server/settings.py,sha256=fqbTHaAw59nK7fJo6MyTCY_-M0K9YAD66WpybQalo9I,141
|
|
6
6
|
alibaba_cloud_ops_mcp_server/alibabacloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
alibaba_cloud_ops_mcp_server/alibabacloud/api_meta_client.py,sha256=t2TSc0Gzcy_uEcaCgiHHuLoMiEGu3-NCtYmwYjyPWsY,7973
|
|
8
8
|
alibaba_cloud_ops_mcp_server/alibabacloud/exception.py,sha256=7PdhgqgXEGrTPL1cj98h9EH-RrM6-2TT89PDtcmlpmU,1230
|
|
9
9
|
alibaba_cloud_ops_mcp_server/alibabacloud/utils.py,sha256=tZQAEqGKS6Rx6Te9zNYfPBJ75GnAA-wX7hs6uP_JN0M,1609
|
|
10
|
-
alibaba_cloud_ops_mcp_server/alibabacloud/static/PROMPT_UNDERSTANDING.md,sha256=
|
|
10
|
+
alibaba_cloud_ops_mcp_server/alibabacloud/static/PROMPT_UNDERSTANDING.md,sha256=QPubudP1bwDbWu0Js6MYb4cJd1B2zM_JGp53twYv5yc,3611
|
|
11
11
|
alibaba_cloud_ops_mcp_server/alibabacloud/static/__init__.py,sha256=wJrYamaIb7e_kA4ILZpdP1f1TUUTXMGqEhA4IbSZ2Ts,230
|
|
12
12
|
alibaba_cloud_ops_mcp_server/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
alibaba_cloud_ops_mcp_server/tools/api_tools.py,sha256=
|
|
13
|
+
alibaba_cloud_ops_mcp_server/tools/api_tools.py,sha256=nkYLrrcZ1LVoc-4-sQoyHO4aO-G6Brz_xO5dz6NL9BI,9414
|
|
14
14
|
alibaba_cloud_ops_mcp_server/tools/cms_tools.py,sha256=BmPTiP8wu9DsEHBQsvR7JH9nFkcKMTBuNuafFqSfVxU,4308
|
|
15
15
|
alibaba_cloud_ops_mcp_server/tools/common_api_tools.py,sha256=ccQAWqS1I9F-fdOdjLcXN-dIhNqSbZV8T5ODuGXlfXM,2711
|
|
16
16
|
alibaba_cloud_ops_mcp_server/tools/oos_tools.py,sha256=8CLidg8Vrzpxv4lEOokPdScv31xlg_gX7glifiSqa8g,10063
|
|
17
17
|
alibaba_cloud_ops_mcp_server/tools/oss_tools.py,sha256=MUAiYL4VlsYQPoR_JtHOLcF1i4VYK9KE6ff9BTqJr9E,5014
|
|
18
|
-
alibaba_cloud_ops_mcp_server-0.9.
|
|
19
|
-
alibaba_cloud_ops_mcp_server-0.9.
|
|
20
|
-
alibaba_cloud_ops_mcp_server-0.9.
|
|
21
|
-
alibaba_cloud_ops_mcp_server-0.9.
|
|
22
|
-
alibaba_cloud_ops_mcp_server-0.9.
|
|
18
|
+
alibaba_cloud_ops_mcp_server-0.9.4.dist-info/METADATA,sha256=asXs9bS4X4omeQvusc63uF75qvNqs0DW4_V0YGNZKp4,5965
|
|
19
|
+
alibaba_cloud_ops_mcp_server-0.9.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
20
|
+
alibaba_cloud_ops_mcp_server-0.9.4.dist-info/entry_points.txt,sha256=ESGAWXKEp184forhs7VzTD4P1AUdZz6vCW6hRUKITGw,83
|
|
21
|
+
alibaba_cloud_ops_mcp_server-0.9.4.dist-info/licenses/LICENSE,sha256=gQgVkp2ttRCjodiPpXZZR-d7JnrYIYNiHk1YDUYgpa4,11331
|
|
22
|
+
alibaba_cloud_ops_mcp_server-0.9.4.dist-info/RECORD,,
|
{alibaba_cloud_ops_mcp_server-0.9.3.dist-info → alibaba_cloud_ops_mcp_server-0.9.4.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|