Skip to main content

huaweicloud-mcp-ecs-common

语言切换: English | 中文

华为云 ECS MCP Server 家族的共享工具库。本包服务于 ecs-readonly(mcp_huaweicloud_ecs_readonly)与 ecs-lifecycle(mcp_huaweicloud_ecs_lifecycle)两个 server 包,避免两者重复实现 SDK 响应转换与分页逻辑。

内容

  • sdk_to_dict(obj) —— 递归将 huaweicloudsdk 响应对象转为纯 JSON 兼容数据 (处理标量、bytes、dict、list、带 to_dict() 的对象,以及暴露 __dict__ 的对象)。
  • paginate(fetch, *, result_key, page_size, max_pages=None, advance=None) —— 收集分页列表接口的全部条目,在 servers / flavors / subnets 等场景共用同一套分页 循环骨架。
  • call_sdk(fn, ...) —— 两个 server 共享的 SDK 调用流控层,替代 asyncio.to_thread:进程级信号量限并发(HUAWEICLOUD_MCP_MAX_CONCURRENT,默认 20),429/5xx 与传输层错误重试最多三次(固定退避 5s/10s/20s + 抖动),仍失败抛语义化错误码 (MCP_RATE_LIMITED / MCP_SERVER_ERROR / MCP_TRANSIENT_ERROR,均带"不要立即 重试"的 hint)。

开发

本包是 mcp-huaweicloud-ecs-readonly 与 mcp-huaweicloud-ecs-lifecycle 的本地路径依赖。除标准库外 无运行时依赖。

uv run pytest

Metadata

Release files for huaweicloud-mcp-ecs-common 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for huaweicloud-mcp-ecs-common 0.1.0
File Interpreter ABI Platform Actions
huaweicloud_mcp_ecs_common-0.1.0-py3-none-any.whl Python 3 none any Details for huaweicloud_mcp_ecs_common-0.1.0-py3-none-any.whl

Release files / huaweicloud_mcp_ecs_common-0.1.0-py3-none-any.whl

Download URL huaweicloud_mcp_ecs_common-0.1.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c9212af1ce333892b255d572301a1cc9a76af2038ce75a94d68594d3fe04e9c
BLAKE2b-256 checksum
How to use checksums
86cc48e31f27fa80d17157bd2552751172ef6a250ba66d9b1269cd60ae80c864
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for huaweicloud-mcp-ecs-common 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page