alibaba-cloud-ops-mcp-server 0.8.1b1__py3-none-any.whl → 0.8.3__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.
@@ -0,0 +1,46 @@
1
+ import sys
2
+ import json
3
+ import logging
4
+
5
+ logger = logging.getLogger(__name__)
6
+
7
+
8
+ class AcsException(Exception):
9
+ msg_fmt = 'An unknown exception occurred.'
10
+ status = 500
11
+ code = 'InternalError'
12
+
13
+ def __init__(self, **kwargs):
14
+ self.kwargs = kwargs
15
+
16
+ try:
17
+ self.message = self.msg_fmt.format(**kwargs) if kwargs else self.msg_fmt
18
+ if isinstance(self.message, str):
19
+ self.message = self.message.rstrip('.') + '.'
20
+ except KeyError:
21
+ logger.exception(f'Exception in string format operation: {self.code}, {self.msg_fmt}, {kwargs}')
22
+ for name, value in kwargs.items():
23
+ logger.error(f'{name}: {value}')
24
+
25
+ def __str__(self):
26
+ body = {
27
+ 'Message': self.message,
28
+ 'Code': self.code
29
+ }
30
+ return json.dumps(body)
31
+
32
+ def __deepcopy__(self, memo):
33
+ return self.__class__(**self.kwargs)
34
+
35
+ def __unicode__(self):
36
+ body = {
37
+ 'Message': self.message,
38
+ 'Code': self.code
39
+ }
40
+ return json.dumps(body)
41
+
42
+
43
+ class OOSExecutionFailed(AcsException):
44
+ msg_fmt = 'OOS Execution Failed, reason: {reason}.'
45
+ status = 400
46
+ code = 'Execution.Failed'
@@ -4,7 +4,6 @@ from alibabacloud_tea_openapi.models import Config
4
4
 
5
5
  def create_config():
6
6
  credentialsClient = CredClient()
7
- a = credentialsClient.get_access_key_id
8
7
  config = Config(credential=credentialsClient)
9
8
  config.user_agent = 'alibaba-cloud-ops-mcp-server'
10
9
  return config
@@ -4,10 +4,7 @@ import os
4
4
  import json
5
5
 
6
6
  from alibabacloud_cms20190101.client import Client as cms20190101Client
7
- from alibabacloud_tea_openapi import models as open_api_models
8
7
  from alibabacloud_cms20190101 import models as cms_20190101_models
9
- from alibabacloud_tea_util import models as util_models
10
- from alibabacloud_tea_util.client import Client as UtilClient
11
8
  from alibaba_cloud_ops_mcp_server.alibabacloud.utils import create_config
12
9
 
13
10
 
@@ -5,12 +5,12 @@ import json
5
5
  import time
6
6
 
7
7
  from alibabacloud_oos20190601.client import Client as oos20190601Client
8
- from alibabacloud_tea_openapi import models as open_api_models
9
8
  from alibabacloud_oos20190601 import models as oos_20190601_models
10
9
  from alibaba_cloud_ops_mcp_server.alibabacloud.utils import create_config
10
+ from alibaba_cloud_ops_mcp_server.alibabacloud import exception
11
11
 
12
12
 
13
- END_STATUSES = ['Success', 'Failed', 'Cancelled']
13
+ END_STATUSES = [SUCCESS, FAILED, CANCELLED] = ['Success', 'Failed', 'Cancelled']
14
14
 
15
15
 
16
16
  tools = []
@@ -39,7 +39,10 @@ def _start_execution_sync(region_id: str, template_name: str, parameters: dict):
39
39
  )
40
40
  list_executions_resp = client.list_executions(list_executions_request)
41
41
  status = list_executions_resp.body.executions[0].status
42
- if status in END_STATUSES:
42
+ if status == FAILED:
43
+ status_message = list_executions_resp.body.executions[0].status_message
44
+ raise exception.OOSExecutionFailed(reason=status_message)
45
+ elif status in END_STATUSES:
43
46
  return list_executions_resp.body
44
47
  time.sleep(1)
45
48
  @tools.append
@@ -5,7 +5,6 @@ import alibabacloud_oss_v2 as oss
5
5
  from pydantic import Field
6
6
  from alibabacloud_oss_v2 import Credentials
7
7
  from alibabacloud_oss_v2.credentials import EnvironmentVariableCredentialsProvider
8
- from alibaba_cloud_ops_mcp_server.alibabacloud.utils import create_config
9
8
  from alibabacloud_credentials.client import Client as CredClient
10
9
 
11
10
 
