Skip to main content

mcp-server-ecs-common

语言切换: English | 中文

华为云 ECS MCP Server 家族的共享工具库。本包服务于 ecs-readonly(mcp_server_ecs_readonly)与 ecs-lifecycle(mcp_server_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-server-ecs-readonly 与 mcp-server-ecs-lifecycle 的本地路径依赖。除标准库外 无运行时依赖。

uv run pytest

Metadata

Release files for mcp-server-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 mcp-server-ecs-common 0.1.0
File Interpreter ABI Platform Actions
mcp_server_ecs_common-0.1.0-py3-none-any.whl Python 3 none any Details for mcp_server_ecs_common-0.1.0-py3-none-any.whl

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

Download URL mcp_server_ecs_common-0.1.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62ef234779dd50247d526214e0db71841b78940abdfe9f1e614d437e187519b2
BLAKE2b-256 checksum
How to use checksums
a3d5a1e2f76600e6d083c93605fe381bf3c3dfed2fc71a868d03505bdc974e29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for mcp-server-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