alibaba-cloud-ops-mcp-server 0.8.2__tar.gz → 0.8.4__tar.gz

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.
Files changed (24) hide show
  1. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/PKG-INFO +2 -1
  2. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/README.md +1 -0
  3. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/README_zh.md +1 -0
  4. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/pyproject.toml +1 -1
  5. alibaba_cloud_ops_mcp_server-0.8.4/src/alibaba_cloud_ops_mcp_server/alibabacloud/exception.py +46 -0
  6. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/tools/oos_tools.py +6 -2
  7. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/uv.lock +1 -1
  8. alibaba_cloud_ops_mcp_server-0.8.2/src/alibaba_cloud_ops_mcp_server/server.py +0 -35
  9. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/.gitignore +0 -0
  10. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/LICENSE +0 -0
  11. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/examples/openapi_mcp_quickstart/server.py +0 -0
  12. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/image/Alibaba-Cloud-Ops-MCP-User-Group-en.png +0 -0
  13. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/image/Alibaba-Cloud-Ops-MCP-User-Group-zh.png +0 -0
  14. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/image/alibaba-cloud.png +0 -0
  15. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/__init__.py +0 -0
  16. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/__init__.py +0 -0
  17. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/alibabacloud/__init__.py +0 -0
  18. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/alibabacloud/api_meta_client.py +0 -0
  19. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/alibabacloud/utils.py +0 -0
  20. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/config.py +0 -0
  21. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/tools/__init__.py +0 -0
  22. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/tools/api_tools.py +0 -0
  23. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/tools/cms_tools.py +0 -0
  24. {alibaba_cloud_ops_mcp_server-0.8.2 → alibaba_cloud_ops_mcp_server-0.8.4}/src/alibaba_cloud_ops_mcp_server/tools/oss_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alibaba-cloud-ops-mcp-server
3
- Version: 0.8.2
3
+ Version: 0.8.4
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
@@ -60,6 +60,7 @@ To use `alibaba-cloud-ops-mcp-server` MCP Server with any other MCP Client, you
60
60
  * [ModelScope](https://www.modelscope.cn/mcp/servers/@aliyun/alibaba-cloud-ops-mcp-server?lang=en_US)
61
61
  * [Lingma](https://lingma.aliyun.com/)
62
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)
63
64
 
64
65
  ## Know More
65
66
 
@@ -45,6 +45,7 @@ To use `alibaba-cloud-ops-mcp-server` MCP Server with any other MCP Client, you
45
45
  * [ModelScope](https://www.modelscope.cn/mcp/servers/@aliyun/alibaba-cloud-ops-mcp-server?lang=en_US)
46
46
  * [Lingma](https://lingma.aliyun.com/)
47
47
  * [Smithery AI](https://smithery.ai/server/@aliyun/alibaba-cloud-ops-mcp-server)
48
+ * [FC-Function AI](https://cap.console.aliyun.com/template-detail?template=237)
48
49
 
49
50
  ## Know More
50
51
 
@@ -45,6 +45,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
45
45
  * [魔搭](https://www.modelscope.cn/mcp/servers/@aliyun/alibaba-cloud-ops-mcp-server)
46
46
  * [通义灵码](https://lingma.aliyun.com/)
47
47
  * [Smithery AI](https://smithery.ai/server/@aliyun/alibaba-cloud-ops-mcp-server)
48
+ * [FC-Function AI](https://cap.console.aliyun.com/template-detail?template=237)
48
49
 
49
50
  ## 了解更多
50
51
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "alibaba-cloud-ops-mcp-server"
3
- version = "0.8.2"
3
+ version = "0.8.4"
4
4
  description = "A MCP server for Alibaba Cloud"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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'
@@ -7,9 +7,10 @@ import time
7
7
  from alibabacloud_oos20190601.client import Client as oos20190601Client
8
8
  from alibabacloud_oos20190601 import models as oos_20190601_models
9
9
  from alibaba_cloud_ops_mcp_server.alibabacloud.utils import create_config
10
+ from alibaba_cloud_ops_mcp_server.alibabacloud import exception
10
11
 
11
12
 
12
- END_STATUSES = ['Success', 'Failed', 'Cancelled']
13
+ END_STATUSES = [SUCCESS, FAILED, CANCELLED] = ['Success', 'Failed', 'Cancelled']
13
14
 
14
15
 
15
16
  tools = []
@@ -38,7 +39,10 @@ def _start_execution_sync(region_id: str, template_name: str, parameters: dict):
38
39
  )
39
40
  list_executions_resp = client.list_executions(list_executions_request)
40
41
  status = list_executions_resp.body.executions[0].status
41
- 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:
42
46
  return list_executions_resp.body
43
47
  time.sleep(1)
44
48
  @tools.append
@@ -116,7 +116,7 @@ wheels = [
116
116
 
117
117
  [[package]]
118
118
  name = "alibaba-cloud-ops-mcp-server"
119
- version = "0.8.2"
119
+ version = "0.8.3"
120
120
  source = { editable = "." }
121
121
  dependencies = [
122
122
  { name = "alibabacloud-cms20190101" },
@@ -1,35 +0,0 @@
1
- from mcp.server.fastmcp import FastMCP
2
- import click
3
- import logging
4
-
5
- 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
-
8
- logger = logging.getLogger(__name__)
9
-
10
-
11
- @click.command()
12
- @click.option(
13
- "--transport",
14
- type=click.Choice(["stdio", "sse"]),
15
- default="stdio",
16
- help="Transport type",
17
- )
18
- def main(transport: str):
19
- # Create an MCP server
20
- mcp = FastMCP("alibaba-cloud-ops-mcp-server")
21
- for tool in oos_tools.tools:
22
- mcp.add_tool(tool)
23
- for tool in cms_tools.tools:
24
- mcp.add_tool(tool)
25
- for tool in oss_tools.tools:
26
- mcp.add_tool(tool)
27
- api_tools.create_api_tools(mcp, config)
28
-
29
- # Initialize and run the server
30
- logger.debug(f'mcp server is running on {transport} mode.')
31
- mcp.run(transport=transport)
32
-
33
-
34
- if __name__ == "__main__":
35
- main()