@@ -29,6 +28,7 @@ class CredentialsProvider(EnvironmentVariableCredentialsProvider):
29
28
  def create_client(region_id: str) -> oss.Client:
30
29
  credentials_provider = CredentialsProvider()
31
30
  cfg = oss.config.load_default()
31
+ cfg.user_agent = 'alibaba-cloud-ops-mcp-server'
32
32
  cfg.credentials_provider = credentials_provider
33
33
  cfg.region = region_id
34
34
  return oss.Client(cfg)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alibaba-cloud-ops-mcp-server
3
- Version: 0.8.1b1
3
+ Version: 0.8.3
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
@@ -13,10 +13,14 @@ Requires-Dist: click>=8.1.8
13
13
  Requires-Dist: mcp[cli]>=1.6.0
14
14
  Description-Content-Type: text/markdown
15
15
 
16
- # alibaba-cloud-ops-mcp-server
16
+ # Alibaba Cloud Ops MCP Server
17
+
18
+ [![GitHub stars](https://img.shields.io/github/stars/aliyun/alibaba-cloud-ops-mcp-server?style=social)](https://github.com/aliyun/alibaba-cloud-ops-mcp-server)
17
19
 
18
20
  [中文版本](./README_zh.md)
19
21
 
22
+ Alibaba Cloud Ops MCP Server is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that provides seamless integration with Alibaba Cloud APIs, enabling AI assistants to operation resources on Alibaba Cloud, supporting ECS, Cloud Monitor, OOS andother widely used cloud products.
23
+
20
24
  ## Prepare
21
25
 
22
26
  Install [uv](https://github.com/astral-sh/uv)
@@ -50,6 +54,20 @@ To use `alibaba-cloud-ops-mcp-server` MCP Server with any other MCP Client, you
50
54
  }
51
55
  ```
52
56
 
57
+ ## MCP Maketplace Integration
58
+
59
+ * [Cline](https://cline.bot/mcp-marketplace)
60
+ * [ModelScope](https://www.modelscope.cn/mcp/servers/@aliyun/alibaba-cloud-ops-mcp-server?lang=en_US)
61
+ * [Lingma](https://lingma.aliyun.com/)
62
+ * [Smithery AI](https://smithery.ai/server/@aliyun/alibaba-cloud-ops-mcp-server)
63
+ * [FC-Function AI](https://cap.console.aliyun.com/template-detail?template=237)
64
+
65
+ ## Know More
66
+
67
+ * [Alibaba Cloud MCP Server is ready to use out of the box!!](https://developer.aliyun.com/article/1661348)
68
+ * [Setup Alibaba Cloud MCP Server on Bailian](https://developer.aliyun.com/article/1662120)
69
+ * [Build your own Alibaba Cloud OpenAPI MCP Server with 10 lines of code](https://developer.aliyun.com/article/1662202)
70
+
53
71
  ## Tools
54
72
 
55
73
  | **Product** | **Tool** | **Function** | **Implematation** | **Status** |
@@ -93,7 +111,3 @@ To use `alibaba-cloud-ops-mcp-server` MCP Server with any other MCP Client, you
93
111
  If you have any questions, please join the [Alibaba Cloud Ops MCP discussion group](https://qr.dingtalk.com/action/joingroup?code=v1,k1,iFxYG4jjLVh1jfmNAkkclji7CN5DSIdT+jvFsLyI60I=&_dt_no_comment=1&origin=11) (DingTalk group: 113455011677) for discussion.
94
112
 
95
113
  <img src="https://oos-public-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/alibaba-cloud-ops-mcp-server/Alibaba-Cloud-Ops-MCP-User-Group-en.png" width="500">
96
-
97
- ## Know More
98
-
99
- - [Alibaba Cloud MCP Server is ready to use out of the box!!](https://developer.aliyun.com/article/1661348)
@@ -0,0 +1,17 @@
1
+ alibaba_cloud_ops_mcp_server/__init__.py,sha256=BaluUNyRz8Qw-X7Y0ywDezwbkqiSvWlSYn2452XeGcA,213
2
+ alibaba_cloud_ops_mcp_server/config.py,sha256=Nq6AT8bqSVa6zu9xjInaSjFcxA-GC7MLlCsV1q53yO0,514
3
+ alibaba_cloud_ops_mcp_server/server.py,sha256=nwn04rpm68GI3UJ_hQ0E3pny86dJ47Lw1LncQiBIfW8,896
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=inOmW1no1YsR6_ezOZfgJtzGKo5nRTDufkf2qUTuNOs,7605
6
+ alibaba_cloud_ops_mcp_server/alibabacloud/exception.py,sha256=7PdhgqgXEGrTPL1cj98h9EH-RrM6-2TT89PDtcmlpmU,1230
7
+ alibaba_cloud_ops_mcp_server/alibabacloud/utils.py,sha256=jWQtP59P4ejh7N6xiYSDq1WgCd3Les0aSZr2pLGzkls,299
8
+ alibaba_cloud_ops_mcp_server/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ alibaba_cloud_ops_mcp_server/tools/api_tools.py,sha256=lydogpHEYgqzLAgUP4szBy-67z7lWXiqwUaTvt_IQVM,5807
10
+ alibaba_cloud_ops_mcp_server/tools/cms_tools.py,sha256=t70H7MnYo0cuIY00_6V3cGz2btSRtJFm8qW8WWwzyCc,4155
11
+ alibaba_cloud_ops_mcp_server/tools/oos_tools.py,sha256=-e7ikaf708vAueOUFoWp3xMbpaj6JUGaB1KbK-YniV8,10076
12
+ alibaba_cloud_ops_mcp_server/tools/oss_tools.py,sha256=IJDcs4BvPgF5A85oBZJ5xrJDSim_fCzRaxnCHjd0hvw,4599
13
+ alibaba_cloud_ops_mcp_server-0.8.3.dist-info/METADATA,sha256=DuoogDjJAKxI6Vhpt6iAlWlGrojJDYuotPWhFX6KfHw,5100
14
+ alibaba_cloud_ops_mcp_server-0.8.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ alibaba_cloud_ops_mcp_server-0.8.3.dist-info/entry_points.txt,sha256=ESGAWXKEp184forhs7VzTD4P1AUdZz6vCW6hRUKITGw,83
16
+ alibaba_cloud_ops_mcp_server-0.8.3.dist-info/licenses/LICENSE,sha256=gQgVkp2ttRCjodiPpXZZR-d7JnrYIYNiHk1YDUYgpa4,11331
17
+ alibaba_cloud_ops_mcp_server-0.8.3.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- alibaba_cloud_ops_mcp_server/__init__.py,sha256=BaluUNyRz8Qw-X7Y0ywDezwbkqiSvWlSYn2452XeGcA,213
2
- alibaba_cloud_ops_mcp_server/config.py,sha256=Nq6AT8bqSVa6zu9xjInaSjFcxA-GC7MLlCsV1q53yO0,514
3
- alibaba_cloud_ops_mcp_server/server.py,sha256=nwn04rpm68GI3UJ_hQ0E3pny86dJ47Lw1LncQiBIfW8,896
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=inOmW1no1YsR6_ezOZfgJtzGKo5nRTDufkf2qUTuNOs,7605
6
- alibaba_cloud_ops_mcp_server/alibabacloud/utils.py,sha256=rcDEioZpT4UHPu1Y1rFKM3Ms_cFPdvPS0824ENt6Uqs,343
7
- alibaba_cloud_ops_mcp_server/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- alibaba_cloud_ops_mcp_server/tools/api_tools.py,sha256=lydogpHEYgqzLAgUP4szBy-67z7lWXiqwUaTvt_IQVM,5807
9
- alibaba_cloud_ops_mcp_server/tools/cms_tools.py,sha256=VKj-qxtCWfHTINLaAB34PwfOMzpGH-5HMeQ-MTJSt08,4336
10
- alibaba_cloud_ops_mcp_server/tools/oos_tools.py,sha256=0NUnLrQjAvf3vaZN0DA3iEFMUpGyi7qNwzL41PzOnM0,9859
11
- alibaba_cloud_ops_mcp_server/tools/oss_tools.py,sha256=NM8HwZrQzx2uIYsF5bvJ7FoGfSD2ANC0t46ImgpsRWQ,4621
12
- alibaba_cloud_ops_mcp_server-0.8.1b1.dist-info/METADATA,sha256=2mMDY8ybEIhEldL9dc3OhiOwy_cvs_UHj7N_ZA4OfI8,4035
13
- alibaba_cloud_ops_mcp_server-0.8.1b1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- alibaba_cloud_ops_mcp_server-0.8.1b1.dist-info/entry_points.txt,sha256=ESGAWXKEp184forhs7VzTD4P1AUdZz6vCW6hRUKITGw,83
15
- alibaba_cloud_ops_mcp_server-0.8.1b1.dist-info/licenses/LICENSE,sha256=gQgVkp2ttRCjodiPpXZZR-d7JnrYIYNiHk1YDUYgpa4,11331
16
- alibaba_cloud_ops_mcp_server-0.8.1b1.dist-info/RECORD,,